@dereekb/dbx-form 9.23.17 → 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/calendar/lib/calendar.module.d.ts +14 -13
- package/calendar/lib/calendar.schedule.selection.component.d.ts +27 -8
- package/calendar/lib/calendar.schedule.selection.popover.content.component.d.ts +1 -3
- package/calendar/lib/calendar.schedule.selection.store.d.ts +8 -9
- package/calendar/lib/field/schedule/calendar.schedule.field.component.d.ts +7 -1
- package/esm2020/calendar/lib/calendar.module.mjs +5 -1
- package/esm2020/calendar/lib/calendar.schedule.selection.component.mjs +30 -12
- package/esm2020/calendar/lib/calendar.schedule.selection.dialog.component.mjs +1 -1
- package/esm2020/calendar/lib/calendar.schedule.selection.popover.component.mjs +3 -3
- package/esm2020/calendar/lib/calendar.schedule.selection.popover.content.component.mjs +1 -2
- package/esm2020/calendar/lib/calendar.schedule.selection.store.mjs +45 -20
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.component.mjs +10 -3
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.mjs +3 -2
- 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-calendar.mjs +98 -45
- package/fesm2015/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2015/dereekb-dbx-form-mapbox.mjs +128 -38
- package/fesm2015/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form-calendar.mjs +95 -43
- package/fesm2020/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form-mapbox.mjs +126 -38
- package/fesm2020/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/lib/extension/calendar/_calendar.scss +4 -0
- 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 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 i2 from '@dereekb/dbx-web/mapbox';
|
|
11
11
|
import { provideMapboxStoreIfParentIsUnavailable, DbxMapboxModule, mapboxZoomLevel, MAPBOX_MIN_ZOOM_LEVEL, MAPBOX_MAX_ZOOM_LEVEL } from '@dereekb/dbx-web/mapbox';
|
|
12
|
-
import * as
|
|
13
|
-
import * as i4 from '@angular/common';
|
|
12
|
+
import * as i3 from '@angular/common';
|
|
14
13
|
import { CommonModule } from '@angular/common';
|
|
14
|
+
import * as i3$1 from '@ng-web-apis/geolocation';
|
|
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';
|
|
@@ -28,7 +28,7 @@ import { FormlyModule } from '@ngx-formly/core';
|
|
|
28
28
|
|
|
29
29
|
function mapboxLatLngField(config = {}) {
|
|
30
30
|
var _a;
|
|
31
|
-
const { key = 'latLng', latLngConfig, showMap, zoom, recenterTime, selectLocationOnMapClick } = config;
|
|
31
|
+
const { key = 'latLng', latLngConfig, showMap, zoom, recenterTime, showCenterButton, setCenterOnLocationSet, selectLocationOnMapDrag, selectLocationOnMapClick } = config;
|
|
32
32
|
const fieldConfig = Object.assign(Object.assign({}, formlyField(Object.assign({ key, type: 'mapbox-latlng-picker' }, propsAndConfigForFieldConfig(config, {
|
|
33
33
|
label: (_a = config.label) !== null && _a !== void 0 ? _a : 'Location',
|
|
34
34
|
placeholder: DEFAULT_LAT_LNG_TEXT_FIELD_PLACEHOLDER,
|
|
@@ -38,7 +38,10 @@ function mapboxLatLngField(config = {}) {
|
|
|
38
38
|
zoom,
|
|
39
39
|
latLngConfig,
|
|
40
40
|
recenterTime,
|
|
41
|
-
|
|
41
|
+
selectLocationOnMapDrag,
|
|
42
|
+
selectLocationOnMapClick,
|
|
43
|
+
showCenterButton,
|
|
44
|
+
setCenterOnLocationSet
|
|
42
45
|
})))), validatorsForFieldConfig({
|
|
43
46
|
messages: {
|
|
44
47
|
pattern: DEFAULT_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE
|
|
@@ -49,14 +52,55 @@ function mapboxLatLngField(config = {}) {
|
|
|
49
52
|
});
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
class DbxFormMapboxLatLngFieldMarkerComponent {
|
|
56
|
+
constructor(fieldComponent) {
|
|
57
|
+
this.fieldComponent = fieldComponent;
|
|
58
|
+
this.marker$ = combineLatest([this.fieldComponent.latLng$, this.fieldComponent.markerConfig$]).pipe(map(([latLng, markerConfig]) => {
|
|
59
|
+
if (markerConfig !== false) {
|
|
60
|
+
return Object.assign({ latLng }, markerConfig);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
}), shareReplay(1));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
DbxFormMapboxLatLngFieldMarkerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, deps: [{ token: DbxFormMapboxLatLngFieldComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
+
DbxFormMapboxLatLngFieldMarkerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormMapboxLatLngFieldMarkerComponent, selector: "ng-component", ngImport: i0, template: `
|
|
70
|
+
<dbx-mapbox-marker [marker]="marker$ | async"></dbx-mapbox-marker>
|
|
71
|
+
`, 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 });
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, decorators: [{
|
|
73
|
+
type: Component,
|
|
74
|
+
args: [{
|
|
75
|
+
template: `
|
|
76
|
+
<dbx-mapbox-marker [marker]="marker$ | async"></dbx-mapbox-marker>
|
|
77
|
+
`,
|
|
78
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
79
|
+
}]
|
|
80
|
+
}], ctorParameters: function () { return [{ type: DbxFormMapboxLatLngFieldComponent }]; } });
|
|
81
|
+
|
|
82
|
+
const DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY = 'DbxFormMapboxLatLngFieldComponent';
|
|
83
|
+
const DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_MARKER_CONFIG = {
|
|
84
|
+
icon: 'pin_drop'
|
|
85
|
+
};
|
|
86
|
+
/*
|
|
87
|
+
TODO: Re-add menu for picking a new location, including using the current location.
|
|
88
|
+
<button mat-icon-button (click)="useCurrentLocation()" [disabled]="isReadonlyOrDisabled || (useCurrentLocationDisabled$ | async)">
|
|
89
|
+
<mat-icon>my_location</mat-icon>
|
|
90
|
+
</button>
|
|
91
|
+
*/
|
|
52
92
|
class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
53
|
-
constructor(
|
|
93
|
+
constructor(
|
|
94
|
+
//
|
|
95
|
+
compact, dbxMapboxInjectionStore, geolocation$, dbxMapboxMapStore, ngZone, injector) {
|
|
54
96
|
var _a;
|
|
55
97
|
super();
|
|
56
98
|
this.compact = compact;
|
|
99
|
+
this.dbxMapboxInjectionStore = dbxMapboxInjectionStore;
|
|
57
100
|
this.geolocation$ = geolocation$;
|
|
58
101
|
this.dbxMapboxMapStore = dbxMapboxMapStore;
|
|
59
102
|
this.ngZone = ngZone;
|
|
103
|
+
this.injector = injector;
|
|
60
104
|
this.compactClass$ = mapCompactModeObs((_a = this.compact) === null || _a === void 0 ? void 0 : _a.mode$, {
|
|
61
105
|
compact: 'dbx-mapbox-input-field-compact'
|
|
62
106
|
});
|
|
@@ -65,13 +109,15 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
65
109
|
this._sub = new SubscriptionObject();
|
|
66
110
|
this._geoSub = new SubscriptionObject();
|
|
67
111
|
this._centerSub = new SubscriptionObject();
|
|
112
|
+
this._flyToCenterSub = new SubscriptionObject();
|
|
68
113
|
this._clickSub = new SubscriptionObject();
|
|
69
114
|
this._zoom = new BehaviorSubject(12);
|
|
115
|
+
this._markerConfig = new BehaviorSubject(of(DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_MARKER_CONFIG));
|
|
70
116
|
this._formControlObs = new BehaviorSubject(undefined);
|
|
71
117
|
this.formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
72
118
|
this.value$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))), shareReplay(1));
|
|
73
|
-
this.latLng$ = this.value$.pipe(filterMaybe(), map((x) => this._latLngPointFunction(x)), shareReplay(1));
|
|
74
|
-
this.
|
|
119
|
+
this.latLng$ = this.value$.pipe(filterMaybe(), map((x) => this._latLngPointFunction(x)), distinctUntilChanged(isSameLatLngPoint), shareReplay(1));
|
|
120
|
+
this.nonZeroLatLng$ = this.latLng$.pipe(
|
|
75
121
|
/**
|
|
76
122
|
* Center observable passed to the store. Do not pass invalid points.
|
|
77
123
|
*
|
|
@@ -79,6 +125,7 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
79
125
|
*/
|
|
80
126
|
skipWhile(isDefaultLatLngPoint), filter(isValidLatLngPoint));
|
|
81
127
|
this.zoom$ = this._zoom.asObservable();
|
|
128
|
+
this.markerConfig$ = this._markerConfig.asObservable().pipe(switchMap((x) => x), shareReplay(1));
|
|
82
129
|
}
|
|
83
130
|
get zoom() {
|
|
84
131
|
return Math.min(this.field.props.zoom || 12, 18);
|
|
@@ -103,16 +150,33 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
103
150
|
var _a;
|
|
104
151
|
return (_a = this.field.props.showMap) !== null && _a !== void 0 ? _a : true;
|
|
105
152
|
}
|
|
153
|
+
get selectLocationOnMapDrag() {
|
|
154
|
+
var _a;
|
|
155
|
+
return (_a = this.field.props.selectLocationOnMapDrag) !== null && _a !== void 0 ? _a : true;
|
|
156
|
+
}
|
|
106
157
|
get selectLocationOnMapClick() {
|
|
107
158
|
var _a;
|
|
108
159
|
return (_a = this.field.props.selectLocationOnMapClick) !== null && _a !== void 0 ? _a : false;
|
|
109
160
|
}
|
|
161
|
+
get setCenterOnLocationSet() {
|
|
162
|
+
var _a;
|
|
163
|
+
return (_a = this.field.props.setCenterOnLocationSet) !== null && _a !== void 0 ? _a : true;
|
|
164
|
+
}
|
|
165
|
+
get showCenterButton() {
|
|
166
|
+
return !this.selectLocationOnMapDrag && this.props.showCenterButton !== false;
|
|
167
|
+
}
|
|
110
168
|
get recenterTime() {
|
|
111
169
|
return this.field.props.recenterTime || 10 * 1000;
|
|
112
170
|
}
|
|
113
171
|
get useCurrentLocationDisabled() {
|
|
114
172
|
return this._useCurrentLocationDisabled;
|
|
115
173
|
}
|
|
174
|
+
get mapInjectionKey() {
|
|
175
|
+
return this.field.props.mapInjectionKey;
|
|
176
|
+
}
|
|
177
|
+
get markerConfig() {
|
|
178
|
+
return this.field.props.markerConfig;
|
|
179
|
+
}
|
|
116
180
|
ngOnInit() {
|
|
117
181
|
var _a, _b, _c, _d;
|
|
118
182
|
const latLngPointConfig = Object.assign(Object.assign({}, this.field.props.latLngConfig), { wrap: ((_a = this.field.props.latLngConfig) === null || _a === void 0 ? void 0 : _a.wrap) || false, validate: ((_b = this.field.props.latLngConfig) === null || _b === void 0 ? void 0 : _b.validate) || false, precisionRounding: (_d = (_c = this.field.props.latLngConfig) === null || _c === void 0 ? void 0 : _c.precisionRounding) !== null && _d !== void 0 ? _d : 'round' });
|
|
@@ -120,28 +184,33 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
120
184
|
this._latLngPointFunction = latLngPointFunction(latLngPointConfig);
|
|
121
185
|
this._formControlObs.next(this.formControl);
|
|
122
186
|
this._zoom.next(this.zoom);
|
|
123
|
-
|
|
187
|
+
if (this.setCenterOnLocationSet) {
|
|
188
|
+
this._centerSub.subscription = this.dbxMapboxMapStore.setCenter(this.nonZeroLatLng$);
|
|
189
|
+
}
|
|
124
190
|
if (this.showMap) {
|
|
125
191
|
// Set zoom only if showMap is true
|
|
126
192
|
this.dbxMapboxMapStore.setZoom(this.zoom$);
|
|
127
193
|
// recenter periodically
|
|
128
194
|
if (this.recenterTime > 0) {
|
|
129
|
-
this.
|
|
130
|
-
this.
|
|
195
|
+
this._flyToCenterSub.subscription = this.dbxMapboxMapStore.center$.pipe(skip(1), throttleTime(this.recenterTime, undefined, { leading: false, trailing: true })).subscribe(() => {
|
|
196
|
+
this.flyToMarker();
|
|
131
197
|
});
|
|
132
198
|
}
|
|
133
199
|
}
|
|
134
200
|
else {
|
|
135
201
|
// use the center of the map to set locations
|
|
136
|
-
|
|
137
|
-
this.dbxMapboxMapStore.
|
|
138
|
-
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
141
|
-
|
|
142
|
-
|
|
202
|
+
if (this.selectLocationOnMapDrag) {
|
|
203
|
+
this._sub.subscription = this.dbxMapboxMapStore.center$.subscribe((center) => {
|
|
204
|
+
this.dbxMapboxMapStore.centerGivenMargin$.pipe(first()).subscribe(() => {
|
|
205
|
+
if (!this.isReadonlyOrDisabled) {
|
|
206
|
+
this.ngZone.run(() => {
|
|
207
|
+
this.setValue(center);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
});
|
|
143
211
|
});
|
|
144
|
-
}
|
|
212
|
+
}
|
|
213
|
+
// enable selecting the location on a map click
|
|
145
214
|
if (this.selectLocationOnMapClick) {
|
|
146
215
|
this._clickSub.subscription = this.dbxMapboxMapStore.clickEvent$.subscribe((x) => {
|
|
147
216
|
if ((x === null || x === void 0 ? void 0 : x.type) === 'click') {
|
|
@@ -153,16 +222,34 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
153
222
|
if (this.props.readonly) {
|
|
154
223
|
this.formControl.disable();
|
|
155
224
|
}
|
|
225
|
+
// Add the marker to the injection store for display
|
|
226
|
+
if (this.dbxMapboxInjectionStore) {
|
|
227
|
+
if (this.markerConfig) {
|
|
228
|
+
this._markerConfig.next(asObservableFromGetter(this.markerConfig, this));
|
|
229
|
+
}
|
|
230
|
+
this.dbxMapboxInjectionStore.addInjectionConfig({
|
|
231
|
+
key: this.mapInjectionKey || DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY,
|
|
232
|
+
injectionConfig: {
|
|
233
|
+
componentClass: DbxFormMapboxLatLngFieldMarkerComponent,
|
|
234
|
+
providers: [{ provide: DbxFormMapboxLatLngFieldComponent, useValue: this }]
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
156
238
|
}
|
|
157
239
|
ngOnDestroy() {
|
|
158
240
|
super.ngOnDestroy();
|
|
159
|
-
this._sub.destroy();
|
|
160
|
-
this._geoSub.destroy();
|
|
161
241
|
this._zoom.complete();
|
|
242
|
+
this._markerConfig.complete();
|
|
162
243
|
this._formControlObs.complete();
|
|
244
|
+
this._sub.destroy();
|
|
245
|
+
this._geoSub.destroy();
|
|
163
246
|
this._centerSub.destroy();
|
|
247
|
+
this._flyToCenterSub.destroy();
|
|
164
248
|
this._clickSub.destroy();
|
|
165
249
|
}
|
|
250
|
+
flyToMarker() {
|
|
251
|
+
this.dbxMapboxMapStore.easeTo(this.nonZeroLatLng$.pipe(first(), map((x) => ({ center: x }))));
|
|
252
|
+
}
|
|
166
253
|
useCurrentLocation() {
|
|
167
254
|
this._geoSub.subscription = this.geolocation$.pipe(first()).subscribe({
|
|
168
255
|
next: (position) => {
|
|
@@ -185,7 +272,7 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
|
185
272
|
this.formControl.markAsDirty();
|
|
186
273
|
}
|
|
187
274
|
}
|
|
188
|
-
DbxFormMapboxLatLngFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, deps: [{ token: i1.CompactContextStore, optional: true }, { token: i2.
|
|
275
|
+
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 });
|
|
189
276
|
DbxFormMapboxLatLngFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormMapboxLatLngFieldComponent, selector: "ng-component", providers: [provideMapboxStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
|
|
190
277
|
<div class="dbx-mapbox-input-field" [ngClass]="(compactClass$ | async) ?? ''" [formGroup]="formGroup">
|
|
191
278
|
<div *ngIf="showMap" class="dbx-mapbox-input-field-map">
|
|
@@ -194,7 +281,7 @@ DbxFormMapboxLatLngFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion
|
|
|
194
281
|
</mgl-map>
|
|
195
282
|
</div>
|
|
196
283
|
<div class="dbx-mapbox-input-field-input">
|
|
197
|
-
<button mat-icon-button (click)="
|
|
284
|
+
<button *ngIf="showCenterButton" mat-icon-button (click)="flyToMarker()">
|
|
198
285
|
<mat-icon>my_location</mat-icon>
|
|
199
286
|
</button>
|
|
200
287
|
<mat-form-field class="dbx-mapbox-input-field-input-field" appearance="standard">
|
|
@@ -204,7 +291,7 @@ DbxFormMapboxLatLngFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion
|
|
|
204
291
|
</mat-form-field>
|
|
205
292
|
</div>
|
|
206
293
|
</div>
|
|
207
|
-
`, 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:
|
|
294
|
+
`, 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" }] });
|
|
208
295
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, decorators: [{
|
|
209
296
|
type: Component,
|
|
210
297
|
args: [{ template: `
|
|
@@ -215,7 +302,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
215
302
|
</mgl-map>
|
|
216
303
|
</div>
|
|
217
304
|
<div class="dbx-mapbox-input-field-input">
|
|
218
|
-
<button mat-icon-button (click)="
|
|
305
|
+
<button *ngIf="showCenterButton" mat-icon-button (click)="flyToMarker()">
|
|
219
306
|
<mat-icon>my_location</mat-icon>
|
|
220
307
|
</button>
|
|
221
308
|
<mat-form-field class="dbx-mapbox-input-field-input-field" appearance="standard">
|
|
@@ -229,20 +316,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
229
316
|
}], ctorParameters: function () {
|
|
230
317
|
return [{ type: i1.CompactContextStore, decorators: [{
|
|
231
318
|
type: Optional
|
|
232
|
-
}] }, { type: i2.
|
|
319
|
+
}] }, { type: i2.DbxMapboxInjectionStore, decorators: [{
|
|
320
|
+
type: Optional
|
|
321
|
+
}] }, { type: i3$1.GeolocationService }, { type: i2.DbxMapboxMapStore }, { type: i0.NgZone }, { type: i0.Injector }];
|
|
233
322
|
} });
|
|
234
323
|
|
|
235
324
|
class DbxFormMapboxLatLngModule {
|
|
236
325
|
}
|
|
237
326
|
DbxFormMapboxLatLngModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
238
|
-
DbxFormMapboxLatLngModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngModule, declarations: [DbxFormMapboxLatLngFieldComponent], imports: [CommonModule,
|
|
327
|
+
DbxFormMapboxLatLngModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngModule, declarations: [DbxFormMapboxLatLngFieldComponent, DbxFormMapboxLatLngFieldMarkerComponent], imports: [CommonModule,
|
|
239
328
|
MatIconModule,
|
|
240
329
|
MatButtonModule,
|
|
241
330
|
DbxTextModule,
|
|
242
331
|
DbxMapboxModule,
|
|
243
332
|
FormsModule,
|
|
244
333
|
ReactiveFormsModule,
|
|
245
|
-
MatInputModule, i1$1.FormlyModule, NgxMapboxGLModule] });
|
|
334
|
+
MatInputModule, i1$1.FormlyModule, NgxMapboxGLModule], exports: [DbxFormMapboxLatLngFieldMarkerComponent] });
|
|
246
335
|
DbxFormMapboxLatLngModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxLatLngModule, imports: [CommonModule,
|
|
247
336
|
MatIconModule,
|
|
248
337
|
MatButtonModule,
|
|
@@ -272,7 +361,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
272
361
|
}),
|
|
273
362
|
NgxMapboxGLModule
|
|
274
363
|
],
|
|
275
|
-
declarations: [DbxFormMapboxLatLngFieldComponent]
|
|
364
|
+
declarations: [DbxFormMapboxLatLngFieldComponent, DbxFormMapboxLatLngFieldMarkerComponent],
|
|
365
|
+
exports: [DbxFormMapboxLatLngFieldMarkerComponent]
|
|
276
366
|
}]
|
|
277
367
|
}] });
|
|
278
368
|
|
|
@@ -395,7 +485,7 @@ class DbxFormMapboxZoomFieldComponent extends FieldType {
|
|
|
395
485
|
this.formControl.markAsDirty();
|
|
396
486
|
}
|
|
397
487
|
}
|
|
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
|
|
488
|
+
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
489
|
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
490
|
<div class="dbx-mapbox-input-field" [ngClass]="(compactClass$ | async) ?? ''" [formGroup]="formGroup">
|
|
401
491
|
<div *ngIf="showMap" class="dbx-mapbox-input-field-map">
|
|
@@ -408,7 +498,7 @@ DbxFormMapboxZoomFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion:
|
|
|
408
498
|
</mat-form-field>
|
|
409
499
|
</div>
|
|
410
500
|
</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:
|
|
501
|
+
`, 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
502
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, decorators: [{
|
|
413
503
|
type: Component,
|
|
414
504
|
args: [{ template: `
|
|
@@ -427,7 +517,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
427
517
|
}], ctorParameters: function () {
|
|
428
518
|
return [{ type: i1.CompactContextStore, decorators: [{
|
|
429
519
|
type: Optional
|
|
430
|
-
}] }, { type: i2
|
|
520
|
+
}] }, { type: i2.DbxMapboxService }, { type: i2.DbxMapboxMapStore }, { type: i0.NgZone }];
|
|
431
521
|
} });
|
|
432
522
|
|
|
433
523
|
class DbxFormMapboxZoomModule {
|
|
@@ -490,5 +580,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
490
580
|
* Generated bundle index. Do not edit.
|
|
491
581
|
*/
|
|
492
582
|
|
|
493
|
-
export { DbxFormMapboxLatLngFieldComponent, DbxFormMapboxLatLngModule, DbxFormMapboxModule, DbxFormMapboxZoomFieldComponent, DbxFormMapboxZoomModule, mapboxLatLngField, mapboxZoomField };
|
|
583
|
+
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 };
|
|
494
584
|
//# sourceMappingURL=dereekb-dbx-form-mapbox.mjs.map
|