@dereekb/dbx-form 13.17.0 → 13.18.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.
- package/fesm2022/dereekb-dbx-form-calendar.mjs +53 -316
- package/fesm2022/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2022/{dereekb-dbx-form-expand.field.component-xIW9lckC.mjs → dereekb-dbx-form-expand.field.component-uqVNtX2s.mjs} +3 -3
- package/fesm2022/{dereekb-dbx-form-expand.field.component-xIW9lckC.mjs.map → dereekb-dbx-form-expand.field.component-uqVNtX2s.mjs.map} +1 -1
- package/fesm2022/dereekb-dbx-form-mapbox.mjs +10 -538
- package/fesm2022/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-form-style-demo.mjs +417 -0
- package/fesm2022/dereekb-dbx-form-style-demo.mjs.map +1 -0
- package/fesm2022/dereekb-dbx-form.mjs +1953 -9085
- package/fesm2022/dereekb-dbx-form.mjs.map +1 -1
- package/lib/extension/calendar/_calendar.scss +3 -3
- package/lib/forge/field/_field.scss +15 -0
- package/lib/forge/field/selection/pickable/_pickable.scss +11 -6
- package/lib/forge/field/selection/searchable/_searchable.scss +71 -3
- package/lib/forge/field/selection/sourceselect/_sourceselect.scss +1 -1
- package/lib/{formly → forge}/field/texteditor/_texteditor.scss +7 -3
- package/lib/{formly → forge}/field/value/array/_array.scss +4 -4
- package/lib/{formly → forge}/field/value/date/_date.scss +5 -9
- package/lib/{formly → forge}/field/value/duration/_duration.scss +7 -7
- package/lib/{formly → forge}/field/value/phone/_phone.scss +1 -1
- package/lib/forge/preset/_preset.scss +4 -4
- package/lib/forge/style/_shared.scss +9 -0
- package/lib/form/_form.scss +3 -0
- package/lib/style/_all-core.scss +0 -4
- package/lib/style/_all-theme.scss +0 -4
- package/lib/style/_all-typography.scss +0 -2
- package/package.json +12 -10
- package/style-demo/README.md +7 -0
- package/types/dereekb-dbx-form-calendar.d.ts +81 -232
- package/types/dereekb-dbx-form-mapbox.d.ts +9 -250
- package/types/dereekb-dbx-form-style-demo.d.ts +195 -0
- package/types/dereekb-dbx-form.d.ts +4191 -8496
- package/lib/formly/_formly.scss +0 -17
- package/lib/formly/field/_field.scss +0 -27
- package/lib/formly/field/checklist/_checklist.scss +0 -49
- package/lib/formly/field/component/_component.scss +0 -10
- package/lib/formly/field/selection/_selection.scss +0 -21
- package/lib/formly/field/selection/list/_list.scss +0 -15
- package/lib/formly/field/selection/pickable/_pickable.scss +0 -18
- package/lib/formly/field/selection/searchable/_searchable.scss +0 -88
- package/lib/formly/field/selection/sourceselect/_sourceselect.scss +0 -42
- package/lib/formly/field/value/_value.scss +0 -30
- package/lib/formly/field/value/boolean/_boolean.scss +0 -52
- package/lib/formly/field/value/number/_number.scss +0 -17
- package/lib/formly/field/value/text/_text.scss +0 -10
- package/lib/formly/field/wrapper/_wrapper.scss +0 -31
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import * as i3 from '@angular/forms';
|
|
4
|
-
import { ReactiveFormsModule, FormControl, FormsModule } from '@angular/forms';
|
|
1
|
+
import { filterFromPOJO, LAT_LNG_PATTERN, latLngPointFunction, latLngStringFunction, defaultLatLngPoint, isSameLatLngPoint, isDefaultLatLngPoint, isValidLatLngPoint, latLngPoint } from '@dereekb/util';
|
|
2
|
+
import { DEFAULT_FORGE_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE, DEFAULT_FORGE_LAT_LNG_TEXT_FIELD_PLACEHOLDER } from '@dereekb/dbx-form';
|
|
5
3
|
import { CompactContextStore, mapCompactModeObs } from '@dereekb/dbx-web';
|
|
6
4
|
import * as i0 from '@angular/core';
|
|
7
|
-
import { inject, ChangeDetectionStrategy, Component,
|
|
8
|
-
import {
|
|
9
|
-
import { combineLatest, map, shareReplay, BehaviorSubject, of, switchMap, startWith, distinctUntilChanged, skipWhile, filter, skip, throttleTime, first } from 'rxjs';
|
|
5
|
+
import { inject, ChangeDetectionStrategy, Component, ElementRef, input, computed, effect } from '@angular/core';
|
|
6
|
+
import { combineLatest, map, shareReplay, BehaviorSubject, of, distinctUntilChanged, skipWhile, filter, switchMap, skip, throttleTime, first } from 'rxjs';
|
|
10
7
|
import { filterMaybe, asObservableFromGetter } from '@dereekb/rxjs';
|
|
11
8
|
import { WaGeolocationService } from '@ng-web-apis/geolocation';
|
|
12
9
|
import * as i3$1 from '@dereekb/dbx-web/mapbox';
|
|
@@ -23,337 +20,12 @@ import * as i6 from '@angular/material/input';
|
|
|
23
20
|
import { MatInputModule } from '@angular/material/input';
|
|
24
21
|
import * as i2$1 from 'ngx-mapbox-gl';
|
|
25
22
|
import { MapComponent, MarkerComponent } from 'ngx-mapbox-gl';
|
|
26
|
-
import { cleanSubscription, completeOnDestroy } from '@dereekb/dbx-core';
|
|
27
|
-
import * as i1 from '@ngx-formly/core';
|
|
28
|
-
import { FormlyModule } from '@ngx-formly/core';
|
|
29
23
|
import { setupMetaTracking, resolveValueFieldContext, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES, buildValueFieldInputs } from '@ng-forge/dynamic-forms/integration';
|
|
24
|
+
import * as i3 from '@angular/forms';
|
|
25
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
26
|
+
import { cleanSubscription, completeOnDestroy } from '@dereekb/dbx-core';
|
|
30
27
|
import { provideDynamicForm } from '@ng-forge/dynamic-forms';
|
|
31
28
|
|
|
32
|
-
/* eslint-disable @typescript-eslint/no-deprecated -- legacy formly mapbox factory; references deprecated config interfaces and is itself deprecated in favor of dbxForgeMapboxLatLngField() */
|
|
33
|
-
/**
|
|
34
|
-
* Creates a Formly field configuration for a Mapbox-powered latitude/longitude picker with optional map display.
|
|
35
|
-
*
|
|
36
|
-
* @param config - Optional field configuration overrides.
|
|
37
|
-
* @returns A validated Formly field configuration for the Mapbox lat/lng picker.
|
|
38
|
-
*
|
|
39
|
-
* @deprecated Use dbxForgeMapboxLatLngField() from the forge API instead.
|
|
40
|
-
*/
|
|
41
|
-
function mapboxLatLngField(config = {}) {
|
|
42
|
-
const { key = 'latLng', latLngConfig, showMap, zoom, recenterTime, showCenterButton, setCenterOnLocationSet, selectLocationOnMapDrag, selectLocationOnMapClick, markerConfig } = config;
|
|
43
|
-
const classGetter = 'dbx-mat-form-field-disable-underline';
|
|
44
|
-
const fieldConfig = {
|
|
45
|
-
...formlyField({
|
|
46
|
-
key,
|
|
47
|
-
type: 'mapbox-latlng-picker',
|
|
48
|
-
...propsAndConfigForFieldConfig(config, {
|
|
49
|
-
classGetter,
|
|
50
|
-
label: config.label ?? 'Location',
|
|
51
|
-
placeholder: DEFAULT_LAT_LNG_TEXT_FIELD_PLACEHOLDER,
|
|
52
|
-
pattern: LAT_LNG_PATTERN,
|
|
53
|
-
autocomplete: false,
|
|
54
|
-
showMap,
|
|
55
|
-
zoom,
|
|
56
|
-
latLngConfig,
|
|
57
|
-
recenterTime,
|
|
58
|
-
selectLocationOnMapDrag,
|
|
59
|
-
selectLocationOnMapClick,
|
|
60
|
-
showCenterButton,
|
|
61
|
-
setCenterOnLocationSet,
|
|
62
|
-
markerConfig
|
|
63
|
-
})
|
|
64
|
-
}),
|
|
65
|
-
...validatorsForFieldConfig({
|
|
66
|
-
messages: {
|
|
67
|
-
pattern: DEFAULT_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE
|
|
68
|
-
}
|
|
69
|
-
})
|
|
70
|
-
};
|
|
71
|
-
return fieldConfig;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* eslint-disable @typescript-eslint/no-deprecated -- marker component injects the deprecated DbxFormMapboxLatLngFieldComponent; both belong to the legacy mapbox formly layer being replaced by forge */
|
|
75
|
-
class DbxFormMapboxLatLngFieldMarkerComponent {
|
|
76
|
-
fieldComponent = inject(DbxFormMapboxLatLngFieldComponent);
|
|
77
|
-
marker$ = combineLatest([this.fieldComponent.latLng$, this.fieldComponent.markerConfig$]).pipe(map(([latLng, markerConfig]) => {
|
|
78
|
-
return markerConfig === false ? undefined : { latLng, ...markerConfig };
|
|
79
|
-
}), shareReplay(1));
|
|
80
|
-
markerSignal = toSignal(this.marker$);
|
|
81
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
82
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: DbxFormMapboxLatLngFieldMarkerComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `
|
|
83
|
-
<dbx-mapbox-marker [marker]="markerSignal()"></dbx-mapbox-marker>
|
|
84
|
-
`, isInline: true, dependencies: [{ kind: "component", type: DbxMapboxMarkerComponent, selector: "dbx-mapbox-marker", inputs: ["marker"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
85
|
-
}
|
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, decorators: [{
|
|
87
|
-
type: Component,
|
|
88
|
-
args: [{
|
|
89
|
-
template: `
|
|
90
|
-
<dbx-mapbox-marker [marker]="markerSignal()"></dbx-mapbox-marker>
|
|
91
|
-
`,
|
|
92
|
-
imports: [DbxMapboxMarkerComponent],
|
|
93
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
94
|
-
standalone: true
|
|
95
|
-
}]
|
|
96
|
-
}] });
|
|
97
|
-
|
|
98
|
-
/* eslint-disable @typescript-eslint/no-deprecated -- legacy DbxFormMapboxLatLngFieldComponent retained for backward compatibility; replacement is DbxForgeMapboxLatLngFieldComponent and intra-file references are part of the deprecated layer */
|
|
99
|
-
const DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY = 'DbxFormMapboxLatLngFieldComponent';
|
|
100
|
-
const DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_MARKER_CONFIG = {
|
|
101
|
-
icon: 'pin_drop'
|
|
102
|
-
};
|
|
103
|
-
/*
|
|
104
|
-
TODO: Re-add menu for picking a new location, including using the current location.
|
|
105
|
-
<button mat-icon-button (click)="useCurrentLocation()" [disabled]="isReadonlyOrDisabled || (useCurrentLocationDisabled$ | async)">
|
|
106
|
-
<mat-icon>my_location</mat-icon>
|
|
107
|
-
</button>
|
|
108
|
-
*/
|
|
109
|
-
/**
|
|
110
|
-
* @deprecated Use DbxForgeMapboxLatLngFieldComponent instead.
|
|
111
|
-
*/
|
|
112
|
-
class DbxFormMapboxLatLngFieldComponent extends FieldType {
|
|
113
|
-
_geolocationService = inject(WaGeolocationService);
|
|
114
|
-
compact = inject(CompactContextStore, { optional: true });
|
|
115
|
-
dbxMapboxInjectionStore = inject(DbxMapboxInjectionStore, { optional: true });
|
|
116
|
-
dbxMapboxMapStore = inject(DbxMapboxMapStore);
|
|
117
|
-
injector = inject(Injector);
|
|
118
|
-
_sub = cleanSubscription();
|
|
119
|
-
_geoSub = cleanSubscription();
|
|
120
|
-
_centerSub = cleanSubscription();
|
|
121
|
-
_flyToCenterSub = cleanSubscription();
|
|
122
|
-
_clickSub = cleanSubscription();
|
|
123
|
-
_zoom = completeOnDestroy(new BehaviorSubject(12));
|
|
124
|
-
_markerConfig = completeOnDestroy(new BehaviorSubject(of(DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_MARKER_CONFIG)));
|
|
125
|
-
_latLngStringFunction;
|
|
126
|
-
_latLngPointFunction;
|
|
127
|
-
compactClass$ = mapCompactModeObs(this.compact?.mode$, {
|
|
128
|
-
compact: 'dbx-mapbox-input-field-compact'
|
|
129
|
-
}).pipe(filterMaybe());
|
|
130
|
-
_useCurrentLocationDisabled = completeOnDestroy(new BehaviorSubject(false));
|
|
131
|
-
useCurrentLocationDisabled$ = this._useCurrentLocationDisabled.asObservable();
|
|
132
|
-
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
133
|
-
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
134
|
-
value$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))), shareReplay(1));
|
|
135
|
-
latLng$ = this.value$.pipe(filterMaybe(), map((x) => this._latLngPointFunction(x)), distinctUntilChanged(isSameLatLngPoint), shareReplay(1));
|
|
136
|
-
nonZeroLatLng$ = this.latLng$.pipe(
|
|
137
|
-
/**
|
|
138
|
-
* Center observable passed to the store. Do not pass invalid points.
|
|
139
|
-
*
|
|
140
|
-
* Also skip any initial 0,0 values so the center doesn't potentially "whip" from 0,0 to a final loaded value.
|
|
141
|
-
*/
|
|
142
|
-
skipWhile(isDefaultLatLngPoint), filter(isValidLatLngPoint));
|
|
143
|
-
zoom$ = this._zoom.asObservable();
|
|
144
|
-
markerConfig$ = this._markerConfig.asObservable().pipe(switchMap((x) => x), shareReplay(1));
|
|
145
|
-
useCurrentLocationDisabledSignal = toSignal(this._useCurrentLocationDisabled, { initialValue: false });
|
|
146
|
-
compactClassSignal = toSignal(this.compactClass$, { initialValue: '' });
|
|
147
|
-
latLngSignal = toSignal(this.latLng$, { initialValue: defaultLatLngPoint() });
|
|
148
|
-
get zoom() {
|
|
149
|
-
return Math.min(this.field.props.zoom || 12, 18);
|
|
150
|
-
}
|
|
151
|
-
get formGroupName() {
|
|
152
|
-
return this.field.key;
|
|
153
|
-
}
|
|
154
|
-
get formGroup() {
|
|
155
|
-
return this.form;
|
|
156
|
-
}
|
|
157
|
-
get label() {
|
|
158
|
-
return this.field.props?.label;
|
|
159
|
-
}
|
|
160
|
-
get description() {
|
|
161
|
-
return this.props.description;
|
|
162
|
-
}
|
|
163
|
-
get isReadonlyOrDisabled() {
|
|
164
|
-
return this.props.readonly || this.disabled;
|
|
165
|
-
}
|
|
166
|
-
get showMap() {
|
|
167
|
-
return this.field.props.showMap ?? true;
|
|
168
|
-
}
|
|
169
|
-
get selectLocationOnMapDrag() {
|
|
170
|
-
return this.field.props.selectLocationOnMapDrag ?? true;
|
|
171
|
-
}
|
|
172
|
-
get selectLocationOnMapClick() {
|
|
173
|
-
return this.field.props.selectLocationOnMapClick ?? false;
|
|
174
|
-
}
|
|
175
|
-
get setCenterOnLocationSet() {
|
|
176
|
-
return this.field.props.setCenterOnLocationSet ?? true;
|
|
177
|
-
}
|
|
178
|
-
get showCenterButton() {
|
|
179
|
-
return !this.selectLocationOnMapDrag && this.props.showCenterButton !== false;
|
|
180
|
-
}
|
|
181
|
-
get recenterTime() {
|
|
182
|
-
return this.field.props.recenterTime || 10 * 1000;
|
|
183
|
-
}
|
|
184
|
-
get useCurrentLocationDisabled() {
|
|
185
|
-
return this._useCurrentLocationDisabled;
|
|
186
|
-
}
|
|
187
|
-
get mapInjectionKey() {
|
|
188
|
-
return this.field.props.mapInjectionKey;
|
|
189
|
-
}
|
|
190
|
-
get markerConfig() {
|
|
191
|
-
return this.field.props.markerConfig;
|
|
192
|
-
}
|
|
193
|
-
ngOnInit() {
|
|
194
|
-
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' };
|
|
195
|
-
this._latLngStringFunction = latLngStringFunction(latLngPointConfig);
|
|
196
|
-
this._latLngPointFunction = latLngPointFunction(latLngPointConfig);
|
|
197
|
-
this._formControlObs.next(this.formControl);
|
|
198
|
-
this._zoom.next(this.zoom);
|
|
199
|
-
if (this.setCenterOnLocationSet) {
|
|
200
|
-
this._centerSub.subscription = this.dbxMapboxMapStore.setCenter(this.nonZeroLatLng$);
|
|
201
|
-
}
|
|
202
|
-
if (this.showMap) {
|
|
203
|
-
// Set zoom only if showMap is true
|
|
204
|
-
this.dbxMapboxMapStore.setZoom(this.zoom$);
|
|
205
|
-
// recenter periodically
|
|
206
|
-
if (this.recenterTime > 0) {
|
|
207
|
-
this._flyToCenterSub.subscription = this.dbxMapboxMapStore.center$.pipe(skip(1), throttleTime(this.recenterTime, undefined, { leading: false, trailing: true })).subscribe(() => {
|
|
208
|
-
this.flyToMarker();
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
// use the center of the map to set locations
|
|
214
|
-
if (this.selectLocationOnMapDrag) {
|
|
215
|
-
this._sub.subscription = this.dbxMapboxMapStore.center$.subscribe((center) => {
|
|
216
|
-
this.dbxMapboxMapStore.centerGivenMargin$.pipe(first()).subscribe(() => {
|
|
217
|
-
if (!this.isReadonlyOrDisabled) {
|
|
218
|
-
this.setValue(center);
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
// enable selecting the location on a map click
|
|
224
|
-
if (this.selectLocationOnMapClick) {
|
|
225
|
-
this._clickSub.subscription = this.dbxMapboxMapStore.clickEvent$.subscribe((x) => {
|
|
226
|
-
if (x?.type === 'click') {
|
|
227
|
-
this.setValue(x.lngLat);
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
if (this.props.readonly) {
|
|
233
|
-
this.formControl.disable();
|
|
234
|
-
}
|
|
235
|
-
// Add the marker to the injection store for display
|
|
236
|
-
if (this.dbxMapboxInjectionStore) {
|
|
237
|
-
if (this.markerConfig != null) {
|
|
238
|
-
this._markerConfig.next(this.markerConfig === false ? of(false) : asObservableFromGetter(this.markerConfig, this));
|
|
239
|
-
}
|
|
240
|
-
this.dbxMapboxInjectionStore.addInjectionConfig({
|
|
241
|
-
key: this.mapInjectionKey || DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY,
|
|
242
|
-
injectionConfig: {
|
|
243
|
-
componentClass: DbxFormMapboxLatLngFieldMarkerComponent,
|
|
244
|
-
providers: [{ provide: DbxFormMapboxLatLngFieldComponent, useValue: this }]
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
ngOnDestroy() {
|
|
250
|
-
super.ngOnDestroy();
|
|
251
|
-
}
|
|
252
|
-
flyToMarker() {
|
|
253
|
-
this.dbxMapboxMapStore.easeTo(this.nonZeroLatLng$.pipe(first(), map((x) => ({ center: x }))));
|
|
254
|
-
}
|
|
255
|
-
useCurrentLocation() {
|
|
256
|
-
this._geoSub.subscription = this._geolocationService.pipe(first()).subscribe({
|
|
257
|
-
next: (position) => {
|
|
258
|
-
if (position) {
|
|
259
|
-
const { latitude: lat, longitude: lng } = position.coords;
|
|
260
|
-
this.setValue({ lat, lng });
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
error: () => {
|
|
264
|
-
this._useCurrentLocationDisabled.next(true);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
onMarkerDragEnd(marker) {
|
|
269
|
-
this.setValue(marker.getLngLat());
|
|
270
|
-
}
|
|
271
|
-
setValue(latLng) {
|
|
272
|
-
this.formControl.setValue(latLng ? this._latLngStringFunction(latLng) : latLng);
|
|
273
|
-
this.formControl.markAsTouched();
|
|
274
|
-
this.formControl.markAsDirty();
|
|
275
|
-
}
|
|
276
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
277
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: DbxFormMapboxLatLngFieldComponent, isStandalone: true, selector: "ng-component", providers: [provideMapboxStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
|
|
278
|
-
<div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()" [formGroup]="formGroup">
|
|
279
|
-
@if (showMap) {
|
|
280
|
-
<div class="dbx-mapbox-input-field-map">
|
|
281
|
-
<mgl-map dbxMapboxMap>
|
|
282
|
-
<mgl-marker [lngLat]="latLngSignal()" [draggable]="!isReadonlyOrDisabled" (markerDragEnd)="onMarkerDragEnd($event)"></mgl-marker>
|
|
283
|
-
</mgl-map>
|
|
284
|
-
</div>
|
|
285
|
-
}
|
|
286
|
-
<div class="dbx-mapbox-input-field-input">
|
|
287
|
-
@if (showCenterButton) {
|
|
288
|
-
<button mat-icon-button (click)="flyToMarker()">
|
|
289
|
-
<mat-icon>my_location</mat-icon>
|
|
290
|
-
</button>
|
|
291
|
-
}
|
|
292
|
-
<mat-form-field class="dbx-mapbox-input-field-input-field">
|
|
293
|
-
<mat-label>Coordinates</mat-label>
|
|
294
|
-
<input type="text" matInput [placeholder]="placeholder" [formControl]="formControl" />
|
|
295
|
-
@if (useCurrentLocationDisabledSignal()) {
|
|
296
|
-
<mat-hint class="dbx-hint dbx-warn">Could not access your current location.</mat-hint>
|
|
297
|
-
}
|
|
298
|
-
</mat-form-field>
|
|
299
|
-
</div>
|
|
300
|
-
</div>
|
|
301
|
-
`, 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: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MapComponent, selector: "mgl-map", inputs: ["accessToken", "collectResourceTiming", "crossSourceCollisions", "fadeDuration", "hash", "refreshExpiredTiles", "failIfMajorPerformanceCaveat", "bearingSnap", "interactive", "pitchWithRotate", "clickTolerance", "attributionControl", "logoPosition", "maxTileCacheSize", "localIdeographFontFamily", "preserveDrawingBuffer", "trackResize", "transformRequest", "bounds", "antialias", "locale", "cooperativeGestures", "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", "mapCreate", "idle", "render", "mapError", "data", "styleData", "sourceData", "dataLoading", "styleDataLoading", "sourceDataLoading", "styleImageMissing"] }, { kind: "component", type: MarkerComponent, selector: "mgl-marker", inputs: ["offset", "anchor", "clickTolerance", "feature", "lngLat", "draggable", "popupShown", "className", "zIndex", "pitchAlignment", "rotationAlignment"], outputs: ["markerDragStart", "markerDragEnd", "markerDrag"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: DbxMapboxModule }, { kind: "directive", type: i3$1.DbxMapboxMapDirective, selector: "[dbxMapboxMap]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
302
|
-
}
|
|
303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, decorators: [{
|
|
304
|
-
type: Component,
|
|
305
|
-
args: [{ template: `
|
|
306
|
-
<div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()" [formGroup]="formGroup">
|
|
307
|
-
@if (showMap) {
|
|
308
|
-
<div class="dbx-mapbox-input-field-map">
|
|
309
|
-
<mgl-map dbxMapboxMap>
|
|
310
|
-
<mgl-marker [lngLat]="latLngSignal()" [draggable]="!isReadonlyOrDisabled" (markerDragEnd)="onMarkerDragEnd($event)"></mgl-marker>
|
|
311
|
-
</mgl-map>
|
|
312
|
-
</div>
|
|
313
|
-
}
|
|
314
|
-
<div class="dbx-mapbox-input-field-input">
|
|
315
|
-
@if (showCenterButton) {
|
|
316
|
-
<button mat-icon-button (click)="flyToMarker()">
|
|
317
|
-
<mat-icon>my_location</mat-icon>
|
|
318
|
-
</button>
|
|
319
|
-
}
|
|
320
|
-
<mat-form-field class="dbx-mapbox-input-field-input-field">
|
|
321
|
-
<mat-label>Coordinates</mat-label>
|
|
322
|
-
<input type="text" matInput [placeholder]="placeholder" [formControl]="formControl" />
|
|
323
|
-
@if (useCurrentLocationDisabledSignal()) {
|
|
324
|
-
<mat-hint class="dbx-hint dbx-warn">Could not access your current location.</mat-hint>
|
|
325
|
-
}
|
|
326
|
-
</mat-form-field>
|
|
327
|
-
</div>
|
|
328
|
-
</div>
|
|
329
|
-
`, providers: [provideMapboxStoreIfParentIsUnavailable()], imports: [NgClass, MapComponent, MarkerComponent, ReactiveFormsModule, MatIconModule, DbxMapboxModule, MatButtonModule, MatFormFieldModule, MatInputModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: 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"] }]
|
|
330
|
-
}] });
|
|
331
|
-
|
|
332
|
-
/* eslint-disable @typescript-eslint/no-deprecated -- legacy NgModule that wraps the deprecated DbxFormMapboxLatLngFieldComponent; replacement is provideDbxForgeMapboxFieldDeclarations() */
|
|
333
|
-
const importsAndExports$1 = [DbxFormMapboxLatLngFieldComponent];
|
|
334
|
-
/**
|
|
335
|
-
* @deprecated Use provideDbxForgeMapboxFieldDeclarations() instead.
|
|
336
|
-
*/
|
|
337
|
-
class DbxFormMapboxLatLngModule {
|
|
338
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxLatLngModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
339
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxLatLngModule, imports: [DbxFormMapboxLatLngFieldComponent, i1.FormlyModule], exports: [DbxFormMapboxLatLngFieldComponent] });
|
|
340
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxLatLngModule, imports: [importsAndExports$1, FormlyModule.forChild({
|
|
341
|
-
types: [{ name: 'mapbox-latlng-picker', component: DbxFormMapboxLatLngFieldComponent, wrappers: ['style', 'form-field'] }]
|
|
342
|
-
})] });
|
|
343
|
-
}
|
|
344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxLatLngModule, decorators: [{
|
|
345
|
-
type: NgModule,
|
|
346
|
-
args: [{
|
|
347
|
-
imports: [
|
|
348
|
-
...importsAndExports$1,
|
|
349
|
-
FormlyModule.forChild({
|
|
350
|
-
types: [{ name: 'mapbox-latlng-picker', component: DbxFormMapboxLatLngFieldComponent, wrappers: ['style', 'form-field'] }]
|
|
351
|
-
})
|
|
352
|
-
],
|
|
353
|
-
exports: importsAndExports$1
|
|
354
|
-
}]
|
|
355
|
-
}] });
|
|
356
|
-
|
|
357
29
|
/**
|
|
358
30
|
* The custom forge field type name for the mapbox lat/lng field.
|
|
359
31
|
*/
|
|
@@ -371,9 +43,9 @@ function dbxForgeMapboxLatLngField(config = {}) {
|
|
|
371
43
|
const props = filterFromPOJO({
|
|
372
44
|
label: label ?? 'Location',
|
|
373
45
|
description,
|
|
374
|
-
placeholder:
|
|
46
|
+
placeholder: DEFAULT_FORGE_LAT_LNG_TEXT_FIELD_PLACEHOLDER,
|
|
375
47
|
pattern: LAT_LNG_PATTERN,
|
|
376
|
-
patternMessage:
|
|
48
|
+
patternMessage: DEFAULT_FORGE_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE,
|
|
377
49
|
showMap,
|
|
378
50
|
zoom,
|
|
379
51
|
latLngConfig,
|
|
@@ -700,190 +372,6 @@ var latlng_forge_field_component = /*#__PURE__*/Object.freeze({
|
|
|
700
372
|
mapboxLatLngFieldMapper: mapboxLatLngFieldMapper
|
|
701
373
|
});
|
|
702
374
|
|
|
703
|
-
/* eslint-disable @typescript-eslint/no-deprecated -- legacy formly mapbox factory; references deprecated config interfaces and is itself deprecated in favor of dbxForgeMapboxZoomField() */
|
|
704
|
-
/**
|
|
705
|
-
* Creates a Formly field configuration for a Mapbox-powered zoom level picker with optional map preview.
|
|
706
|
-
*
|
|
707
|
-
* @param config - Optional field configuration overrides.
|
|
708
|
-
* @returns A validated Formly field configuration for the Mapbox zoom picker.
|
|
709
|
-
*
|
|
710
|
-
* @deprecated Use dbxForgeMapboxZoomField() from the forge API instead.
|
|
711
|
-
*/
|
|
712
|
-
function mapboxZoomField(config = {}) {
|
|
713
|
-
const { key = 'zoom', showMap, center, minZoom, maxZoom, zoomStep } = config;
|
|
714
|
-
const classGetter = 'dbx-mat-form-field-disable-underline';
|
|
715
|
-
const fieldConfig = {
|
|
716
|
-
...formlyField({
|
|
717
|
-
key,
|
|
718
|
-
type: 'mapbox-zoom-picker',
|
|
719
|
-
...propsAndConfigForFieldConfig(config, {
|
|
720
|
-
classGetter,
|
|
721
|
-
label: config.label ?? 'Zoom',
|
|
722
|
-
autocomplete: false,
|
|
723
|
-
showMap,
|
|
724
|
-
center,
|
|
725
|
-
minZoom,
|
|
726
|
-
maxZoom,
|
|
727
|
-
zoomStep
|
|
728
|
-
})
|
|
729
|
-
})
|
|
730
|
-
};
|
|
731
|
-
return fieldConfig;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
/**
|
|
735
|
-
* @deprecated Use DbxForgeMapboxZoomFieldComponent instead.
|
|
736
|
-
*/
|
|
737
|
-
class DbxFormMapboxZoomFieldComponent extends FieldType {
|
|
738
|
-
compact = inject(CompactContextStore, { optional: true });
|
|
739
|
-
dbxMapboxService = inject(DbxMapboxService);
|
|
740
|
-
dbxMapboxMapStore = inject(DbxMapboxMapStore);
|
|
741
|
-
_undoZoomLimit = false;
|
|
742
|
-
compactClass$ = mapCompactModeObs(this.compact?.mode$, {
|
|
743
|
-
compact: 'dbx-mapbox-input-field-compact'
|
|
744
|
-
}).pipe(filterMaybe());
|
|
745
|
-
compactClassSignal = toSignal(this.compactClass$, { initialValue: '' });
|
|
746
|
-
_sub = cleanSubscription();
|
|
747
|
-
_center = completeOnDestroy(new BehaviorSubject(undefined));
|
|
748
|
-
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
749
|
-
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
750
|
-
value$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))), shareReplay(1));
|
|
751
|
-
zoom$ = this.value$.pipe(filterMaybe(), shareReplay(1));
|
|
752
|
-
center$ = this._center.pipe(filterMaybe());
|
|
753
|
-
get center() {
|
|
754
|
-
return this.field.props.center || latLngPoint(this.dbxMapboxService.defaultCenter);
|
|
755
|
-
}
|
|
756
|
-
get formGroupName() {
|
|
757
|
-
return this.field.key;
|
|
758
|
-
}
|
|
759
|
-
get formGroup() {
|
|
760
|
-
return this.form;
|
|
761
|
-
}
|
|
762
|
-
get label() {
|
|
763
|
-
return this.field.props?.label;
|
|
764
|
-
}
|
|
765
|
-
get description() {
|
|
766
|
-
return this.props.description;
|
|
767
|
-
}
|
|
768
|
-
get isReadonlyOrDisabled() {
|
|
769
|
-
return this.props.readonly || this.disabled;
|
|
770
|
-
}
|
|
771
|
-
get showMap() {
|
|
772
|
-
return this.field.props.showMap ?? true;
|
|
773
|
-
}
|
|
774
|
-
get lockMapToZoomLevels() {
|
|
775
|
-
return this.field.props.lockMapToZoomLevels ?? false;
|
|
776
|
-
}
|
|
777
|
-
get minZoom() {
|
|
778
|
-
return mapboxZoomLevel(this.field.props.minZoom || MAPBOX_MIN_ZOOM_LEVEL);
|
|
779
|
-
}
|
|
780
|
-
get maxZoom() {
|
|
781
|
-
return mapboxZoomLevel(this.field.props.maxZoom || MAPBOX_MAX_ZOOM_LEVEL);
|
|
782
|
-
}
|
|
783
|
-
get zoomStep() {
|
|
784
|
-
return mapboxZoomLevel(this.field.props.zoomStep || 1);
|
|
785
|
-
}
|
|
786
|
-
ngOnInit() {
|
|
787
|
-
this._formControlObs.next(this.formControl);
|
|
788
|
-
this._center.next(this.center);
|
|
789
|
-
// set/sync props for error messages
|
|
790
|
-
this.props.min = this.minZoom;
|
|
791
|
-
this.props.max = this.maxZoom;
|
|
792
|
-
this.dbxMapboxMapStore.setZoom(this.zoom$);
|
|
793
|
-
// Set center only if showMap is false.
|
|
794
|
-
if (this.showMap) {
|
|
795
|
-
this.dbxMapboxMapStore.setCenter(this.center$);
|
|
796
|
-
}
|
|
797
|
-
if (this.props.readonly) {
|
|
798
|
-
this.formControl.disable();
|
|
799
|
-
if (this.showMap) {
|
|
800
|
-
this.dbxMapboxMapStore.setZoomDisabled();
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
else if (this.lockMapToZoomLevels) {
|
|
804
|
-
// set zoom limits on the map
|
|
805
|
-
this.dbxMapboxMapStore.setZoomRange({ min: this.minZoom, max: this.maxZoom });
|
|
806
|
-
// flat to undo them later if not using the same map
|
|
807
|
-
this._undoZoomLimit = !this.showMap;
|
|
808
|
-
}
|
|
809
|
-
this._sub.subscription = this.dbxMapboxMapStore.zoom$.subscribe((zoom) => {
|
|
810
|
-
if (!this.isReadonlyOrDisabled) {
|
|
811
|
-
this.setValue(zoom);
|
|
812
|
-
}
|
|
813
|
-
});
|
|
814
|
-
}
|
|
815
|
-
ngOnDestroy() {
|
|
816
|
-
super.ngOnDestroy();
|
|
817
|
-
if (!this._undoZoomLimit) {
|
|
818
|
-
this.dbxMapboxMapStore.setZoomRange({});
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
setValue(zoom) {
|
|
822
|
-
this.formControl.setValue(zoom);
|
|
823
|
-
this.formControl.markAsTouched();
|
|
824
|
-
this.formControl.markAsDirty();
|
|
825
|
-
}
|
|
826
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
827
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: DbxFormMapboxZoomFieldComponent, isStandalone: true, selector: "ng-component", providers: [provideMapboxStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
|
|
828
|
-
<div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()" [formGroup]="formGroup">
|
|
829
|
-
@if (showMap) {
|
|
830
|
-
<div class="dbx-mapbox-input-field-map">
|
|
831
|
-
<mgl-map dbxMapboxMap></mgl-map>
|
|
832
|
-
</div>
|
|
833
|
-
}
|
|
834
|
-
<div class="dbx-mapbox-input-field-input">
|
|
835
|
-
<mat-form-field class="dbx-mapbox-input-field-input-field">
|
|
836
|
-
<mat-label>Zoom Level</mat-label>
|
|
837
|
-
<input type="number" matInput [min]="minZoom" [max]="maxZoom" [step]="zoomStep" [placeholder]="placeholder" [formControl]="formControl" />
|
|
838
|
-
</mat-form-field>
|
|
839
|
-
</div>
|
|
840
|
-
</div>
|
|
841
|
-
`, 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: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: DbxMapboxModule }, { kind: "directive", type: i3$1.DbxMapboxMapDirective, selector: "[dbxMapboxMap]" }, { kind: "component", type: i2$1.MapComponent, selector: "mgl-map", inputs: ["accessToken", "collectResourceTiming", "crossSourceCollisions", "fadeDuration", "hash", "refreshExpiredTiles", "failIfMajorPerformanceCaveat", "bearingSnap", "interactive", "pitchWithRotate", "clickTolerance", "attributionControl", "logoPosition", "maxTileCacheSize", "localIdeographFontFamily", "preserveDrawingBuffer", "trackResize", "transformRequest", "bounds", "antialias", "locale", "cooperativeGestures", "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", "mapCreate", "idle", "render", "mapError", "data", "styleData", "sourceData", "dataLoading", "styleDataLoading", "sourceDataLoading", "styleImageMissing"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.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: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i3.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
842
|
-
}
|
|
843
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, decorators: [{
|
|
844
|
-
type: Component,
|
|
845
|
-
args: [{ template: `
|
|
846
|
-
<div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()" [formGroup]="formGroup">
|
|
847
|
-
@if (showMap) {
|
|
848
|
-
<div class="dbx-mapbox-input-field-map">
|
|
849
|
-
<mgl-map dbxMapboxMap></mgl-map>
|
|
850
|
-
</div>
|
|
851
|
-
}
|
|
852
|
-
<div class="dbx-mapbox-input-field-input">
|
|
853
|
-
<mat-form-field class="dbx-mapbox-input-field-input-field">
|
|
854
|
-
<mat-label>Zoom Level</mat-label>
|
|
855
|
-
<input type="number" matInput [min]="minZoom" [max]="maxZoom" [step]="zoomStep" [placeholder]="placeholder" [formControl]="formControl" />
|
|
856
|
-
</mat-form-field>
|
|
857
|
-
</div>
|
|
858
|
-
</div>
|
|
859
|
-
`, providers: [provideMapboxStoreIfParentIsUnavailable()], imports: [NgClass, DbxMapboxModule, FormsModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: 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"] }]
|
|
860
|
-
}] });
|
|
861
|
-
|
|
862
|
-
/* eslint-disable @typescript-eslint/no-deprecated -- legacy NgModule that wraps the deprecated DbxFormMapboxZoomFieldComponent; replacement is provideDbxForgeMapboxFieldDeclarations() */
|
|
863
|
-
const importsAndExports = [DbxFormMapboxZoomFieldComponent];
|
|
864
|
-
/**
|
|
865
|
-
* @deprecated Use provideDbxForgeMapboxFieldDeclarations() instead.
|
|
866
|
-
*/
|
|
867
|
-
class DbxFormMapboxZoomModule {
|
|
868
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxZoomModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
869
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxZoomModule, imports: [DbxFormMapboxZoomFieldComponent, i1.FormlyModule], exports: [DbxFormMapboxZoomFieldComponent] });
|
|
870
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxZoomModule, imports: [importsAndExports, FormlyModule.forChild({
|
|
871
|
-
types: [{ name: 'mapbox-zoom-picker', component: DbxFormMapboxZoomFieldComponent, wrappers: ['style', 'form-field'] }]
|
|
872
|
-
})] });
|
|
873
|
-
}
|
|
874
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxZoomModule, decorators: [{
|
|
875
|
-
type: NgModule,
|
|
876
|
-
args: [{
|
|
877
|
-
imports: [
|
|
878
|
-
...importsAndExports,
|
|
879
|
-
FormlyModule.forChild({
|
|
880
|
-
types: [{ name: 'mapbox-zoom-picker', component: DbxFormMapboxZoomFieldComponent, wrappers: ['style', 'form-field'] }]
|
|
881
|
-
})
|
|
882
|
-
],
|
|
883
|
-
exports: importsAndExports
|
|
884
|
-
}]
|
|
885
|
-
}] });
|
|
886
|
-
|
|
887
375
|
/**
|
|
888
376
|
* The custom forge field type name for the mapbox zoom field.
|
|
889
377
|
*/
|
|
@@ -1107,22 +595,6 @@ var zoom_forge_field_component = /*#__PURE__*/Object.freeze({
|
|
|
1107
595
|
mapboxZoomFieldMapper: mapboxZoomFieldMapper
|
|
1108
596
|
});
|
|
1109
597
|
|
|
1110
|
-
/* eslint-disable @typescript-eslint/no-deprecated -- aggregator NgModule for the deprecated mapbox formly modules; replacement is provideDbxForgeMapboxFieldDeclarations() */
|
|
1111
|
-
/**
|
|
1112
|
-
* @deprecated Use provideDbxForgeMapboxFieldDeclarations() instead.
|
|
1113
|
-
*/
|
|
1114
|
-
class DbxFormMapboxModule {
|
|
1115
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1116
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxModule, exports: [DbxFormMapboxLatLngModule, DbxFormMapboxZoomModule] });
|
|
1117
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxModule, imports: [DbxFormMapboxLatLngModule, DbxFormMapboxZoomModule] });
|
|
1118
|
-
}
|
|
1119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFormMapboxModule, decorators: [{
|
|
1120
|
-
type: NgModule,
|
|
1121
|
-
args: [{
|
|
1122
|
-
exports: [DbxFormMapboxLatLngModule, DbxFormMapboxZoomModule]
|
|
1123
|
-
}]
|
|
1124
|
-
}] });
|
|
1125
|
-
|
|
1126
598
|
/**
|
|
1127
599
|
* Forge mapbox lat/lng field type definition.
|
|
1128
600
|
*/
|
|
@@ -1158,5 +630,5 @@ function provideDbxForgeMapboxFieldDeclarations() {
|
|
|
1158
630
|
* Generated bundle index. Do not edit.
|
|
1159
631
|
*/
|
|
1160
632
|
|
|
1161
|
-
export { DBX_FORGE_MAPBOX_FIELD_TYPES, DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY, DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_MARKER_CONFIG,
|
|
633
|
+
export { DBX_FORGE_MAPBOX_FIELD_TYPES, DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY, DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_MARKER_CONFIG, DbxForgeMapboxLatLngFieldComponent, DbxForgeMapboxLatLngFieldMarkerComponent, DbxForgeMapboxZoomFieldComponent, FORGE_MAPBOX_LATLNG_FIELD_TYPE, FORGE_MAPBOX_ZOOM_FIELD_TYPE, dbxForgeMapboxLatLngField, dbxForgeMapboxZoomField, mapboxLatLngFieldMapper, mapboxZoomFieldMapper, provideDbxForgeMapboxFieldDeclarations };
|
|
1162
634
|
//# sourceMappingURL=dereekb-dbx-form-mapbox.mjs.map
|