@dereekb/dbx-form 13.7.0 → 13.9.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.
Files changed (42) hide show
  1. package/fesm2022/dereekb-dbx-form-calendar.mjs +425 -144
  2. package/fesm2022/dereekb-dbx-form-calendar.mjs.map +1 -1
  3. package/fesm2022/dereekb-dbx-form-expand.field.component-Bp5_uO1A.mjs +56 -0
  4. package/fesm2022/dereekb-dbx-form-expand.field.component-Bp5_uO1A.mjs.map +1 -0
  5. package/fesm2022/dereekb-dbx-form-flex.wrapper.component-CpOHCk87.mjs +39 -0
  6. package/fesm2022/dereekb-dbx-form-flex.wrapper.component-CpOHCk87.mjs.map +1 -0
  7. package/fesm2022/dereekb-dbx-form-info.field.component-B0cFprvc.mjs +50 -0
  8. package/fesm2022/dereekb-dbx-form-info.field.component-B0cFprvc.mjs.map +1 -0
  9. package/fesm2022/dereekb-dbx-form-info.wrapper.component-18n632L-.mjs +61 -0
  10. package/fesm2022/dereekb-dbx-form-info.wrapper.component-18n632L-.mjs.map +1 -0
  11. package/fesm2022/dereekb-dbx-form-mapbox.mjs +639 -32
  12. package/fesm2022/dereekb-dbx-form-mapbox.mjs.map +1 -1
  13. package/fesm2022/dereekb-dbx-form-quiz.mjs +46 -55
  14. package/fesm2022/dereekb-dbx-form-quiz.mjs.map +1 -1
  15. package/fesm2022/dereekb-dbx-form-section.wrapper.component-vq21oG6v.mjs +52 -0
  16. package/fesm2022/dereekb-dbx-form-section.wrapper.component-vq21oG6v.mjs.map +1 -0
  17. package/fesm2022/dereekb-dbx-form-style.wrapper.component-BbKj-IHD.mjs +42 -0
  18. package/fesm2022/dereekb-dbx-form-style.wrapper.component-BbKj-IHD.mjs.map +1 -0
  19. package/fesm2022/dereekb-dbx-form.mjs +13688 -5235
  20. package/fesm2022/dereekb-dbx-form.mjs.map +1 -1
  21. package/lib/forge/_forge.scss +14 -0
  22. package/lib/forge/field/_field.scss +12 -0
  23. package/lib/forge/field/selection/_selection.scss +18 -0
  24. package/lib/forge/field/selection/list/_list.scss +17 -0
  25. package/lib/forge/field/selection/pickable/_pickable.scss +36 -0
  26. package/lib/forge/field/selection/searchable/_searchable.scss +34 -0
  27. package/lib/forge/field/selection/sourceselect/_sourceselect.scss +30 -0
  28. package/lib/forge/field/wrapper/_wrapper.scss +72 -0
  29. package/lib/{formly/form/_form.scss → forge/preset/_preset.scss} +3 -12
  30. package/lib/forge/style/_shared.scss +36 -0
  31. package/lib/form/_form.scss +109 -0
  32. package/lib/formly/field/selection/sourceselect/_sourceselect.scss +0 -7
  33. package/lib/formly/field/texteditor/_texteditor.scss +8 -0
  34. package/lib/formly/field/value/array/_array.scss +6 -0
  35. package/lib/formly/field/value/phone/_phone.scss +4 -1
  36. package/lib/style/_all-core.scss +2 -2
  37. package/lib/style/_all-theme.scss +2 -2
  38. package/lib/style/_all-typography.scss +1 -1
  39. package/package.json +16 -14
  40. package/types/dereekb-dbx-form-calendar.d.ts +306 -100
  41. package/types/dereekb-dbx-form-mapbox.d.ts +304 -8
  42. package/types/dereekb-dbx-form.d.ts +8837 -2720
@@ -1,17 +1,17 @@
1
1
  import { validatorsForFieldConfig, DEFAULT_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE, formlyField, propsAndConfigForFieldConfig, DEFAULT_LAT_LNG_TEXT_FIELD_PLACEHOLDER } from '@dereekb/dbx-form';
2
- import { LAT_LNG_PATTERN, isSameLatLngPoint, isDefaultLatLngPoint, isValidLatLngPoint, defaultLatLngPoint, latLngStringFunction, latLngPointFunction, latLngPoint } from '@dereekb/util';
2
+ import { LAT_LNG_PATTERN, isSameLatLngPoint, isDefaultLatLngPoint, isValidLatLngPoint, defaultLatLngPoint, latLngStringFunction, latLngPointFunction, filterFromPOJO, latLngPoint } from '@dereekb/util';
3
3
  import * as i3 from '@angular/forms';
4
- import { ReactiveFormsModule, FormsModule } from '@angular/forms';
4
+ import { ReactiveFormsModule, FormControl, FormsModule } from '@angular/forms';
5
5
  import { CompactContextStore, mapCompactModeObs } from '@dereekb/dbx-web';
6
6
  import * as i0 from '@angular/core';
7
- import { inject, ChangeDetectionStrategy, Component, Injector, NgModule } from '@angular/core';
7
+ import { inject, ChangeDetectionStrategy, Component, Injector, NgModule, ElementRef, input, computed, effect } from '@angular/core';
8
8
  import { FieldType } from '@ngx-formly/material';
9
9
  import { combineLatest, map, shareReplay, BehaviorSubject, of, switchMap, startWith, distinctUntilChanged, skipWhile, filter, skip, throttleTime, first } from 'rxjs';
10
10
  import { SubscriptionObject, filterMaybe, asObservableFromGetter } from '@dereekb/rxjs';
11
11
  import { WaGeolocationService } from '@ng-web-apis/geolocation';
12
12
  import * as i3$1 from '@dereekb/dbx-web/mapbox';
13
13
  import { DbxMapboxMarkerComponent, DbxMapboxInjectionStore, DbxMapboxMapStore, DbxMapboxModule, provideMapboxStoreIfParentIsUnavailable, DbxMapboxService, mapboxZoomLevel, MAPBOX_MIN_ZOOM_LEVEL, MAPBOX_MAX_ZOOM_LEVEL } from '@dereekb/dbx-web/mapbox';
14
- import { toSignal } from '@angular/core/rxjs-interop';
14
+ import { toSignal, toObservable } from '@angular/core/rxjs-interop';
15
15
  import { NgClass } from '@angular/common';
16
16
  import * as i4 from '@angular/material/button';
17
17
  import { MatButtonModule } from '@angular/material/button';
@@ -25,10 +25,13 @@ import * as i2$1 from 'ngx-mapbox-gl';
25
25
  import { MapComponent, MarkerComponent } from 'ngx-mapbox-gl';
26
26
  import * as i1 from '@ngx-formly/core';
27
27
  import { FormlyModule } from '@ngx-formly/core';
28
+ import { DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES, provideDynamicForm } from '@ng-forge/dynamic-forms';
29
+ import { setupMetaTracking, resolveValueFieldContext, buildValueFieldInputs } from '@ng-forge/dynamic-forms/integration';
28
30
 
29
31
  /**
30
32
  * Creates a Formly field configuration for a Mapbox-powered latitude/longitude picker with optional map display.
31
33
  *
34
+ * @deprecated Use dbxForgeMapboxLatLngField() from the forge API instead.
32
35
  * @param config - Optional field configuration overrides
33
36
  * @returns A validated Formly field configuration for the Mapbox lat/lng picker
34
37
  */
@@ -68,20 +71,15 @@ function mapboxLatLngField(config = {}) {
68
71
  class DbxFormMapboxLatLngFieldMarkerComponent {
69
72
  fieldComponent = inject(DbxFormMapboxLatLngFieldComponent);
70
73
  marker$ = combineLatest([this.fieldComponent.latLng$, this.fieldComponent.markerConfig$]).pipe(map(([latLng, markerConfig]) => {
71
- if (markerConfig !== false) {
72
- return { latLng, ...markerConfig };
73
- }
74
- else {
75
- return undefined;
76
- }
74
+ return markerConfig !== false ? { latLng, ...markerConfig } : undefined;
77
75
  }), shareReplay(1));
78
76
  markerSignal = toSignal(this.marker$);
79
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
80
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.3", type: DbxFormMapboxLatLngFieldMarkerComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `
77
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
78
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: DbxFormMapboxLatLngFieldMarkerComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `
81
79
  <dbx-mapbox-marker [marker]="markerSignal()"></dbx-mapbox-marker>
82
80
  `, isInline: true, dependencies: [{ kind: "component", type: DbxMapboxMarkerComponent, selector: "dbx-mapbox-marker", inputs: ["marker"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
83
81
  }
84
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, decorators: [{
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxLatLngFieldMarkerComponent, decorators: [{
85
83
  type: Component,
86
84
  args: [{
87
85
  template: `
@@ -103,6 +101,9 @@ const DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_MARKER_CONFIG = {
103
101
  <mat-icon>my_location</mat-icon>
104
102
  </button>
105
103
  */
104
+ /**
105
+ * @deprecated Use DbxForgeMapboxLatLngFieldComponent instead.
106
+ */
106
107
  class DbxFormMapboxLatLngFieldComponent extends FieldType {
107
108
  _geolocationService = inject(WaGeolocationService);
108
109
  compact = inject(CompactContextStore, { optional: true });
@@ -275,8 +276,8 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
275
276
  this.formControl.markAsTouched();
276
277
  this.formControl.markAsDirty();
277
278
  }
278
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
279
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DbxFormMapboxLatLngFieldComponent, isStandalone: true, selector: "ng-component", providers: [provideMapboxStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
279
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
280
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: DbxFormMapboxLatLngFieldComponent, isStandalone: true, selector: "ng-component", providers: [provideMapboxStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
280
281
  <div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()" [formGroup]="formGroup">
281
282
  @if (showMap) {
282
283
  <div class="dbx-mapbox-input-field-map">
@@ -302,7 +303,7 @@ class DbxFormMapboxLatLngFieldComponent extends FieldType {
302
303
  </div>
303
304
  `, 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 });
304
305
  }
305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, decorators: [{
306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxLatLngFieldComponent, decorators: [{
306
307
  type: Component,
307
308
  args: [{ template: `
308
309
  <div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()" [formGroup]="formGroup">
@@ -332,14 +333,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImpor
332
333
  }] });
333
334
 
334
335
  const importsAndExports$1 = [DbxFormMapboxLatLngFieldComponent];
336
+ /**
337
+ * @deprecated Use provideDbxForgeMapboxFieldDeclarations() instead.
338
+ */
335
339
  class DbxFormMapboxLatLngModule {
336
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxLatLngModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
337
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxLatLngModule, imports: [DbxFormMapboxLatLngFieldComponent, i1.FormlyModule], exports: [DbxFormMapboxLatLngFieldComponent] });
338
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxLatLngModule, imports: [importsAndExports$1, FormlyModule.forChild({
340
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxLatLngModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
341
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxLatLngModule, imports: [DbxFormMapboxLatLngFieldComponent, i1.FormlyModule], exports: [DbxFormMapboxLatLngFieldComponent] });
342
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxLatLngModule, imports: [importsAndExports$1, FormlyModule.forChild({
339
343
  types: [{ name: 'mapbox-latlng-picker', component: DbxFormMapboxLatLngFieldComponent, wrappers: ['style', 'form-field'] }]
340
344
  })] });
341
345
  }
342
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxLatLngModule, decorators: [{
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxLatLngModule, decorators: [{
343
347
  type: NgModule,
344
348
  args: [{
345
349
  imports: [
@@ -352,9 +356,355 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImpor
352
356
  }]
353
357
  }] });
354
358
 
359
+ /**
360
+ * The custom forge field type name for the mapbox lat/lng field.
361
+ */
362
+ const FORGE_MAPBOX_LATLNG_FIELD_TYPE = 'dbx-forge-mapbox-latlng';
363
+ /**
364
+ * Creates a forge field definition for a Mapbox-powered latitude/longitude picker.
365
+ *
366
+ * This is the forge equivalent of {@link mapboxLatLngField}.
367
+ *
368
+ * @param config - Optional field configuration overrides
369
+ * @returns A validated forge field definition for the Mapbox lat/lng picker
370
+ */
371
+ function dbxForgeMapboxLatLngField(config = {}) {
372
+ const { key = 'latLng', label, description, required, readonly: isReadonly, showMap, zoom, latLngConfig, recenterTime, showCenterButton, setCenterOnLocationSet, selectLocationOnMapDrag, selectLocationOnMapClick, markerConfig } = config;
373
+ const props = filterFromPOJO({
374
+ label: label ?? 'Location',
375
+ description,
376
+ placeholder: DEFAULT_LAT_LNG_TEXT_FIELD_PLACEHOLDER,
377
+ pattern: LAT_LNG_PATTERN,
378
+ patternMessage: DEFAULT_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE,
379
+ showMap,
380
+ zoom,
381
+ latLngConfig,
382
+ recenterTime,
383
+ selectLocationOnMapDrag,
384
+ selectLocationOnMapClick,
385
+ showCenterButton,
386
+ setCenterOnLocationSet,
387
+ markerConfig
388
+ });
389
+ return filterFromPOJO({
390
+ key,
391
+ type: FORGE_MAPBOX_LATLNG_FIELD_TYPE,
392
+ label: label ?? 'Location',
393
+ value: undefined,
394
+ required,
395
+ readonly: isReadonly,
396
+ props: Object.keys(props).length > 0 ? props : undefined
397
+ });
398
+ }
399
+
400
+ class DbxForgeMapboxLatLngFieldMarkerComponent {
401
+ fieldComponent = inject(DbxForgeMapboxLatLngFieldComponent);
402
+ marker$ = combineLatest([this.fieldComponent.latLng$, this.fieldComponent.markerConfig$]).pipe(map(([latLng, markerConfig]) => {
403
+ return markerConfig !== false ? { latLng, ...markerConfig } : undefined;
404
+ }), shareReplay(1));
405
+ markerSignal = toSignal(this.marker$);
406
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxForgeMapboxLatLngFieldMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
407
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: DbxForgeMapboxLatLngFieldMarkerComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `
408
+ <dbx-mapbox-marker [marker]="markerSignal()"></dbx-mapbox-marker>
409
+ `, isInline: true, dependencies: [{ kind: "component", type: DbxMapboxMarkerComponent, selector: "dbx-mapbox-marker", inputs: ["marker"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
410
+ }
411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxForgeMapboxLatLngFieldMarkerComponent, decorators: [{
412
+ type: Component,
413
+ args: [{
414
+ template: `
415
+ <dbx-mapbox-marker [marker]="markerSignal()"></dbx-mapbox-marker>
416
+ `,
417
+ imports: [DbxMapboxMarkerComponent],
418
+ changeDetection: ChangeDetectionStrategy.OnPush,
419
+ standalone: true
420
+ }]
421
+ }] });
422
+
423
+ const DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY = 'DbxForgeMapboxLatLngFieldComponent';
424
+ const DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_MARKER_CONFIG = {
425
+ icon: 'pin_drop'
426
+ };
427
+ /**
428
+ * Forge custom field component for Mapbox latitude/longitude picking.
429
+ *
430
+ * This is the forge equivalent of {@link DbxFormMapboxLatLngFieldComponent}.
431
+ * It bridges ng-forge Signal Forms with the Mapbox map store.
432
+ *
433
+ * Registered as ng-forge type 'dbx-forge-mapbox-latlng'.
434
+ */
435
+ class DbxForgeMapboxLatLngFieldComponent {
436
+ _geolocationService = inject(WaGeolocationService);
437
+ compact = inject(CompactContextStore, { optional: true });
438
+ dbxMapboxInjectionStore = inject(DbxMapboxInjectionStore, { optional: true });
439
+ dbxMapboxMapStore = inject(DbxMapboxMapStore);
440
+ elementRef = inject((ElementRef));
441
+ // Standard ng-forge value field inputs
442
+ field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
443
+ key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
444
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
445
+ placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
446
+ className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
447
+ tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
448
+ props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
449
+ meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
450
+ validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
451
+ defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
452
+ // Internal text form control for the coordinate input
453
+ textCtrl = new FormControl('');
454
+ // Subscription management
455
+ _sub = new SubscriptionObject();
456
+ _geoSub = new SubscriptionObject();
457
+ _centerSub = new SubscriptionObject();
458
+ _flyToCenterSub = new SubscriptionObject();
459
+ _clickSub = new SubscriptionObject();
460
+ _zoom = new BehaviorSubject(12);
461
+ _markerConfig = new BehaviorSubject(of(DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_MARKER_CONFIG));
462
+ // Reactive lat/lng conversion functions derived from props so latLng$ recomputes when props arrive.
463
+ latLngPointConfigSignal = computed(() => {
464
+ const p = this.props();
465
+ return { ...p?.latLngConfig, wrap: p?.latLngConfig?.wrap || false, validate: p?.latLngConfig?.validate || false, precisionRounding: p?.latLngConfig?.precisionRounding ?? 'round' };
466
+ }, ...(ngDevMode ? [{ debugName: "latLngPointConfigSignal" }] : /* istanbul ignore next */ []));
467
+ latLngPointFunctionSignal = computed(() => latLngPointFunction(this.latLngPointConfigSignal()), ...(ngDevMode ? [{ debugName: "latLngPointFunctionSignal" }] : /* istanbul ignore next */ []));
468
+ latLngStringFunctionSignal = computed(() => latLngStringFunction(this.latLngPointConfigSignal()), ...(ngDevMode ? [{ debugName: "latLngStringFunctionSignal" }] : /* istanbul ignore next */ []));
469
+ compactClass$ = mapCompactModeObs(this.compact?.mode$, {
470
+ compact: 'dbx-mapbox-input-field-compact'
471
+ }).pipe(filterMaybe());
472
+ _useCurrentLocationDisabled = new BehaviorSubject(false);
473
+ useCurrentLocationDisabled$ = this._useCurrentLocationDisabled.asObservable();
474
+ // Field value signal (double-call pattern)
475
+ fieldValue = computed(() => {
476
+ const state = this.field()?.();
477
+ return state?.value?.();
478
+ }, ...(ngDevMode ? [{ debugName: "fieldValue" }] : /* istanbul ignore next */ []));
479
+ isDisabled = computed(() => {
480
+ const state = this.field()?.();
481
+ return state?.disabled?.() ?? false;
482
+ }, ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
483
+ isReadonlyOrDisabledSignal = computed(() => this.props()?.readonly || this.isDisabled(), ...(ngDevMode ? [{ debugName: "isReadonlyOrDisabledSignal" }] : /* istanbul ignore next */ []));
484
+ // Computed props from field definition
485
+ showMapSignal = computed(() => this.props()?.showMap ?? true, ...(ngDevMode ? [{ debugName: "showMapSignal" }] : /* istanbul ignore next */ []));
486
+ selectLocationOnMapDragSignal = computed(() => this.props()?.selectLocationOnMapDrag ?? true, ...(ngDevMode ? [{ debugName: "selectLocationOnMapDragSignal" }] : /* istanbul ignore next */ []));
487
+ selectLocationOnMapClickSignal = computed(() => this.props()?.selectLocationOnMapClick ?? false, ...(ngDevMode ? [{ debugName: "selectLocationOnMapClickSignal" }] : /* istanbul ignore next */ []));
488
+ setCenterOnLocationSetSignal = computed(() => this.props()?.setCenterOnLocationSet ?? true, ...(ngDevMode ? [{ debugName: "setCenterOnLocationSetSignal" }] : /* istanbul ignore next */ []));
489
+ showCenterButtonSignal = computed(() => !this.selectLocationOnMapDragSignal() && this.props()?.showCenterButton !== false, ...(ngDevMode ? [{ debugName: "showCenterButtonSignal" }] : /* istanbul ignore next */ []));
490
+ recenterTimeSignal = computed(() => this.props()?.recenterTime || 10 * 1000, ...(ngDevMode ? [{ debugName: "recenterTimeSignal" }] : /* istanbul ignore next */ []));
491
+ placeholderTextSignal = computed(() => this.props()?.placeholder, ...(ngDevMode ? [{ debugName: "placeholderTextSignal" }] : /* istanbul ignore next */ []));
492
+ // Observables for map store sync
493
+ latLngValueSignal = computed(() => {
494
+ const value = this.fieldValue();
495
+ const fn = this.latLngPointFunctionSignal();
496
+ return value != null ? fn(value) : defaultLatLngPoint();
497
+ }, ...(ngDevMode ? [{ debugName: "latLngValueSignal" }] : /* istanbul ignore next */ []));
498
+ latLng$ = toObservable(this.latLngValueSignal).pipe(distinctUntilChanged(isSameLatLngPoint), shareReplay(1));
499
+ nonZeroLatLng$ = this.latLng$.pipe(skipWhile(isDefaultLatLngPoint), filter(isValidLatLngPoint));
500
+ zoom$ = this._zoom.asObservable();
501
+ markerConfig$ = this._markerConfig.asObservable().pipe(switchMap((x) => x), shareReplay(1));
502
+ useCurrentLocationDisabledSignal = toSignal(this._useCurrentLocationDisabled, { initialValue: false });
503
+ compactClassSignal = toSignal(this.compactClass$, { initialValue: '' });
504
+ latLngSignal = this.latLngValueSignal;
505
+ _syncing = false;
506
+ _setFieldValue(value) {
507
+ const state = this.field()?.();
508
+ if (state?.value?.set) {
509
+ state.value.set(value);
510
+ state.markAsTouched?.();
511
+ state.markAsDirty?.();
512
+ }
513
+ }
514
+ constructor() {
515
+ setupMetaTracking(this.elementRef, this.meta, { selector: 'input' });
516
+ // Initialize on first props emission
517
+ effect(() => {
518
+ const p = this.props();
519
+ if (!p) {
520
+ return;
521
+ }
522
+ const zoom = Math.min(p.zoom || 12, 18);
523
+ this._zoom.next(zoom);
524
+ if (p.setCenterOnLocationSet !== false) {
525
+ this._centerSub.subscription = this.dbxMapboxMapStore.setCenter(this.nonZeroLatLng$);
526
+ }
527
+ if (p.showMap ?? true) {
528
+ this.dbxMapboxMapStore.setZoom(this.zoom$);
529
+ const recenterTime = p.recenterTime || 10 * 1000;
530
+ if (recenterTime > 0) {
531
+ this._flyToCenterSub.subscription = this.dbxMapboxMapStore.center$.pipe(skip(1), throttleTime(recenterTime, undefined, { leading: false, trailing: true })).subscribe(() => {
532
+ this.flyToMarker();
533
+ });
534
+ }
535
+ }
536
+ else {
537
+ if (p.selectLocationOnMapDrag ?? true) {
538
+ this._sub.subscription = this.dbxMapboxMapStore.center$.subscribe((center) => {
539
+ this.dbxMapboxMapStore.centerGivenMargin$.pipe(first()).subscribe(() => {
540
+ if (!this.isReadonlyOrDisabledSignal()) {
541
+ this.setValue(center);
542
+ }
543
+ });
544
+ });
545
+ }
546
+ if (p.selectLocationOnMapClick) {
547
+ this._clickSub.subscription = this.dbxMapboxMapStore.clickEvent$.subscribe((x) => {
548
+ if (x?.type === 'click') {
549
+ this.setValue(x.lngLat);
550
+ }
551
+ });
552
+ }
553
+ }
554
+ if (p.readonly) {
555
+ this.textCtrl.disable();
556
+ }
557
+ // Add the marker to the injection store for display
558
+ if (this.dbxMapboxInjectionStore) {
559
+ if (p.markerConfig != null) {
560
+ this._markerConfig.next(p.markerConfig === false ? of(false) : asObservableFromGetter(p.markerConfig, this));
561
+ }
562
+ this.dbxMapboxInjectionStore.addInjectionConfig({
563
+ key: p.mapInjectionKey || DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY,
564
+ injectionConfig: {
565
+ componentClass: DbxForgeMapboxLatLngFieldMarkerComponent,
566
+ providers: [{ provide: DbxForgeMapboxLatLngFieldComponent, useValue: this }]
567
+ }
568
+ });
569
+ }
570
+ });
571
+ // Sync field value → text control (inbound)
572
+ effect(() => {
573
+ const value = this.fieldValue();
574
+ if (!this._syncing) {
575
+ this._syncing = true;
576
+ this.textCtrl.setValue(value ?? '', { emitEvent: false });
577
+ this._syncing = false;
578
+ }
579
+ });
580
+ // Sync text control → field value (outbound)
581
+ this.textCtrl.valueChanges.subscribe((textValue) => {
582
+ if (!this._syncing) {
583
+ this._syncing = true;
584
+ this._setFieldValue(textValue || null);
585
+ this._syncing = false;
586
+ }
587
+ });
588
+ }
589
+ ngOnDestroy() {
590
+ this._zoom.complete();
591
+ this._markerConfig.complete();
592
+ this._useCurrentLocationDisabled.complete();
593
+ this._sub.destroy();
594
+ this._geoSub.destroy();
595
+ this._centerSub.destroy();
596
+ this._flyToCenterSub.destroy();
597
+ this._clickSub.destroy();
598
+ }
599
+ flyToMarker() {
600
+ this.dbxMapboxMapStore.easeTo(this.nonZeroLatLng$.pipe(first(), map((x) => ({ center: x }))));
601
+ }
602
+ useCurrentLocation() {
603
+ this._geoSub.subscription = this._geolocationService.pipe(first()).subscribe({
604
+ next: (position) => {
605
+ if (position) {
606
+ const { latitude: lat, longitude: lng } = position.coords;
607
+ this.setValue({ lat, lng });
608
+ }
609
+ },
610
+ error: () => {
611
+ this._useCurrentLocationDisabled.next(true);
612
+ }
613
+ });
614
+ }
615
+ onMarkerDragEnd(marker) {
616
+ this.setValue(marker.getLngLat());
617
+ }
618
+ setValue(latLng) {
619
+ const stringValue = latLng ? this.latLngStringFunctionSignal()(latLng) : null;
620
+ this._syncing = true;
621
+ this.textCtrl.setValue(stringValue, { emitEvent: false });
622
+ this._setFieldValue(stringValue);
623
+ this._syncing = false;
624
+ }
625
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxForgeMapboxLatLngFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
626
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: DbxForgeMapboxLatLngFieldComponent, isStandalone: true, selector: "dbx-forge-mapbox-latlng-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: false, transformFunction: null }, validationMessages: { classPropertyName: "validationMessages", publicName: "validationMessages", isSignal: true, isRequired: false, transformFunction: null }, defaultValidationMessages: { classPropertyName: "defaultValidationMessages", publicName: "defaultValidationMessages", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideMapboxStoreIfParentIsUnavailable()], ngImport: i0, template: `
627
+ <div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()">
628
+ @if (showMapSignal()) {
629
+ <div class="dbx-mapbox-input-field-map">
630
+ <mgl-map dbxMapboxMap>
631
+ <mgl-marker [lngLat]="latLngSignal()" [draggable]="!isReadonlyOrDisabledSignal()" (markerDragEnd)="onMarkerDragEnd($event)"></mgl-marker>
632
+ </mgl-map>
633
+ </div>
634
+ }
635
+ <div class="dbx-mapbox-input-field-input">
636
+ @if (showCenterButtonSignal()) {
637
+ <button mat-icon-button (click)="flyToMarker()">
638
+ <mat-icon>my_location</mat-icon>
639
+ </button>
640
+ }
641
+ <mat-form-field class="dbx-mapbox-input-field-input-field">
642
+ <mat-label>Coordinates</mat-label>
643
+ <input type="text" matInput [placeholder]="placeholderTextSignal() ?? ''" [formControl]="textCtrl" />
644
+ @if (useCurrentLocationDisabledSignal()) {
645
+ <mat-hint class="dbx-hint dbx-warn">Could not access your current location.</mat-hint>
646
+ }
647
+ </mat-form-field>
648
+ </div>
649
+ </div>
650
+ `, 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.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], 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 });
651
+ }
652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxForgeMapboxLatLngFieldComponent, decorators: [{
653
+ type: Component,
654
+ args: [{ selector: 'dbx-forge-mapbox-latlng-field', template: `
655
+ <div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()">
656
+ @if (showMapSignal()) {
657
+ <div class="dbx-mapbox-input-field-map">
658
+ <mgl-map dbxMapboxMap>
659
+ <mgl-marker [lngLat]="latLngSignal()" [draggable]="!isReadonlyOrDisabledSignal()" (markerDragEnd)="onMarkerDragEnd($event)"></mgl-marker>
660
+ </mgl-map>
661
+ </div>
662
+ }
663
+ <div class="dbx-mapbox-input-field-input">
664
+ @if (showCenterButtonSignal()) {
665
+ <button mat-icon-button (click)="flyToMarker()">
666
+ <mat-icon>my_location</mat-icon>
667
+ </button>
668
+ }
669
+ <mat-form-field class="dbx-mapbox-input-field-input-field">
670
+ <mat-label>Coordinates</mat-label>
671
+ <input type="text" matInput [placeholder]="placeholderTextSignal() ?? ''" [formControl]="textCtrl" />
672
+ @if (useCurrentLocationDisabledSignal()) {
673
+ <mat-hint class="dbx-hint dbx-warn">Could not access your current location.</mat-hint>
674
+ }
675
+ </mat-form-field>
676
+ </div>
677
+ </div>
678
+ `, 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"] }]
679
+ }], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
680
+ /**
681
+ * Custom mapper for the forge mapbox lat/lng field.
682
+ *
683
+ * @param fieldDef - Field definition configuration
684
+ * @param fieldDef.key - Form model key for the field
685
+ * @returns Signal containing a Record of input names to values for ngComponentOutlet
686
+ */
687
+ function mapboxLatLngFieldMapper(fieldDef) {
688
+ const ctx = resolveValueFieldContext();
689
+ const defaultProps = inject(DEFAULT_PROPS);
690
+ const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);
691
+ return computed(() => {
692
+ return buildValueFieldInputs(fieldDef, ctx, defaultProps?.(), defaultValidationMessages?.());
693
+ });
694
+ }
695
+
696
+ var latlng_forge_field_component = /*#__PURE__*/Object.freeze({
697
+ __proto__: null,
698
+ DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY: DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY,
699
+ DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_MARKER_CONFIG: DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_MARKER_CONFIG,
700
+ DbxForgeMapboxLatLngFieldComponent: DbxForgeMapboxLatLngFieldComponent,
701
+ mapboxLatLngFieldMapper: mapboxLatLngFieldMapper
702
+ });
703
+
355
704
  /**
356
705
  * Creates a Formly field configuration for a Mapbox-powered zoom level picker with optional map preview.
357
706
  *
707
+ * @deprecated Use dbxForgeMapboxZoomField() from the forge API instead.
358
708
  * @param config - Optional field configuration overrides
359
709
  * @returns A validated Formly field configuration for the Mapbox zoom picker
360
710
  */
@@ -380,6 +730,9 @@ function mapboxZoomField(config = {}) {
380
730
  return fieldConfig;
381
731
  }
382
732
 
733
+ /**
734
+ * @deprecated Use DbxForgeMapboxZoomFieldComponent instead.
735
+ */
383
736
  class DbxFormMapboxZoomFieldComponent extends FieldType {
384
737
  compact = inject(CompactContextStore, { optional: true });
385
738
  dbxMapboxService = inject(DbxMapboxService);
@@ -472,8 +825,8 @@ class DbxFormMapboxZoomFieldComponent extends FieldType {
472
825
  this.formControl.markAsTouched();
473
826
  this.formControl.markAsDirty();
474
827
  }
475
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
476
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DbxFormMapboxZoomFieldComponent, isStandalone: true, selector: "ng-component", providers: [provideMapboxStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
828
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
829
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: DbxFormMapboxZoomFieldComponent, isStandalone: true, selector: "ng-component", providers: [provideMapboxStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
477
830
  <div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()" [formGroup]="formGroup">
478
831
  @if (showMap) {
479
832
  <div class="dbx-mapbox-input-field-map">
@@ -489,7 +842,7 @@ class DbxFormMapboxZoomFieldComponent extends FieldType {
489
842
  </div>
490
843
  `, 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 });
491
844
  }
492
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, decorators: [{
845
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxZoomFieldComponent, decorators: [{
493
846
  type: Component,
494
847
  args: [{ template: `
495
848
  <div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()" [formGroup]="formGroup">
@@ -509,14 +862,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImpor
509
862
  }] });
510
863
 
511
864
  const importsAndExports = [DbxFormMapboxZoomFieldComponent];
865
+ /**
866
+ * @deprecated Use provideDbxForgeMapboxFieldDeclarations() instead.
867
+ */
512
868
  class DbxFormMapboxZoomModule {
513
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxZoomModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
514
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxZoomModule, imports: [DbxFormMapboxZoomFieldComponent, i1.FormlyModule], exports: [DbxFormMapboxZoomFieldComponent] });
515
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxZoomModule, imports: [importsAndExports, FormlyModule.forChild({
869
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxZoomModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
870
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxZoomModule, imports: [DbxFormMapboxZoomFieldComponent, i1.FormlyModule], exports: [DbxFormMapboxZoomFieldComponent] });
871
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxZoomModule, imports: [importsAndExports, FormlyModule.forChild({
516
872
  types: [{ name: 'mapbox-zoom-picker', component: DbxFormMapboxZoomFieldComponent, wrappers: ['style', 'form-field'] }]
517
873
  })] });
518
874
  }
519
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxZoomModule, decorators: [{
875
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxZoomModule, decorators: [{
520
876
  type: NgModule,
521
877
  args: [{
522
878
  imports: [
@@ -529,21 +885,272 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImpor
529
885
  }]
530
886
  }] });
531
887
 
888
+ /**
889
+ * The custom forge field type name for the mapbox zoom field.
890
+ */
891
+ const FORGE_MAPBOX_ZOOM_FIELD_TYPE = 'dbx-forge-mapbox-zoom';
892
+ /**
893
+ * Creates a forge field definition for a Mapbox-powered zoom level picker.
894
+ *
895
+ * This is the forge equivalent of {@link mapboxZoomField}.
896
+ *
897
+ * @param config - Optional field configuration overrides
898
+ * @returns A validated forge field definition for the Mapbox zoom picker
899
+ */
900
+ function dbxForgeMapboxZoomField(config = {}) {
901
+ const { key = 'zoom', label, description, required, readonly: isReadonly, showMap, center, minZoom, maxZoom, zoomStep } = config;
902
+ const props = filterFromPOJO({
903
+ label: label ?? 'Zoom',
904
+ description,
905
+ showMap,
906
+ center,
907
+ minZoom,
908
+ maxZoom,
909
+ zoomStep
910
+ });
911
+ return filterFromPOJO({
912
+ key,
913
+ type: FORGE_MAPBOX_ZOOM_FIELD_TYPE,
914
+ label: label ?? 'Zoom',
915
+ value: undefined,
916
+ required,
917
+ readonly: isReadonly,
918
+ props: Object.keys(props).length > 0 ? props : undefined
919
+ });
920
+ }
921
+
922
+ /**
923
+ * Forge custom field component for Mapbox zoom level picking.
924
+ *
925
+ * This is the forge equivalent of {@link DbxFormMapboxZoomFieldComponent}.
926
+ * It bridges ng-forge Signal Forms with the Mapbox map store.
927
+ *
928
+ * Registered as ng-forge type 'dbx-forge-mapbox-zoom'.
929
+ */
930
+ class DbxForgeMapboxZoomFieldComponent {
931
+ compact = inject(CompactContextStore, { optional: true });
932
+ dbxMapboxService = inject(DbxMapboxService);
933
+ dbxMapboxMapStore = inject(DbxMapboxMapStore);
934
+ elementRef = inject((ElementRef));
935
+ // Standard ng-forge value field inputs
936
+ field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
937
+ key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
938
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
939
+ placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
940
+ className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
941
+ tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
942
+ props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
943
+ meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
944
+ validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
945
+ defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
946
+ // Internal number form control for the zoom input
947
+ numberCtrl = new FormControl(null);
948
+ placeholderText = '';
949
+ _undoZoomLimit = false;
950
+ compactClass$ = mapCompactModeObs(this.compact?.mode$, {
951
+ compact: 'dbx-mapbox-input-field-compact'
952
+ }).pipe(filterMaybe());
953
+ compactClassSignal = toSignal(this.compactClass$, { initialValue: '' });
954
+ // Subscription management
955
+ _sub = new SubscriptionObject();
956
+ _center = new BehaviorSubject(undefined);
957
+ // Field value signal (double-call pattern)
958
+ fieldValue = computed(() => {
959
+ const state = this.field()?.();
960
+ return state?.value?.();
961
+ }, ...(ngDevMode ? [{ debugName: "fieldValue" }] : /* istanbul ignore next */ []));
962
+ isDisabled = computed(() => {
963
+ const state = this.field()?.();
964
+ return state?.disabled?.() ?? false;
965
+ }, ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
966
+ isReadonlyOrDisabledSignal = computed(() => this.props()?.readonly || this.isDisabled(), ...(ngDevMode ? [{ debugName: "isReadonlyOrDisabledSignal" }] : /* istanbul ignore next */ []));
967
+ // Computed props
968
+ showMapSignal = computed(() => this.props()?.showMap ?? true, ...(ngDevMode ? [{ debugName: "showMapSignal" }] : /* istanbul ignore next */ []));
969
+ lockMapToZoomLevelsSignal = computed(() => this.props()?.lockMapToZoomLevels ?? false, ...(ngDevMode ? [{ debugName: "lockMapToZoomLevelsSignal" }] : /* istanbul ignore next */ []));
970
+ minZoomSignal = computed(() => mapboxZoomLevel(this.props()?.minZoom || MAPBOX_MIN_ZOOM_LEVEL), ...(ngDevMode ? [{ debugName: "minZoomSignal" }] : /* istanbul ignore next */ []));
971
+ maxZoomSignal = computed(() => mapboxZoomLevel(this.props()?.maxZoom || MAPBOX_MAX_ZOOM_LEVEL), ...(ngDevMode ? [{ debugName: "maxZoomSignal" }] : /* istanbul ignore next */ []));
972
+ zoomStepSignal = computed(() => mapboxZoomLevel(this.props()?.zoomStep || 1), ...(ngDevMode ? [{ debugName: "zoomStepSignal" }] : /* istanbul ignore next */ []));
973
+ fieldValue$ = toObservable(this.fieldValue);
974
+ zoom$ = this.fieldValue$.pipe(filterMaybe(), shareReplay(1));
975
+ center$ = this._center.pipe(filterMaybe());
976
+ _syncing = false;
977
+ _setFieldValue(value) {
978
+ const state = this.field()?.();
979
+ if (state?.value?.set) {
980
+ state.value.set(value);
981
+ state.markAsTouched?.();
982
+ state.markAsDirty?.();
983
+ }
984
+ }
985
+ constructor() {
986
+ setupMetaTracking(this.elementRef, this.meta, { selector: 'input' });
987
+ // Initialize on first props emission
988
+ effect(() => {
989
+ const p = this.props();
990
+ if (!p) {
991
+ return;
992
+ }
993
+ const center = p.center || latLngPoint(this.dbxMapboxService.defaultCenter);
994
+ this._center.next(center);
995
+ this.dbxMapboxMapStore.setZoom(this.zoom$);
996
+ if (p.showMap ?? true) {
997
+ this.dbxMapboxMapStore.setCenter(this.center$);
998
+ }
999
+ if (p?.readonly) {
1000
+ this.numberCtrl.disable();
1001
+ if (p.showMap ?? true) {
1002
+ this.dbxMapboxMapStore.setZoomDisabled();
1003
+ }
1004
+ }
1005
+ else if (p.lockMapToZoomLevels) {
1006
+ const min = mapboxZoomLevel(p.minZoom || MAPBOX_MIN_ZOOM_LEVEL);
1007
+ const max = mapboxZoomLevel(p.maxZoom || MAPBOX_MAX_ZOOM_LEVEL);
1008
+ this.dbxMapboxMapStore.setZoomRange({ min, max });
1009
+ this._undoZoomLimit = !(p.showMap ?? true);
1010
+ }
1011
+ this._sub.subscription = this.dbxMapboxMapStore.zoom$.subscribe((zoom) => {
1012
+ if (!this.isReadonlyOrDisabledSignal()) {
1013
+ this.setZoomValue(zoom);
1014
+ }
1015
+ });
1016
+ });
1017
+ // Sync field value → number control (inbound)
1018
+ effect(() => {
1019
+ const value = this.fieldValue();
1020
+ if (!this._syncing) {
1021
+ this._syncing = true;
1022
+ this.numberCtrl.setValue(value ?? null, { emitEvent: false });
1023
+ this._syncing = false;
1024
+ }
1025
+ });
1026
+ // Sync number control → field value (outbound)
1027
+ this.numberCtrl.valueChanges.subscribe((numValue) => {
1028
+ if (!this._syncing) {
1029
+ this._syncing = true;
1030
+ this._setFieldValue(numValue ?? null);
1031
+ this._syncing = false;
1032
+ }
1033
+ });
1034
+ }
1035
+ ngOnDestroy() {
1036
+ this._center.complete();
1037
+ this._sub.destroy();
1038
+ if (!this._undoZoomLimit) {
1039
+ this.dbxMapboxMapStore.setZoomRange({});
1040
+ }
1041
+ }
1042
+ setZoomValue(zoom) {
1043
+ this._syncing = true;
1044
+ this.numberCtrl.setValue(zoom ?? null, { emitEvent: false });
1045
+ this._setFieldValue(zoom ?? null);
1046
+ this._syncing = false;
1047
+ }
1048
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxForgeMapboxZoomFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1049
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: DbxForgeMapboxZoomFieldComponent, isStandalone: true, selector: "dbx-forge-mapbox-zoom-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: false, transformFunction: null }, validationMessages: { classPropertyName: "validationMessages", publicName: "validationMessages", isSignal: true, isRequired: false, transformFunction: null }, defaultValidationMessages: { classPropertyName: "defaultValidationMessages", publicName: "defaultValidationMessages", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideMapboxStoreIfParentIsUnavailable()], ngImport: i0, template: `
1050
+ <div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()">
1051
+ @if (showMapSignal()) {
1052
+ <div class="dbx-mapbox-input-field-map">
1053
+ <mgl-map dbxMapboxMap></mgl-map>
1054
+ </div>
1055
+ }
1056
+ <div class="dbx-mapbox-input-field-input">
1057
+ <mat-form-field class="dbx-mapbox-input-field-input-field">
1058
+ <mat-label>Zoom Level</mat-label>
1059
+ <input type="number" matInput [min]="minZoomSignal()" [max]="maxZoomSignal()" [step]="zoomStepSignal()" [placeholder]="placeholderText" [formControl]="numberCtrl" />
1060
+ </mat-form-field>
1061
+ </div>
1062
+ </div>
1063
+ `, 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: 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.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.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: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], 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 });
1064
+ }
1065
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxForgeMapboxZoomFieldComponent, decorators: [{
1066
+ type: Component,
1067
+ args: [{ selector: 'dbx-forge-mapbox-zoom-field', template: `
1068
+ <div class="dbx-mapbox-input-field" [ngClass]="compactClassSignal()">
1069
+ @if (showMapSignal()) {
1070
+ <div class="dbx-mapbox-input-field-map">
1071
+ <mgl-map dbxMapboxMap></mgl-map>
1072
+ </div>
1073
+ }
1074
+ <div class="dbx-mapbox-input-field-input">
1075
+ <mat-form-field class="dbx-mapbox-input-field-input-field">
1076
+ <mat-label>Zoom Level</mat-label>
1077
+ <input type="number" matInput [min]="minZoomSignal()" [max]="maxZoomSignal()" [step]="zoomStepSignal()" [placeholder]="placeholderText" [formControl]="numberCtrl" />
1078
+ </mat-form-field>
1079
+ </div>
1080
+ </div>
1081
+ `, providers: [provideMapboxStoreIfParentIsUnavailable()], imports: [NgClass, DbxMapboxModule, 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"] }]
1082
+ }], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
1083
+ /**
1084
+ * Custom mapper for the forge mapbox zoom field.
1085
+ *
1086
+ * @param fieldDef - Field definition configuration
1087
+ * @param fieldDef.key - Form model key for the field
1088
+ * @returns Signal containing a Record of input names to values for ngComponentOutlet
1089
+ */
1090
+ function mapboxZoomFieldMapper(fieldDef) {
1091
+ const ctx = resolveValueFieldContext();
1092
+ const defaultProps = inject(DEFAULT_PROPS);
1093
+ const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);
1094
+ return computed(() => {
1095
+ return buildValueFieldInputs(fieldDef, ctx, defaultProps?.(), defaultValidationMessages?.());
1096
+ });
1097
+ }
1098
+
1099
+ var zoom_forge_field_component = /*#__PURE__*/Object.freeze({
1100
+ __proto__: null,
1101
+ DbxForgeMapboxZoomFieldComponent: DbxForgeMapboxZoomFieldComponent,
1102
+ mapboxZoomFieldMapper: mapboxZoomFieldMapper
1103
+ });
1104
+
1105
+ /**
1106
+ * @deprecated Use provideDbxForgeMapboxFieldDeclarations() instead.
1107
+ */
532
1108
  class DbxFormMapboxModule {
533
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
534
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxModule, exports: [DbxFormMapboxLatLngModule, DbxFormMapboxZoomModule] });
535
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxModule, imports: [DbxFormMapboxLatLngModule, DbxFormMapboxZoomModule] });
1109
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1110
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxModule, exports: [DbxFormMapboxLatLngModule, DbxFormMapboxZoomModule] });
1111
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxModule, imports: [DbxFormMapboxLatLngModule, DbxFormMapboxZoomModule] });
536
1112
  }
537
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DbxFormMapboxModule, decorators: [{
1113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DbxFormMapboxModule, decorators: [{
538
1114
  type: NgModule,
539
1115
  args: [{
540
1116
  exports: [DbxFormMapboxLatLngModule, DbxFormMapboxZoomModule]
541
1117
  }]
542
1118
  }] });
543
1119
 
1120
+ /**
1121
+ * Forge mapbox lat/lng field type definition.
1122
+ */
1123
+ const DbxForgeMapboxLatLngFieldType = {
1124
+ name: FORGE_MAPBOX_LATLNG_FIELD_TYPE,
1125
+ loadComponent: () => Promise.resolve().then(function () { return latlng_forge_field_component; }).then((m) => m.DbxForgeMapboxLatLngFieldComponent),
1126
+ mapper: mapboxLatLngFieldMapper
1127
+ };
1128
+ /**
1129
+ * Forge mapbox zoom field type definition.
1130
+ */
1131
+ const DbxForgeMapboxZoomFieldType = {
1132
+ name: FORGE_MAPBOX_ZOOM_FIELD_TYPE,
1133
+ loadComponent: () => Promise.resolve().then(function () { return zoom_forge_field_component; }).then((m) => m.DbxForgeMapboxZoomFieldComponent),
1134
+ mapper: mapboxZoomFieldMapper
1135
+ };
1136
+ /**
1137
+ * All custom dbx-form/mapbox forge field type definitions.
1138
+ */
1139
+ const DBX_FORGE_MAPBOX_FIELD_TYPES = [DbxForgeMapboxLatLngFieldType, DbxForgeMapboxZoomFieldType];
1140
+ /**
1141
+ * Registers ng-forge dynamic form field declarations for the mapbox package.
1142
+ *
1143
+ * Add this to your app's providers alongside provideDbxForgeFormFieldDeclarations().
1144
+ *
1145
+ * @returns An array of providers that register the mapbox forge field types with ng-forge
1146
+ */
1147
+ function provideDbxForgeMapboxFieldDeclarations() {
1148
+ return provideDynamicForm(...DBX_FORGE_MAPBOX_FIELD_TYPES);
1149
+ }
1150
+
544
1151
  /**
545
1152
  * Generated bundle index. Do not edit.
546
1153
  */
547
1154
 
548
- 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 };
1155
+ export { DBX_FORGE_MAPBOX_FIELD_TYPES, DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY, DEFAULT_DBX_FORGE_MAPBOX_LAT_LNG_MARKER_CONFIG, DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_FIELD_INJECTION_KEY, DEFAULT_DBX_FORM_MAPBOX_LAT_LNG_MARKER_CONFIG, DbxForgeMapboxLatLngFieldComponent, DbxForgeMapboxLatLngFieldMarkerComponent, DbxForgeMapboxZoomFieldComponent, DbxFormMapboxLatLngFieldComponent, DbxFormMapboxLatLngFieldMarkerComponent, DbxFormMapboxLatLngModule, DbxFormMapboxModule, DbxFormMapboxZoomFieldComponent, DbxFormMapboxZoomModule, FORGE_MAPBOX_LATLNG_FIELD_TYPE, FORGE_MAPBOX_ZOOM_FIELD_TYPE, dbxForgeMapboxLatLngField, dbxForgeMapboxZoomField, mapboxLatLngField, mapboxLatLngFieldMapper, mapboxZoomField, mapboxZoomFieldMapper, provideDbxForgeMapboxFieldDeclarations };
549
1156
  //# sourceMappingURL=dereekb-dbx-form-mapbox.mjs.map