@theseam/ui-common 0.3.1 → 0.3.4

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 (100) hide show
  1. package/bundles/theseam-ui-common-dynamic.umd.js +1 -0
  2. package/bundles/theseam-ui-common-dynamic.umd.js.map +1 -1
  3. package/bundles/theseam-ui-common-form-field.umd.js +1 -1
  4. package/bundles/theseam-ui-common-form-field.umd.js.map +1 -1
  5. package/bundles/theseam-ui-common-google-maps.umd.js +2202 -0
  6. package/bundles/theseam-ui-common-google-maps.umd.js.map +1 -0
  7. package/bundles/theseam-ui-common-menu.umd.js +1 -0
  8. package/bundles/theseam-ui-common-menu.umd.js.map +1 -1
  9. package/bundles/theseam-ui-common-modal.umd.js +21 -1
  10. package/bundles/theseam-ui-common-modal.umd.js.map +1 -1
  11. package/bundles/theseam-ui-common-utils.umd.js +610 -136
  12. package/bundles/theseam-ui-common-utils.umd.js.map +1 -1
  13. package/bundles/theseam-ui-common-widget.umd.js +3 -1
  14. package/bundles/theseam-ui-common-widget.umd.js.map +1 -1
  15. package/esm2015/dynamic/evaluators/jexl-evaluator/jexl-evaluator.js +2 -1
  16. package/esm2015/form-field/input.directive.js +2 -2
  17. package/esm2015/google-maps/google-maps/google-maps.component.js +261 -0
  18. package/esm2015/google-maps/google-maps-contextmenu.js +113 -0
  19. package/esm2015/google-maps/google-maps-controls.service.js +70 -0
  20. package/esm2015/google-maps/google-maps-feature-helpers.js +177 -0
  21. package/esm2015/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.component.js +195 -0
  22. package/esm2015/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.directive.js +163 -0
  23. package/esm2015/google-maps/google-maps-recenter-button-control/google-maps-recenter-button-control.component.js +57 -0
  24. package/esm2015/google-maps/google-maps-upload-button-control/google-maps-upload-button-control.component.js +119 -0
  25. package/esm2015/google-maps/google-maps.module.js +45 -0
  26. package/esm2015/google-maps/google-maps.service.js +344 -0
  27. package/esm2015/google-maps/map-control.component.js +65 -0
  28. package/esm2015/google-maps/map-controls-service.js +4 -0
  29. package/esm2015/google-maps/map-file-drop/map-file-drop.component.js +135 -0
  30. package/esm2015/google-maps/map-value-manager.service.js +46 -0
  31. package/esm2015/google-maps/public-api.js +14 -0
  32. package/esm2015/google-maps/theseam-ui-common-google-maps.js +6 -0
  33. package/esm2015/menu/menu-toggle.directive.js +2 -1
  34. package/esm2015/modal/modal-ref.js +22 -2
  35. package/esm2015/utils/geo-json/coerce-feature-collection.js +44 -0
  36. package/esm2015/utils/geo-json/geo-json-to-area.js +11 -0
  37. package/esm2015/utils/geo-json/is-feature-collection.validator.js +21 -0
  38. package/esm2015/utils/geo-json/is-only-geometry-types.js +23 -0
  39. package/esm2015/utils/geo-json/is-only-geometry-types.validator.js +32 -0
  40. package/esm2015/utils/geo-json/merge-polygons.js +35 -0
  41. package/esm2015/utils/geo-json/no-inner-rings.validator.js +63 -0
  42. package/esm2015/utils/geo-json/no-kinks.validator.js +39 -0
  43. package/esm2015/utils/geo-json/read-geo-file.js +99 -0
  44. package/esm2015/utils/geo-json/split-multi-polygons.js +29 -0
  45. package/esm2015/utils/is-null-or-undefined.js +1 -1
  46. package/esm2015/utils/public-api.js +11 -1
  47. package/esm2015/widget/widget-content-components/widget-tile/widget-tile.component.js +4 -2
  48. package/fesm2015/theseam-ui-common-dynamic.js +1 -0
  49. package/fesm2015/theseam-ui-common-dynamic.js.map +1 -1
  50. package/fesm2015/theseam-ui-common-form-field.js +1 -1
  51. package/fesm2015/theseam-ui-common-form-field.js.map +1 -1
  52. package/fesm2015/theseam-ui-common-google-maps.js +1729 -0
  53. package/fesm2015/theseam-ui-common-google-maps.js.map +1 -0
  54. package/fesm2015/theseam-ui-common-menu.js +1 -0
  55. package/fesm2015/theseam-ui-common-menu.js.map +1 -1
  56. package/fesm2015/theseam-ui-common-modal.js +21 -1
  57. package/fesm2015/theseam-ui-common-modal.js.map +1 -1
  58. package/fesm2015/theseam-ui-common-utils.js +477 -94
  59. package/fesm2015/theseam-ui-common-utils.js.map +1 -1
  60. package/fesm2015/theseam-ui-common-widget.js +3 -1
  61. package/fesm2015/theseam-ui-common-widget.js.map +1 -1
  62. package/form-field/theseam-ui-common-form-field.metadata.json +1 -1
  63. package/google-maps/google-maps/google-maps.component.d.ts +89 -0
  64. package/google-maps/google-maps-contextmenu.d.ts +15 -0
  65. package/google-maps/google-maps-controls.service.d.ts +23 -0
  66. package/google-maps/google-maps-feature-helpers.d.ts +37 -0
  67. package/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.component.d.ts +104 -0
  68. package/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.directive.d.ts +80 -0
  69. package/google-maps/google-maps-recenter-button-control/google-maps-recenter-button-control.component.d.ts +21 -0
  70. package/google-maps/google-maps-upload-button-control/google-maps-upload-button-control.component.d.ts +34 -0
  71. package/google-maps/google-maps.module.d.ts +2 -0
  72. package/google-maps/google-maps.service.d.ts +53 -0
  73. package/google-maps/map-control.component.d.ts +20 -0
  74. package/google-maps/map-controls-service.d.ts +13 -0
  75. package/google-maps/map-file-drop/map-file-drop.component.d.ts +34 -0
  76. package/google-maps/map-value-manager.service.d.ts +18 -0
  77. package/google-maps/package.json +11 -0
  78. package/google-maps/public-api.d.ts +13 -0
  79. package/google-maps/theseam-ui-common-google-maps.d.ts +5 -0
  80. package/google-maps/theseam-ui-common-google-maps.metadata.json +1 -0
  81. package/modal/modal-ref.d.ts +1 -0
  82. package/modal/theseam-ui-common-modal.metadata.json +1 -1
  83. package/package.json +17 -10
  84. package/utils/geo-json/coerce-feature-collection.d.ts +2 -0
  85. package/utils/geo-json/geo-json-to-area.d.ts +6 -0
  86. package/utils/geo-json/is-feature-collection.validator.d.ts +3 -0
  87. package/utils/geo-json/is-only-geometry-types.d.ts +5 -0
  88. package/utils/geo-json/is-only-geometry-types.validator.d.ts +4 -0
  89. package/utils/geo-json/merge-polygons.d.ts +9 -0
  90. package/utils/geo-json/no-inner-rings.validator.d.ts +10 -0
  91. package/utils/geo-json/no-kinks.validator.d.ts +3 -0
  92. package/utils/geo-json/read-geo-file.d.ts +7 -0
  93. package/utils/geo-json/split-multi-polygons.d.ts +8 -0
  94. package/utils/is-null-or-undefined.d.ts +1 -1
  95. package/utils/public-api.d.ts +10 -0
  96. package/utils/theseam-ui-common-utils.metadata.json +1 -1
  97. package/widget/styles/_variables.scss +1 -0
  98. package/widget/theseam-ui-common-widget.metadata.json +1 -1
  99. package/widget/widget-content-components/widget-tile/widget-tile.component.d.ts +2 -0
  100. package/widget/widget-content-components/widget-tile/widget-tile.component.scss +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theseam-ui-common-google-maps.js","sources":["../../../projects/ui-common/google-maps/google-maps-feature-helpers.ts","../../../projects/ui-common/google-maps/google-maps-contextmenu.ts","../../../projects/ui-common/google-maps/map-value-manager.service.ts","../../../projects/ui-common/google-maps/google-maps.service.ts","../../../projects/ui-common/google-maps/map-controls-service.ts","../../../projects/ui-common/google-maps/google-maps-controls.service.ts","../../../projects/ui-common/google-maps/google-maps-recenter-button-control/google-maps-recenter-button-control.component.ts","../../../projects/ui-common/google-maps/google-maps-upload-button-control/google-maps-upload-button-control.component.ts","../../../projects/ui-common/google-maps/google-maps/google-maps.component.ts","../../../projects/ui-common/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.directive.ts","../../../projects/ui-common/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.component.ts","../../../projects/ui-common/google-maps/map-control.component.ts","../../../projects/ui-common/google-maps/map-file-drop/map-file-drop.component.ts","../../../projects/ui-common/google-maps/google-maps.module.ts","../../../projects/ui-common/google-maps/theseam-ui-common-google-maps.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { NgZone } from '@angular/core'\nimport { Observable } from 'rxjs'\n\nimport { notNullOrUndefined } from '@theseam/ui-common/utils'\nimport booleanContains from '@turf/boolean-contains'\nimport {\n multiPolygon as turfjsMultiPolygon,\n polygon as turfjsPolygon,\n} from '@turf/helpers'\n\nexport enum AppFeaturePropertyName {\n IsSelected = `__app__isSelected`\n}\n\nexport function isAppFeatureProperty(propertyName: string): propertyName is AppFeaturePropertyName {\n return Object.values(AppFeaturePropertyName)\n .findIndex(value => value === propertyName) !== -1\n}\n\nexport function isFeatureSelected(feature: google.maps.Data.Feature): boolean {\n const isSelected = feature.getProperty(AppFeaturePropertyName.IsSelected)\n return coerceBooleanProperty(isSelected)\n}\n\nexport function setFeatureSelected(feature: google.maps.Data.Feature, isSelected: boolean): void {\n feature.setProperty(AppFeaturePropertyName.IsSelected, isSelected)\n}\n\n// TODO: Check performance of cloning a google.maps.Data instance, so the\n// properties can be removed with the google maps api, instead of on the\n// resulting json.\nexport function stripAppFeaturePropertiesFromJson(json: any) {\n if (notNullOrUndefined(json) && Array.isArray(json?.features)) {\n for (const feature of json.features) {\n if (notNullOrUndefined(feature?.properties)) {\n for (const k of Object.keys(feature.properties)) {\n if (isAppFeatureProperty(k)) {\n feature.properties[k] = undefined\n delete feature.properties[k]\n }\n }\n }\n }\n }\n}\n\n/**\n * Searches for a Feature in Data that contains the provided Feature and can use\n * it as a cutout area.\n */\nexport function getPossibleExteriorFeature(\n data: google.maps.Data,\n feature: google.maps.Data.Feature\n): google.maps.Data.Feature | undefined {\n let exteriorPolygonFeature: google.maps.Data.Feature | undefined\n data.forEach(f => {\n if (f !== feature && (f.getGeometry().getType() === 'Polygon' && featureContains(f, feature))) {\n exteriorPolygonFeature = f\n }\n })\n return exteriorPolygonFeature\n}\n\nexport function addInnerFeatureCutoutToExteriorFeature(\n exteriorFeature: google.maps.Data.Feature,\n innerFeature: google.maps.Data.Feature\n): void {\n // NOTE: Other geometries may support cutouts, but our map shapes editor only\n // supports polygons currently, so we will need to handle other geometry types\n // here if we start allowing users to draw shapes other than polygon.\n if (exteriorFeature.getGeometry().getType() !== 'Polygon' || innerFeature.getGeometry().getType() !== 'Polygon') {\n throw Error(`Inner cutout is only supported by Polygon gemoetry.`)\n }\n\n const featurePolygon = innerFeature.getGeometry() as google.maps.Data.Polygon\n const exteriorPolygon = exteriorFeature.getGeometry() as google.maps.Data.Polygon\n exteriorFeature.setGeometry(new google.maps.Data.Polygon([\n ...exteriorPolygon.getArray(),\n featurePolygon.getAt(0).getArray().reverse()\n ]))\n}\n\n/**\n * Google maps paths don't always start and stop at the exact same position, so\n * this will fix that for turfjs.\n */\nexport function fixPathDifferentStartingAndEndingPoint(coordinates: number[][]): void {\n if (coordinates.length <= 1) {\n return\n }\n\n const start = coordinates[0]\n const end = coordinates[coordinates.length - 1]\n if (start[0] === end[0] && start[1] === end[1]) {\n return\n }\n\n coordinates.push(coordinates[0])\n}\n\nexport function polygonCoordinates(polygon: google.maps.Data.Polygon): number[][][] {\n return polygon.getArray().map(linRing => {\n const coords = linRing.getArray().map(x => [ x.lng(), x.lat() ])\n fixPathDifferentStartingAndEndingPoint(coords)\n return coords\n })\n}\n\nexport function multiPolygonCoordinates(multiPolygon: google.maps.Data.MultiPolygon): number[][][][] {\n return multiPolygon.getArray().map(x => polygonCoordinates(x))\n}\n\nexport function toTurfJsPolygon(polygon: google.maps.Data.Polygon) {\n return turfjsPolygon(polygonCoordinates(polygon))\n}\n\nexport function toTurfJsMultiPolygon(multiPolygon: google.maps.Data.MultiPolygon) {\n return turfjsMultiPolygon(multiPolygonCoordinates(multiPolygon))\n}\n\nexport function toTurfJsFeature(googleFeature: google.maps.Data.Feature) {\n if (googleFeature.getGeometry().getType() === 'Polygon') {\n return toTurfJsPolygon(googleFeature.getGeometry() as google.maps.Data.Polygon)\n } else if (googleFeature.getGeometry().getType() === 'MultiPolygon') {\n return toTurfJsMultiPolygon(googleFeature.getGeometry() as google.maps.Data.MultiPolygon)\n }\n\n throw Error(`Unexpected geometry.`)\n}\n\nexport function featureContains(featureA: google.maps.Data.Feature, featureB: google.maps.Data.Feature): boolean {\n const polygonA = toTurfJsFeature(featureA)\n const polygonB = toTurfJsFeature(featureB)\n return booleanContains(polygonA, polygonB)\n}\n\nexport function createDataFeatureFromPolygon(polygon: google.maps.Polygon): google.maps.Data.Feature {\n const arr = polygon.getPath().getArray()\n return new google.maps.Data.Feature({\n geometry: new google.maps.Data.Polygon([ arr ])\n })\n}\n\nexport function getBoundsWithAllFeatures(data: google.maps.Data): google.maps.LatLngBounds {\n const bounds = new google.maps.LatLngBounds()\n\n data.forEach(feature => {\n const geometry = feature.getGeometry()\n geometry.forEachLatLng(latLng => {\n bounds.extend(latLng)\n })\n })\n\n return bounds\n}\n\nexport function getFeatureBounds(feature: google.maps.Data.Feature): google.maps.LatLngBounds {\n const bounds = new google.maps.LatLngBounds()\n\n const geometry = feature.getGeometry()\n geometry.forEachLatLng(latLng => {\n bounds.extend(latLng)\n })\n\n return bounds\n}\n\nexport function getFeatureCenter(feature: google.maps.Data.Feature): google.maps.LatLng {\n return getFeatureBounds(feature).getCenter()\n}\n\nexport function removeAllFeatures(data: google.maps.Data): void {\n data.forEach(f => data.remove(f))\n}\n\nexport function getFeaturesCount(data: google.maps.Data): number {\n let count = 0\n data.forEach(() => count++)\n return count\n}\n\n/**\n * NOTE: Original events are not emitted, because filtering may omit events.\n */\nexport function createFeatureChangeObservable(data: google.maps.Data, ngZone: NgZone): Observable<void> {\n return new Observable<void>(subscriber => {\n const listeners: google.maps.MapsEventListener[] = []\n\n ngZone.runOutsideAngular(() => {\n listeners.push(data.addListener('setgeometry', (event: google.maps.Data.SetGeometryEvent) => {\n ngZone.run(() => { subscriber.next(undefined) })\n }))\n\n listeners.push(data.addListener('addfeature', (event: google.maps.Data.AddFeatureEvent) => {\n ngZone.run(() => { subscriber.next(undefined) })\n }))\n\n listeners.push(data.addListener('removefeature', (event: google.maps.Data.RemoveFeatureEvent) => {\n ngZone.run(() => { subscriber.next(undefined) })\n }))\n\n listeners.push(data.addListener('setproperty', (event: google.maps.Data.SetPropertyEvent) => {\n if (!isAppFeatureProperty(event.name)) {\n ngZone.run(() => { subscriber.next(undefined) })\n }\n }))\n\n listeners.push(data.addListener('removeproperty', (event: google.maps.Data.RemovePropertyEvent) => {\n if (!isAppFeatureProperty(event.name)) {\n ngZone.run(() => { subscriber.next(undefined) })\n }\n }))\n })\n\n return () => {\n listeners.forEach(google.maps.event.removeListener)\n }\n })\n}\n","import { ESCAPE } from '@angular/cdk/keycodes'\nimport { NgZone, ViewContainerRef } from '@angular/core'\nimport { fromEvent, Subject } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\n\nimport { MenuComponent } from '@theseam/ui-common/menu'\n\nimport { isFeatureSelected } from './google-maps-feature-helpers'\n\n// TODO: Close on map losing focus.\n\nexport class GoogleMapsContextMenu {\n\n private readonly _overlayView: google.maps.OverlayView\n private readonly _cleanupFn: () => void\n\n constructor(\n private readonly _map: google.maps.Map,\n private readonly _menu: MenuComponent,\n _position: google.maps.LatLng,\n private readonly _vcr: ViewContainerRef,\n private readonly _ngZone: NgZone,\n private readonly _data: google.maps.Data,\n private readonly _feature: google.maps.Data.Feature,\n ) {\n const tplRef = this._menu.templateRef\n if (tplRef === undefined || tplRef === null) {\n throw Error(`Menu template is not defined.`)\n }\n\n const ref = this._vcr.createEmbeddedView(tplRef)\n ref.detectChanges()\n\n const listeners: google.maps.MapsEventListener[] = []\n const ngUnsubscribe = new Subject<void>()\n\n // TODO: Fix the initial focus. setTimeout avoids the wrong contextmenu\n // getting triggered, but the first item flashes and looks off this way.\n setTimeout(() => {\n this._menu.focusFirstItem('program')\n })\n this._menu.closed.pipe(\n takeUntil(ngUnsubscribe)\n ).subscribe(v => {\n this.close()\n })\n\n fromEvent(document, 'keydown').pipe(\n takeUntil(ngUnsubscribe)\n ).subscribe((event: any) => {\n if (event.keyCode === ESCAPE) {\n this.close()\n }\n })\n\n const __cleanup = () => this._cleanupFn()\n class GoogleMapsContextMenuOverlayView extends google.maps.OverlayView {\n public containerDiv: HTMLDivElement\n\n constructor(\n public position: google.maps.LatLng,\n content: HTMLElement\n ) {\n super()\n this.position = position\n\n this.containerDiv = document.createElement('div')\n this.containerDiv.style.cursor = 'auto'\n this.containerDiv.style.height = '0',\n this.containerDiv.style.position = 'absolute'\n this.containerDiv.appendChild(content)\n\n // Optionally stop clicks, etc., from bubbling up to the map.\n GoogleMapsContextMenuOverlayView.preventMapHitsAndGesturesFrom(this.containerDiv)\n }\n\n /** Called when the view is added to the map. */\n onAdd() {\n // tslint:disable-next-line: no-non-null-assertion\n this.getPanes()!.floatPane.appendChild(this.containerDiv)\n }\n\n /** Called when the view is removed from the map. */\n onRemove() {\n if (this.containerDiv.parentElement) {\n this.containerDiv.parentElement.removeChild(this.containerDiv)\n }\n __cleanup()\n }\n\n /** Called each frame when the view needs to draw itself. */\n draw() {\n // tslint:disable-next-line: no-non-null-assertion\n const divPosition = this.getProjection().fromLatLngToDivPixel(this.position)!\n\n // Hide the popup when it is far out of view.\n const display =\n Math.abs(divPosition.x) < 4000 && Math.abs(divPosition.y) < 4000\n ? 'block'\n : 'none'\n\n if (display === 'block') {\n this.containerDiv.style.left = divPosition.x + 'px'\n this.containerDiv.style.top = divPosition.y + 'px'\n }\n\n if (this.containerDiv.style.display !== display) {\n this.containerDiv.style.display = display\n }\n }\n }\n\n this._overlayView = new GoogleMapsContextMenuOverlayView(_position, ref.rootNodes[0])\n this._overlayView.setMap(this._map)\n\n this._ngZone.runOutsideAngular(() => {\n listeners.push(this._data.addListener('removefeature', (event: google.maps.Data.RemoveFeatureEvent) => {\n if (event.feature === this._feature) {\n this._ngZone.run(() => { this.close() })\n }\n }))\n\n listeners.push(this._data.addListener('setproperty', (event: google.maps.Data.SetPropertyEvent) => {\n if (event.feature === this._feature && !isFeatureSelected(this._feature)) {\n this._ngZone.run(() => { this.close() })\n }\n }))\n\n listeners.push(this._data.addListener('removeproperty', (event: google.maps.Data.RemovePropertyEvent) => {\n if (event.feature === this._feature && !isFeatureSelected(this._feature)) {\n this._ngZone.run(() => { this.close() })\n }\n }))\n\n listeners.push(this._map.addListener('click', (event: google.maps.MapMouseEvent | google.maps.IconMouseEvent) => {\n this._ngZone.run(() => { this.close() })\n }))\n\n listeners.push(this._data.addListener('click', (event: google.maps.Data.MouseEvent) => {\n this._ngZone.run(() => { this.close() })\n }))\n })\n\n this._cleanupFn = () => {\n ngUnsubscribe.next()\n ngUnsubscribe.complete()\n listeners.forEach(google.maps.event.removeListener)\n }\n }\n\n public close(): void {\n this._overlayView.setMap(null)\n }\n\n}\n","import { Injectable } from '@angular/core'\nimport { Observable, Subject } from 'rxjs'\n\nexport enum MapValueSource {\n Input = 'input',\n FeatureChange = 'featurechange'\n}\n\nexport type MapValue = object | undefined | null\n\nexport interface MapValueChange {\n value: MapValue\n source: MapValueSource\n}\n\n@Injectable()\nexport class MapValueManagerService {\n\n private readonly _valueChangedSubject = new Subject<MapValueChange>()\n\n private _value: MapValue\n\n public readonly valueChanged: Observable<MapValueChange>\n\n constructor() {\n this.valueChanged = this._valueChangedSubject.asObservable()\n }\n\n public setValue(value: MapValue, source: MapValueSource): boolean {\n if (value === this._value) {\n return false\n }\n\n if (value === null || value === undefined) {\n this._value = value\n const _change: MapValueChange = {\n source,\n value: this._value,\n }\n this._valueChangedSubject.next(_change)\n return true\n }\n\n if (JSON.stringify(value) === JSON.stringify(this._value)) {\n return true\n }\n\n // TODO: Validate object is valid geojson.\n this._value = value\n const change: MapValueChange = {\n source,\n value: this._value,\n }\n this._valueChangedSubject.next(change)\n return true\n }\n\n public get value(): MapValue {\n return this._value\n }\n\n}\n","import { Injectable, NgZone, OnDestroy, ViewContainerRef } from '@angular/core'\nimport { BehaviorSubject, from, Observable, Subject } from 'rxjs'\nimport { switchMap, takeUntil, tap } from 'rxjs/operators'\n\nimport { MenuComponent } from '@theseam/ui-common/menu'\nimport { isNullOrUndefined, notNullOrUndefined } from '@theseam/ui-common/utils'\n\nimport { GoogleMapsContextMenu } from './google-maps-contextmenu'\nimport {\n addInnerFeatureCutoutToExteriorFeature,\n createDataFeatureFromPolygon,\n createFeatureChangeObservable,\n getBoundsWithAllFeatures,\n getFeatureCenter,\n getFeaturesCount,\n getPossibleExteriorFeature,\n isFeatureSelected,\n removeAllFeatures,\n setFeatureSelected,\n stripAppFeaturePropertiesFromJson,\n} from './google-maps-feature-helpers'\nimport { MapValueManagerService, MapValueSource } from './map-value-manager.service'\n\ndeclare const ngDevMode: boolean | undefined\n\nconst DEFAULT_POLYGON_OPTIONS: google.maps.PolygonOptions = {\n clickable: true,\n draggable: true,\n editable: true,\n // fillColor: 'rgba(60,150,60,1)',\n // strokeColor: 'rgba(155,255,0,1)'\n}\n\nconst DEFAULT_DRAWING_MANAGER_OPTIONS: (() => google.maps.drawing.DrawingManagerOptions) = () => ({\n drawingControl: true,\n drawingControlOptions: {\n drawingModes: [\n google.maps.drawing.OverlayType.POLYGON\n ]\n },\n polygonOptions: DEFAULT_POLYGON_OPTIONS,\n drawingMode: null\n})\n\nconst FEATURE_STYLE_OPTIONS_DEFAULT: google.maps.Data.StyleOptions = {\n clickable: true,\n visible: true,\n // zIndex?: number;\n\n // cursor?: string;\n draggable: false,\n editable: false,\n fillColor: 'teal',\n fillOpacity: 0.3,\n strokeColor: 'blue',\n strokeOpacity: 1,\n strokeWeight: 2,\n}\n\nconst FEATURE_STYLE_OPTIONS_SELECTED: google.maps.Data.StyleOptions = {\n ...FEATURE_STYLE_OPTIONS_DEFAULT,\n draggable: true,\n editable: true,\n fillColor: 'green',\n fillOpacity: 0.7,\n strokeColor: 'limegreen',\n strokeOpacity: 1,\n strokeWeight: 2,\n}\n\ntype WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\n\n@Injectable()\nexport class GoogleMapsService implements OnDestroy {\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private readonly _mapReadySubject = new BehaviorSubject<boolean>(false)\n\n private _drawingManager?: google.maps.drawing.DrawingManager\n private _featureContextMenu: MenuComponent | null = null\n private _activeContextMenu: GoogleMapsContextMenu | null = null\n private _baseLatLng?: google.maps.LatLngLiteral\n\n private _allowDrawingHoleInPolygon: boolean = false\n\n // TODO: Move to a better place than the map wrapper service.\n private _fileInputHandler: ((file: File) => void) | undefined | null\n\n public googleMap?: google.maps.Map\n\n public readonly mapReady$: Observable<boolean>\n\n public get mapReady(): boolean { return this._mapReadySubject.value }\n\n constructor(\n private readonly _mapValueManager: MapValueManagerService,\n private readonly _ngZone: NgZone,\n private readonly _vcr: ViewContainerRef,\n ) {\n this.mapReady$ = this._mapReadySubject.asObservable()\n }\n\n ngOnDestroy(): void {\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n public setMap(map: google.maps.Map): void {\n this.googleMap = map\n this._mapReadySubject.next(true)\n this._initDrawingManager()\n this._initFeatureStyling()\n this._initFeatureChangeListeners()\n }\n\n public setBaseLatLng(lat: number, lng: number): void {\n this._baseLatLng = { lat, lng }\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public setFeatureContextMenu(menu: MenuComponent | null): void {\n this._featureContextMenu = menu\n }\n\n public getDiv(): HTMLDivElement {\n this._assertInitialized()\n return this.googleMap.getDiv() as HTMLDivElement\n }\n\n public fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void {\n this._assertInitialized()\n this.googleMap.fitBounds(bounds, padding)\n }\n\n /**\n * Iterates the map's features and removes any that are selected.\n */\n public deleteSelection(): void {\n this._assertInitialized()\n const mapData = this.googleMap.data\n mapData.forEach(f => {\n if (isFeatureSelected(f)) {\n mapData.remove(f)\n }\n })\n }\n\n /**\n * Stops the current drawing.\n */\n public stopDrawing(): void {\n this._ngZone.runOutsideAngular(() => {\n if (isNullOrUndefined(this._drawingManager) || this._drawingManager.getDrawingMode() === null) {\n return\n }\n\n // Listening for the completion event of the overlay currently being drawn\n // and removing it. I haven't found a way to cancel the current drawing,\n // without this hack that assumes our listeners will not run into a race\n // condition.\n const listener = google.maps.event.addListener(\n this._drawingManager,\n 'overlaycomplete',\n (event: google.maps.drawing.OverlayCompleteEvent) => {\n event.overlay.setMap(null)\n listener.remove()\n }\n )\n\n // To fake canceling the current drawing, without disabling the drawing\n // mode, the drawin mode is being unset then immediately set back. When\n // the mode is unset the 'overlaycomplete' event will fire, which will\n // give a reference to the current overlay to remove, then it is set back\n // to the mode the user was using. To the user is should just seem like\n // the current drawing was canceled and they can start drawing again.\n const mode = this._drawingManager.getDrawingMode()\n this._drawingManager.setDrawingMode(null)\n this._drawingManager.setDrawingMode(mode)\n\n // 'overlaycomplete' should fire immediately, unless an overlay hadn't\n // started drawing. This timeout will make sure the listener gets removed.\n setTimeout(() => {\n listener.remove()\n })\n\n })\n }\n\n private _initDrawingManager(): void {\n if (notNullOrUndefined(this._drawingManager)) {\n throw Error(`DrawingManager is already initialized.`)\n }\n\n this._assertInitialized()\n\n const options = DEFAULT_DRAWING_MANAGER_OPTIONS()\n\n const drawingManager = new google.maps.drawing.DrawingManager(options)\n drawingManager.setMap(this.googleMap)\n\n this._drawingManager = drawingManager\n\n this._drawingManager.addListener('drawingmode_changed', event => {\n if (this._drawingManager?.getDrawingMode() !== null) {\n this._assertInitialized()\n this.googleMap.data.forEach(f => {\n if (isFeatureSelected(f)) {\n setFeatureSelected(f, false)\n }\n })\n }\n })\n }\n\n public addControl(element: HTMLElement, position: google.maps.ControlPosition): void {\n this._assertInitialized()\n this.googleMap.controls[position].push(element)\n }\n\n public async setData(data: any): Promise<void> {\n this._assertInitialized()\n removeAllFeatures(this.googleMap.data)\n this.googleMap.data.addGeoJson(data)\n this.googleMap.fitBounds(getBoundsWithAllFeatures(this.googleMap.data))\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public reCenterOnFeatures(): void {\n this._assertInitialized()\n if (getFeaturesCount(this.googleMap.data) === 0) {\n if (!this._baseLatLng) {\n return\n }\n\n this.googleMap.panTo(this._baseLatLng)\n return\n }\n this.googleMap.fitBounds(getBoundsWithAllFeatures(this.googleMap.data))\n\n // TODO: Fix to pan to center. Currently fitBounds results in the expected\n // result, but pantToBounds animates.\n // this.googleMap.panToBounds(getBoundsWithAllFeatures(this.googleMap.data))\n }\n\n public allowDrawingHoleInPolygon(allow: boolean): void {\n this._allowDrawingHoleInPolygon = allow\n }\n\n public setFileInputHandler(handler: ((file: File) => void) | undefined | null): void {\n this._fileInputHandler\n }\n\n public getFileInputHandler(): ((file: File) => void) | undefined | null {\n return this._fileInputHandler\n }\n\n private _initFeatureStyling(): void {\n this._assertInitialized()\n\n // Disable any selection when clicking the map.\n //\n // TODO: There may be a better way to do this that would be more accurate or\n // additional events that should be listened to, such as the disabling\n // selection when the map looses focus.\n this.googleMap.addListener('click', (even: google.maps.MapMouseEvent | google.maps.IconMouseEvent) => {\n this._assertInitialized()\n this.googleMap.data.forEach(f => setFeatureSelected(f, false))\n })\n\n // Determine what the style of the features are.\n this.googleMap.data.setStyle((feature) => {\n if (isFeatureSelected(feature)) {\n return FEATURE_STYLE_OPTIONS_SELECTED\n }\n\n return FEATURE_STYLE_OPTIONS_DEFAULT\n })\n\n // Select a feature when clicked.\n this.googleMap.data.addListener('click', (event: google.maps.Data.MouseEvent) => {\n this._assertInitialized()\n\n setFeatureSelected(event.feature, true)\n this.googleMap.data.forEach(f => {\n if (f !== event.feature && isFeatureSelected(f)) {\n setFeatureSelected(f, false)\n }\n })\n })\n\n // Set a style on hovered features that can be selected.\n this.googleMap.data.addListener('mouseover', (event: google.maps.Data.MouseEvent) => {\n this._assertInitialized()\n this.googleMap.data.revertStyle()\n if (!this.isDrawing() && !isFeatureSelected(event.feature)) {\n this.googleMap.data.overrideStyle(event.feature, { strokeWeight: 4 })\n }\n })\n\n // Remove any hover styles when mouse moves away.\n this.googleMap.data.addListener('mouseout', (event: google.maps.Data.MouseEvent) => {\n this._assertInitialized()\n this.googleMap.data.revertStyle()\n })\n }\n\n private _initFeatureChangeListeners(): void {\n this._assertInitialized()\n\n createFeatureChangeObservable(this.googleMap.data, this._ngZone).pipe(\n switchMap(() => from(this.getGeoJson()).pipe(\n tap(geoJson => this._mapValueManager.setValue(geoJson, MapValueSource.FeatureChange)),\n )),\n takeUntil(this._ngUnsubscribe),\n ).subscribe()\n\n this.googleMap.data.addListener('contextmenu', (event: google.maps.Data.MouseEvent) => {\n if (!isFeatureSelected(event.feature)) {\n return\n }\n\n this._openContextMenuForFeature(event.feature, event.latLng)\n })\n\n if (notNullOrUndefined(this._drawingManager)) {\n google.maps.event.addListener(this._drawingManager, 'polygoncomplete', (polygon: google.maps.Polygon) => {\n // The DrawingManager doesn't seem to have a way to access the overlays,\n // so if the map is not set then it shouldn'y be considered a successful\n // completion. I am canceling the active drawing by disabling drawing\n // mode and setting the map null in the 'overlaycomplete' event, which\n // fires before the 'polygoncomplete' event.\n if (isNullOrUndefined(polygon.getMap())) {\n return\n }\n\n this._assertInitialized()\n\n // Create a map feature of the drawn polygon.\n const feature = createDataFeatureFromPolygon(polygon)\n // Remove the drawn polygon.\n polygon.setMap(null)\n\n // Stop drawing.\n this._drawingManager?.setDrawingMode(null)\n\n // Check if the feature should be used as a cutout to an existing\n // feature or added as it's own feature.\n const exteriorPolygonFeature = this._allowDrawingHoleInPolygon\n ? getPossibleExteriorFeature(this.googleMap.data, feature)\n : undefined\n if (exteriorPolygonFeature) {\n addInnerFeatureCutoutToExteriorFeature(exteriorPolygonFeature, feature)\n setFeatureSelected(exteriorPolygonFeature, true)\n } else {\n this.googleMap.data.add(feature)\n setFeatureSelected(feature, true)\n }\n })\n }\n }\n\n public isDrawing(): boolean {\n if (isNullOrUndefined(this._drawingManager)) {\n return true\n }\n\n return this._drawingManager.getDrawingMode() !== null\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public hasSelectedFeature(): boolean {\n this._assertInitialized()\n let isSelected = false\n this.googleMap.data.forEach(f => {\n if (isFeatureSelected(f)) {\n isSelected = true\n }\n })\n return isSelected\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public getSelectedFeature(): google.maps.Data.Feature | null {\n this._assertInitialized()\n let feature: google.maps.Data.Feature | null = null\n this.googleMap.data.forEach(f => {\n if (isFeatureSelected(f)) {\n feature = f\n }\n })\n return feature\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public openContextMenu(): void {\n const feature = this.getSelectedFeature()\n if (feature) {\n this._openContextMenuForFeature(feature)\n }\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n private _openContextMenuForFeature(feature: google.maps.Data.Feature, position?: google.maps.LatLng) {\n if (this._activeContextMenu) {\n this._activeContextMenu.close()\n this._activeContextMenu = null\n }\n\n this._assertInitialized()\n\n let _position = position\n if (!_position) {\n _position = getFeatureCenter(feature)\n }\n if (this._featureContextMenu) {\n this._activeContextMenu = new GoogleMapsContextMenu(\n this.googleMap,\n this._featureContextMenu,\n _position,\n this._vcr,\n this._ngZone,\n this.googleMap.data,\n feature,\n )\n }\n }\n\n public getGeoJson(removeAppProperties: boolean = true): Promise<object> {\n return new Promise((resolve, reject) => {\n this._assertInitialized()\n this.googleMap.data.toGeoJson(f => {\n if (removeAppProperties) {\n stripAppFeaturePropertiesFromJson(f)\n }\n resolve(f)\n })\n })\n }\n\n /** Asserts that the map has been initialized. */\n private _assertInitialized(): asserts this is WithRequired<GoogleMapsService, 'googleMap'> {\n if (!this.googleMap && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(\n 'Cannot access Google Map information before the API has been initialized. ' +\n 'Please wait for the API to load before trying to interact with it.',\n )\n }\n }\n}\n","import { InjectionToken } from '@angular/core'\n\nimport { ComponentType } from '@theseam/ui-common/models'\n\nexport interface MapControl<TData = any> {\n component: ComponentType<any>\n data?: TData\n position?: google.maps.ControlPosition\n}\n\nexport interface MapControlsService {\n add(control: MapControl): void\n}\n\nexport const MAP_CONTROLS_SERVICE = new InjectionToken<MapControlsService>('MAP_CONTROLS_SERVICE')\n\nexport const MAP_CONTROL_DATA = new InjectionToken<any>('MAP_CONTROL_DATA')\n","import { ComponentFactoryResolver, ComponentRef, Injectable, Injector, StaticProvider } from '@angular/core'\nimport { Observable, Subject } from 'rxjs'\n\nimport { GoogleMapsService } from './google-maps.service'\nimport { MapControl, MapControlsService, MAP_CONTROL_DATA } from './map-controls-service'\n\nexport class MapControlRef {\n\n private readonly _destroyedSubject = new Subject<void>()\n\n private _componentRef: ComponentRef<any>\n private _addedAtPosition: google.maps.ControlPosition\n\n public destroyed: Observable<void>\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n private readonly _componentFactoryResolver: ComponentFactoryResolver,\n private readonly _injector: Injector,\n private readonly _controlDef: MapControl\n ) {\n this.destroyed = this._destroyedSubject.asObservable()\n\n const component: any = this._controlDef.component\n const factory = this._componentFactoryResolver.resolveComponentFactory(component)\n\n const providers: StaticProvider[] = []\n if (this._controlDef.data) {\n providers.push({\n provide: MAP_CONTROL_DATA,\n useValue: this._controlDef.data\n })\n }\n const injector = Injector.create({\n providers,\n parent: this._injector,\n })\n\n this._componentRef = factory.create(injector)\n this._componentRef.changeDetectorRef.detectChanges()\n\n const position = this._controlDef.position ?? google.maps.ControlPosition.LEFT_BOTTOM\n\n this._googleMaps.addControl(\n this._componentRef.location.nativeElement,\n position\n )\n\n this._addedAtPosition = position\n }\n\n public destroy() {\n const googleMaps = this._googleMaps.googleMap\n if (googleMaps !== undefined) {\n let idx = -1\n googleMaps.controls[this._addedAtPosition].forEach((elem, index) => {\n if (elem === this._componentRef.location.nativeElement) {\n idx = index\n }\n })\n if (idx === -1) {\n throw Error(`Unable to destroy control. Control not found.`)\n }\n googleMaps.controls[this._addedAtPosition].removeAt(idx)\n }\n this._componentRef.destroy()\n\n this._destroyedSubject.next()\n this._destroyedSubject.complete()\n }\n\n}\n\n@Injectable()\nexport class GoogleMapsControlsService implements MapControlsService {\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n private readonly _componentFactoryResolver: ComponentFactoryResolver,\n private readonly _injector: Injector,\n ) { }\n\n public add(control: MapControl): MapControlRef {\n return new MapControlRef(this._googleMaps, this._componentFactoryResolver, this._injector, control)\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { SeamIcon } from '@theseam/ui-common/icon'\n\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MAP_CONTROL_DATA } from '../map-controls-service'\n\nexport interface GoogleMapsRecenterButtonControlData {\n label?: string | undefined | null\n icon?: SeamIcon | undefined | null\n}\n\n/**\n *\n */\n@Component({\n // tslint:disable-next-line: component-selector\n selector: 'button[seam-google-maps-recenter-button-control]',\n templateUrl: './google-maps-recenter-button-control.component.html',\n styleUrls: ['./google-maps-recenter-button-control.component.scss'],\n host: {\n '[attr.draggable]': 'false',\n '[attr.aria-label]': 'label',\n '[attr.title]': 'label',\n 'type': 'button',\n 'class': 'gmnoprint gm-control-active'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamGoogleMapsRecenterButtonControlComponent implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private _listeners: (() => void)[] = []\n\n @Input() label: string | undefined | null\n\n @Input() icon: SeamIcon | undefined | null\n\n @HostListener('click', [ 'event' ])\n _onClick(event: MouseEvent) {\n this._googleMaps.reCenterOnFeatures()\n }\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n @Optional() @Inject(MAP_CONTROL_DATA) _data?: GoogleMapsRecenterButtonControlData\n ) {\n if (_data) {\n if (_data.hasOwnProperty('label')) {\n this.label = _data.label\n }\n if (_data.hasOwnProperty('icon')) {\n this.icon = _data.icon\n }\n }\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._listeners.forEach(l => l())\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Renderer2,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { SeamIcon } from '@theseam/ui-common/icon'\nimport { readGeoFile } from '@theseam/ui-common/utils'\n\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MAP_CONTROL_DATA } from '../map-controls-service'\nimport { MapValueManagerService, MapValueSource } from '../map-value-manager.service'\n\nexport interface GoogleMapsUploadButtonControlData {\n label?: string | undefined | null\n icon?: SeamIcon | undefined | null\n}\n\n/**\n *\n */\n@Component({\n // tslint:disable-next-line: component-selector\n selector: 'button[seam-google-maps-upload-button-control]',\n templateUrl: './google-maps-upload-button-control.component.html',\n styleUrls: ['./google-maps-upload-button-control.component.scss'],\n host: {\n '[attr.draggable]': 'false',\n '[attr.aria-label]': 'label',\n '[attr.title]': 'label',\n 'type': 'button',\n 'class': 'gmnoprint gm-control-active'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamGoogleMapsUploadButtonControlComponent implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private readonly _fileInputElement: HTMLInputElement\n\n private _listeners: (() => void)[] = []\n\n @Input() label: string | undefined | null\n\n @Input() icon: SeamIcon | undefined | null\n\n @HostListener('click', [ 'event' ])\n _onClick(event: MouseEvent) {\n this._fileInputElement.click()\n }\n\n constructor(\n private readonly _elementRef: ElementRef,\n private readonly _mapValueManager: MapValueManagerService,\n private readonly _renderer: Renderer2,\n private readonly _googleMaps: GoogleMapsService,\n @Optional() @Inject(MAP_CONTROL_DATA) _data?: GoogleMapsUploadButtonControlData\n ) {\n if (_data) {\n if (_data.hasOwnProperty('label')) {\n this.label = _data.label\n }\n if (_data.hasOwnProperty('icon')) {\n this.icon = _data.icon\n }\n }\n\n this._fileInputElement = this._createHiddenInput()\n this._renderer.appendChild(this._elementRef.nativeElement, this._fileInputElement)\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._listeners.forEach(l => l())\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _getFile(throwIfInvalidFiles: boolean = true): File | null {\n const files = this._fileInputElement.files\n if (files === null || files.length === 0) {\n return null\n }\n\n if (throwIfInvalidFiles) {\n if (files.length > 1) {\n throw Error(`Only one file can be imported at a time.`)\n }\n }\n\n return files[0]\n }\n\n private async _importFile(file: File): Promise<void> {\n const json = await readGeoFile(file)\n this._mapValueManager.setValue(json, MapValueSource.Input)\n this._resetInput()\n }\n\n private _createHiddenInput(): HTMLInputElement {\n const fileInputElement = this._renderer.createElement('input')\n this._renderer.setAttribute(fileInputElement, 'type', 'file')\n this._renderer.setAttribute(fileInputElement, 'hidden', '')\n this._renderer.setAttribute(fileInputElement, 'accept', '.json,.geojson,.shp,.zip')\n\n this._listeners.push(this._renderer.listen(fileInputElement, 'change', (event: Event) => {\n const file = this._getFile()\n if (file === null) { return }\n const fileImportHandler = this._googleMaps.getFileInputHandler()\n if (fileImportHandler) {\n fileImportHandler(file)\n } else {\n this._importFile(file)\n }\n }))\n\n return fileInputElement\n }\n\n private _createTemporaryFormElement(): HTMLFormElement {\n return this._renderer.createElement('form')\n }\n\n /**\n * Reset input element, so that the same file can be added again.\n */\n private _resetInput(): void {\n const formElement = this._createTemporaryFormElement()\n this._renderer.appendChild(formElement, this._fileInputElement)\n formElement.reset()\n this._renderer.appendChild(this._elementRef.nativeElement, this._fileInputElement)\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'\nimport { BooleanInput, coerceNumberProperty, NumberInput } from '@angular/cdk/coercion'\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { fromEvent, Subject } from 'rxjs'\nimport { takeUntil, tap } from 'rxjs/operators'\n\nimport { AgmMap } from '@agm/core'\nimport { faCrosshairs, faFileImport } from '@fortawesome/free-solid-svg-icons'\nimport { CanDisable, CanDisableCtor, InputBoolean, InputNumber, mixinDisabled } from '@theseam/ui-common/core'\nimport { MenuComponent } from '@theseam/ui-common/menu'\n\nimport { FeatureCollection } from 'geojson'\nimport { GoogleMapsControlsService } from '../google-maps-controls.service'\nimport { TheSeamGoogleMapsRecenterButtonControlComponent } from '../google-maps-recenter-button-control/google-maps-recenter-button-control.component'\nimport { TheSeamGoogleMapsUploadButtonControlComponent } from '../google-maps-upload-button-control/google-maps-upload-button-control.component'\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MapControl, MAP_CONTROLS_SERVICE } from '../map-controls-service'\nimport { MapValue, MapValueManagerService, MapValueSource } from '../map-value-manager.service'\n\nclass TheSeamGoogleMapsComponentBase {\n constructor(public _elementRef: ElementRef) {}\n}\n\nconst _TheSeamGoogleMapsMixinBase: CanDisableCtor &\n typeof TheSeamGoogleMapsComponentBase =\n mixinDisabled(TheSeamGoogleMapsComponentBase)\n\n/**\n * A wrapper for googlemap.\n */\n@Component({\n selector: 'seam-google-maps',\n templateUrl: './google-maps.component.html',\n styleUrls: ['./google-maps.component.scss'],\n inputs: [\n 'disabled'\n ],\n providers: [\n MapValueManagerService,\n GoogleMapsService,\n { provide: MAP_CONTROLS_SERVICE, useClass: GoogleMapsControlsService },\n {\n provide: NG_VALUE_ACCESSOR,\n // tslint:disable-next-line: no-use-before-declare\n useExisting: forwardRef(() => TheSeamGoogleMapsComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'seamGoogleMaps'\n})\nexport class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinBase\n implements OnInit, AfterViewInit, OnDestroy, OnChanges, CanDisable, ControlValueAccessor {\n static ngAcceptInputType_disabled: BooleanInput\n static ngAcceptInputType_zoom: NumberInput\n static ngAcceptInputType_longitude: NumberInput\n static ngAcceptInputType_latitude: NumberInput\n static ngAcceptInputType_fileDropEnabled: BooleanInput\n static ngAcceptInputType_fileUploadControlEnabled: BooleanInput\n static ngAcceptInputType_fullscreenControlEnabled: BooleanInput\n static ngAcceptInputType_reCenterControlEnabled: BooleanInput\n static ngAcceptInputType_mapTypeControlEnabled: BooleanInput\n static ngAcceptInputType_streetViewControlEnabled: BooleanInput\n static ngAcceptInputType_allowDrawingHoleInPolygon: BooleanInput\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n readonly _fileUploadControlDef: MapControl = {\n component: TheSeamGoogleMapsUploadButtonControlComponent,\n data: { label: 'Import Geo File', icon: faFileImport },\n position: 6 /* google.maps.ControlPosition.LEFT_BOTTOM */,\n }\n\n readonly _reCenterControlDef: MapControl = {\n component: TheSeamGoogleMapsRecenterButtonControlComponent,\n data: { label: 'Center on Field', icon: faCrosshairs },\n position: 9 /* google.maps.ControlPosition.RIGHT_BOTTOM */,\n }\n\n private _focusOrigin: FocusOrigin = null\n\n @Input()\n set value(value: MapValue) {\n this._mapValueManager.setValue(value, MapValueSource.Input)\n }\n get value(): MapValue {\n return this._mapValueManager.value\n }\n\n @Input()\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\n get tabIndex(): number { return this._tabIndex }\n /**\n * Set the tab index to `-1` to allow the root element of the\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n private _tabIndex = -1\n\n @Input() @InputBoolean() fileDropEnabled: boolean = true\n\n @Input() @InputBoolean() fileUploadControlEnabled: boolean = false\n @Input() @InputBoolean() fullscreenControlEnabled: boolean = true\n @Input() @InputBoolean() reCenterControlEnabled: boolean = true\n @Input() @InputBoolean() mapTypeControlEnabled: boolean = true\n @Input() @InputBoolean() streetViewControlEnabled: boolean = false\n\n @Input() @InputBoolean() allowDrawingHoleInPolygon: boolean = false\n\n @Input()\n set fileImportHandler(value: ((file: File) => void) | undefined | null) {\n this._googleMaps.setFileInputHandler(value)\n }\n\n @HostBinding('attr.disabled')\n get _attrDisabled() { return this.disabled || null }\n\n @HostBinding('attr.tabindex')\n get _attrTabIndex() { return this.disabled ? -1 : (this.tabIndex || 0) }\n\n onChange: any\n onTouched: any\n\n @Input() @InputNumber() zoom: number = 14\n @Input() @InputNumber() longitude: number = -98.570209\n @Input() @InputNumber() latitude: number = 37.633814\n\n @Output() mapReady = new EventEmitter<void>()\n\n @ViewChild(AgmMap, { static: true }) public agmMap!: AgmMap\n @ViewChild('featureContextMenu', { static: true, read: MenuComponent }) public featureContextMenu!: MenuComponent\n\n @ViewChild(AgmMap, { static: true, read: ElementRef }) public agmMapTpl!: ElementRef<HTMLElement>\n\n constructor(\n elementRef: ElementRef,\n private readonly _focusMonitor: FocusMonitor,\n private readonly _googleMaps: GoogleMapsService,\n private readonly _mapValueManager: MapValueManagerService,\n ) {\n super(elementRef)\n\n this._focusMonitor.monitor(this._elementRef, true).pipe(\n tap(origin => this._focusOrigin = origin),\n takeUntil(this._ngUnsubscribe),\n ).subscribe()\n\n this._mapValueManager.valueChanged.pipe(\n tap(change => {\n if (this.onChange) { this.onChange(change.value) }\n if (this.onTouched) { this.onTouched() }\n }),\n tap(changed => {\n if (this._googleMaps.mapReady && changed.source !== MapValueSource.FeatureChange) {\n this._googleMaps.setData(changed.value)\n }\n }),\n takeUntil(this._ngUnsubscribe),\n ).subscribe()\n\n this._googleMaps.setBaseLatLng(this.latitude, this.longitude)\n }\n\n /** @ignore */\n ngOnInit() {\n this._googleMaps.setFeatureContextMenu(this.featureContextMenu)\n\n fromEvent<KeyboardEvent>(window, 'keydown').pipe(\n tap((event: KeyboardEvent) => {\n switch (event.code) {\n case 'Delete': this._googleMaps.deleteSelection(); event.preventDefault(); event.stopPropagation(); break\n case 'Escape': this._googleMaps.stopDrawing(); event.preventDefault(); event.stopPropagation(); break\n case 'ContextMenu': this._googleMaps.openContextMenu(); event.preventDefault(); event.stopPropagation(); break\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef)\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n /** @ignore */\n ngAfterViewInit() { }\n\n ngOnChanges(changes: SimpleChanges): void {\n let updateBase = false\n if (changes.hasOwnProperty('latitude')) {\n this.latitude = changes['latitude'].currentValue\n updateBase = true\n }\n if (changes.hasOwnProperty('longitude')) {\n this.longitude = changes['longitude'].currentValue\n updateBase = true\n }\n if (updateBase) {\n this._googleMaps.setBaseLatLng(this.latitude, this.longitude)\n }\n\n if (changes.hasOwnProperty('allowDrawingHoleInPolygon')) {\n this._googleMaps.allowDrawingHoleInPolygon(this.allowDrawingHoleInPolygon)\n }\n }\n\n writeValue(value: MapValue): void {\n this.value = value\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.disabled = isDisabled\n }\n\n public fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void {\n this._googleMaps.fitBounds(bounds, padding)\n }\n\n public getGeoJson(): Promise<object> {\n return this._googleMaps.getGeoJson()\n }\n\n public hasFocus(): boolean {\n return this._focusOrigin !== null && this._focusOrigin !== undefined\n }\n\n /** Focuses the button. */\n public focus(): void {\n this._getHostElement().focus()\n }\n\n private _getHostElement() {\n return this._elementRef.nativeElement\n }\n\n _onMapReady(theMap: google.maps.Map) {\n this._googleMaps.setMap(theMap)\n this._googleMaps.setData(this._mapValueManager.value)\n // NOTE: AgmMap has a race condition problem that causes the input latitude,\n // longitude, and zoom to get ignored, before googlemaps emits\n // 'center_changed'. This should avoid the issue, until we stop using AgmMap\n // or upgrade to a more recent version that may not have the issue anymore.\n this._googleMaps.reCenterOnFeatures()\n this._googleMaps.googleMap?.setZoom(this.zoom)\n }\n\n _onClickDeleteFeature() {\n this._googleMaps.deleteSelection()\n }\n}\n","import { Directive, ElementRef, HostBinding, Input, NgZone, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'\nimport { interval, Observable, Subject, Subscriber } from 'rxjs'\nimport { filter, mapTo, startWith, switchMap, take, takeUntil } from 'rxjs/operators'\n\ndeclare const ngDevMode: boolean | undefined\ntype WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\n\nexport const SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS: google.maps.places.AutocompleteOptions = {\n componentRestrictions: { country: 'US' }\n}\n\n@Directive({\n selector: 'input[seamGoogleMapsPlacesAutocomplete]',\n exportAs: 'seamGoogleMapsPlacesAutocomplete'\n})\nexport class TheSeamGoogleMapsPlacesAutocompleteDirective implements OnInit, OnDestroy, OnChanges {\n private readonly _autoCompleteReadySubject = new Subject()\n private readonly _ngUnsubscribe = new Subject()\n\n private _placeChangedPending: { observable: Observable<any>, subscriber: Subscriber<any> }[] = []\n private _listeners: google.maps.MapsEventListener[] = []\n\n public autoComplete?: google.maps.places.Autocomplete\n\n @Input()\n set options(value: google.maps.places.AutocompleteOptions | undefined | null) {\n this._options = value || SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\n }\n private _options: google.maps.places.AutocompleteOptions = SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\n\n /**\n * This event is fired when a PlaceResult is made available for a Place the\n * user has selected. If the user enters the name of a Place that was not\n * suggested by the control and presses the Enter key, or if a Place Details\n * request fails, the PlaceResult contains the user input in the name\n * property, with no other properties defined.\n *\n * See: https://developers.google.com/maps/documentation/javascript/reference/places-widget#Autocomplete.place_changed\n */\n @Output() readonly placeChanged: Observable<any>\n\n @HostBinding('attr.type') _attrType = 'text'\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLInputElement>,\n private readonly _ngZone: NgZone,\n ) {\n this.placeChanged = this._autoCompleteReadySubject.pipe(\n startWith(undefined),\n switchMap(() => this._createPlaceChangedObservable<any>())\n )\n }\n\n ngOnInit(): void {\n this._ngZone.runOutsideAngular(() => {\n this._untilGoogleMapsApiLoaded().pipe(takeUntil(this._ngUnsubscribe)).subscribe(() => {\n this.autoComplete = new google.maps.places.Autocomplete(this.getHostElement(), this._options)\n\n this._placeChangedPending.forEach(pending => pending.observable.subscribe(pending.subscriber))\n\n this._autoCompleteReadySubject.next()\n })\n })\n }\n\n ngOnDestroy(): void {\n this._listeners.forEach(l => l.remove())\n this._listeners = []\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (this.autoComplete && changes['options']) {\n this.autoComplete.setOptions(this._options)\n }\n }\n\n private _untilGoogleMapsApiLoaded(): Observable<void> {\n return interval(500).pipe(\n filter(() => !!(window.google && window.google.maps && window.google.maps.version)),\n take(1),\n mapTo(undefined),\n )\n }\n\n /**\n * Returns the bounds to which predictions are biased.\n */\n public getBounds(): google.maps.LatLngBounds | undefined {\n this._assertInitialized()\n return this.autoComplete.getBounds()\n }\n\n /**\n * Returns the fields to be included for the Place in the details response\n * when the details are successfully retrieved. For a list of fields see\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\n */\n public getFields(): string[] | undefined {\n this._assertInitialized()\n return (this.autoComplete as any).getFields()\n }\n\n /**\n * Returns the details of the Place selected by user if the details were\n * successfully retrieved. Otherwise returns a stub Place object, with the\n * name property set to the current value of the input field.\n */\n public getPlace(): google.maps.places.PlaceResult {\n this._assertInitialized()\n return this.autoComplete.getPlace()\n }\n\n /**\n * Sets the preferred area within which to return Place results. Results are\n * biased towards, but not restricted to, this area.\n */\n public setBounds(bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setBounds(bounds!)\n }\n\n /**\n * Sets the component restrictions. Component restrictions are used to\n * restrict predictions to only those within the parent component. For\n * example, the country.\n */\n public setComponentRestrictions(restrictions?: google.maps.places.ComponentRestrictions): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setComponentRestrictions(restrictions!)\n }\n\n /**\n * Sets the fields to be included for the Place in the details response when\n * the details are successfully retrieved. For a list of fields see\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\n */\n public setFields(fields?: string[]): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setFields(fields!)\n }\n\n /** */\n public setOptions(options?: google.maps.places.AutocompleteOptions): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setOptions(options!)\n }\n\n /**\n * Sets the types of predictions to be returned. For supported types, see the\n * [developer's guide](https://developers.google.com/maps/documentation/javascript/places-autocomplete#constrain-place-types).\n * If no types are specified, all types will be returned.\n */\n public setTypes(types?: string[]): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setTypes(types!)\n }\n\n /** Focuses the input. */\n public focus(): void {\n this._elementRef.nativeElement.focus()\n }\n\n /** Unfocuses the input. */\n public blur(): void {\n this._elementRef.nativeElement.blur()\n }\n\n public getHostElement(): HTMLInputElement {\n return this._elementRef.nativeElement\n }\n\n private _createPlaceChangedObservable<T>(): Observable<T> {\n const observable = new Observable<T>(subscriber => {\n if (!this.autoComplete) {\n this._placeChangedPending.push({ observable, subscriber })\n return undefined\n }\n const listener = this.autoComplete.addListener('place_changed', (event: T) => {\n this._ngZone.run(() => subscriber.next(event))\n })\n this._listeners.push(listener)\n\n return () => listener.remove()\n })\n return observable\n }\n\n /** Asserts that the map has been initialized. */\n private _assertInitialized(): asserts this is WithRequired<TheSeamGoogleMapsPlacesAutocompleteDirective, 'autoComplete'> {\n if (!this.autoComplete && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(\n 'Cannot access Google Map Places information before the API has been initialized. ' +\n 'Please wait for the API to load before trying to interact with it.',\n )\n }\n }\n}\n","import { BooleanInput, coerceNumberProperty } from '@angular/cdk/coercion'\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core'\nimport { interval, Observable, of, Subject, Subscriber } from 'rxjs'\nimport { filter, mapTo, startWith, switchMap, take, takeUntil } from 'rxjs/operators'\n\nimport { faSearchLocation } from '@fortawesome/free-solid-svg-icons'\nimport { InputBoolean } from '@theseam/ui-common/core'\nimport { InputDirective } from '@theseam/ui-common/form-field'\nimport { SeamIcon } from '@theseam/ui-common/icon'\n\nimport { SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS, TheSeamGoogleMapsPlacesAutocompleteDirective } from './google-maps-places-autocomplete.directive'\n\ndeclare const ngDevMode: boolean | undefined\ntype WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\n\n/**\n *\n */\n@Component({\n selector: 'seam-google-maps-places-autocomplete',\n templateUrl: './google-maps-places-autocomplete.component.html',\n styleUrls: ['./google-maps-places-autocomplete.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'seamGoogleMapsPlacesAutoComplete'\n})\nexport class TheSeamGoogleMapsPlacesAutoCompleteComponent implements OnInit, OnDestroy {\n static ngAcceptInputType_disabled: BooleanInput\n\n private readonly _ngUnsubscribe = new Subject<void>()\n private readonly _autoCompleteReadySubject = new Subject()\n\n private _placeChangedPending: { observable: Observable<any>, subscriber: Subscriber<any> }[] = []\n\n public autoComplete?: google.maps.places.Autocomplete\n\n @Input() label: string | undefined | null = 'Search by address, place or name'\n\n @Input() icon: SeamIcon | undefined | null = faSearchLocation\n\n @Input() @InputBoolean() disabled: BooleanInput = false\n\n @Input() placeholder: string | undefined | null = 'Enter address, place or name'\n\n @Input() autocorrect: 'off' | 'on' | undefined | null = 'off'\n\n @Input() autocapitalize: 'off' | 'on' | undefined | null = 'off'\n\n /**\n * Set the tab index to `-1` to allow the root element of the\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n @Input()\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\n get tabIndex(): number { return this._tabIndex }\n private _tabIndex = -1\n\n @Input()\n set options(value: google.maps.places.AutocompleteOptions | undefined | null) {\n this._options = value || SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\n }\n _options: google.maps.places.AutocompleteOptions = SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\n\n /**\n * This event is fired when a PlaceResult is made available for a Place the\n * user has selected. If the user enters the name of a Place that was not\n * suggested by the control and presses the Enter key, or if a Place Details\n * request fails, the PlaceResult contains the user input in the name\n * property, with no other properties defined.\n *\n * See: https://developers.google.com/maps/documentation/javascript/reference/places-widget#Autocomplete.place_changed\n */\n @Output() readonly placeChanged: Observable<void>\n\n @ViewChild('inp', { read: InputDirective, static: true }) _inputDirective!: InputDirective\n\n @ViewChild(TheSeamGoogleMapsPlacesAutocompleteDirective, { static: true })\n set __autocompleteDirective(value: TheSeamGoogleMapsPlacesAutocompleteDirective) {\n this._autoCompleteDirective = value\n this._untilAutoCompleteReady().pipe(takeUntil(this._ngUnsubscribe)).subscribe(() => {\n this.autoComplete = this._autoCompleteDirective.autoComplete\n this._placeChangedPending.forEach(pending => pending.observable.subscribe(pending.subscriber))\n this._placeChangedPending = []\n })\n }\n _autoCompleteDirective!: TheSeamGoogleMapsPlacesAutocompleteDirective\n\n @HostBinding('attr.tabindex')\n get _attrTabIndex() { return this.disabled ? -1 : (this.tabIndex || 0) }\n\n @HostListener('click', [ 'event' ])\n _onClick(event: MouseEvent) {\n this._inputDirective.focus()\n }\n\n @HostListener('focus', [ '$event' ])\n _onFocus() {\n this._inputDirective?.focus()\n }\n\n constructor(\n private readonly _elementRef: ElementRef,\n ) {\n this.placeChanged = this._autoCompleteReadySubject.pipe(\n startWith(undefined),\n switchMap(() => this._createPlaceChangedObservable<any>())\n )\n }\n\n ngOnInit() { }\n\n /** @ignore */\n ngOnDestroy() {\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _untilAutoCompleteReady(): Observable<void> {\n return interval(500).pipe(\n filter(() => !!this._autoCompleteDirective.autoComplete),\n take(1),\n mapTo(undefined),\n )\n }\n\n /**\n * Returns the bounds to which predictions are biased.\n */\n public getBounds(): google.maps.LatLngBounds | undefined {\n this._assertInitialized()\n return this.autoComplete.getBounds()\n }\n\n /**\n * Returns the fields to be included for the Place in the details response\n * when the details are successfully retrieved. For a list of fields see\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\n */\n public getFields(): string[] | undefined {\n this._assertInitialized()\n return (this.autoComplete as any).getFields()\n }\n\n /**\n * Returns the details of the Place selected by user if the details were\n * successfully retrieved. Otherwise returns a stub Place object, with the\n * name property set to the current value of the input field.\n */\n public getPlace(): google.maps.places.PlaceResult {\n this._assertInitialized()\n return this.autoComplete.getPlace()\n }\n\n /**\n * Sets the preferred area within which to return Place results. Results are\n * biased towards, but not restricted to, this area.\n */\n public setBounds(bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setBounds(bounds!)\n }\n\n /**\n * Sets the component restrictions. Component restrictions are used to\n * restrict predictions to only those within the parent component. For\n * example, the country.\n */\n public setComponentRestrictions(restrictions?: google.maps.places.ComponentRestrictions): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setComponentRestrictions(restrictions!)\n }\n\n /**\n * Sets the fields to be included for the Place in the details response when\n * the details are successfully retrieved. For a list of fields see\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\n */\n public setFields(fields?: string[]): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setFields(fields!)\n }\n\n /** */\n public setOptions(options?: google.maps.places.AutocompleteOptions): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setOptions(options!)\n }\n\n /**\n * Sets the types of predictions to be returned. For supported types, see the\n * [developer's guide](https://developers.google.com/maps/documentation/javascript/places-autocomplete#constrain-place-types).\n * If no types are specified, all types will be returned.\n */\n public setTypes(types?: string[]): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setTypes(types!)\n }\n\n /** Focuses the input. */\n public focus(): void {\n this._elementRef.nativeElement.focus()\n }\n\n /** Unfocuses the input. */\n public blur(): void {\n this._elementRef.nativeElement.blur()\n }\n\n public getHostElement(): HTMLInputElement {\n return this._elementRef.nativeElement\n }\n\n private _createPlaceChangedObservable<T>(): Observable<T> {\n const observable = new Observable<T>(subscriber => {\n if (!this.autoComplete) {\n this._placeChangedPending.push({ observable, subscriber })\n return undefined\n }\n\n const sub = this._autoCompleteDirective.placeChanged.subscribe(subscriber)\n\n return () => sub.unsubscribe()\n })\n return observable\n }\n\n /** Asserts that the map has been initialized. */\n private _assertInitialized(): asserts this is WithRequired<TheSeamGoogleMapsPlacesAutoCompleteComponent, 'autoComplete'> {\n if (!this.autoComplete && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(\n 'Cannot access Google Map Places information before the API has been initialized. ' +\n 'Please wait for the API to load before trying to interact with it.',\n )\n }\n }\n\n}\n","import { OnInit } from '@angular/core'\nimport {\n ChangeDetectionStrategy,\n Component,\n Inject,\n Input,\n OnDestroy,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\nimport { takeUntil, tap } from 'rxjs/operators'\n\nimport { GoogleMapsControlsService, MapControlRef } from './google-maps-controls.service'\nimport { GoogleMapsService } from './google-maps.service'\nimport { MapControl, MAP_CONTROLS_SERVICE } from './map-controls-service'\n\n@Component({\n selector: 'seam-map-control',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamMapsControlComponent implements OnInit, OnDestroy {\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private _controlRef?: MapControlRef\n\n @Input()\n set def(value: MapControl | null | undefined) {\n if (value !== this._def) {\n this._remove()\n this._def = value\n }\n }\n _def: MapControl | null | undefined\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n @Inject(MAP_CONTROLS_SERVICE) private readonly _googleMapsControls: GoogleMapsControlsService,\n ) { }\n\n /** @ignore */\n ngOnInit(): void {\n this._googleMaps.mapReady$.pipe(\n tap(ready => {\n if (ready) {\n this._add()\n } else {\n this._remove()\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n /** @ignore */\n ngOnDestroy(): void {\n this._remove()\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _add(): void {\n if (this._controlRef) {\n return\n }\n\n if (this._def === null || this._def === undefined) {\n return\n }\n\n this._controlRef = this._googleMapsControls.add(this._def)\n }\n\n private _remove(): void {\n this._controlRef?.destroy()\n this._controlRef = undefined\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n OnDestroy,\n OnInit,\n Renderer2,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\nimport { takeUntil, tap } from 'rxjs/operators'\n\nimport { readGeoFile } from '@theseam/ui-common/utils'\n\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MapValueManagerService, MapValueSource } from '../map-value-manager.service'\n\n/**\n *\n */\n@Component({\n selector: 'seam-map-file-drop',\n templateUrl: './map-file-drop.component.html',\n styleUrls: ['./map-file-drop.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamMapFileDropComponent implements OnInit, OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n /**\n * Map element drag events added to.\n */\n private _mapDiv: HTMLDivElement | undefined\n\n private _listeners: (() => void)[] = []\n\n private _globalDragInProgress: boolean = false\n\n constructor(\n private readonly _elementRef: ElementRef,\n private readonly _ngZone: NgZone,\n private readonly _googleMaps: GoogleMapsService,\n private readonly _mapValueManager: MapValueManagerService,\n private readonly _renderer: Renderer2\n ) { }\n\n /** @ignore */\n ngOnInit() {\n this._googleMaps.mapReady$.pipe(\n tap(ready => {\n if (ready) {\n this._enableFileDrop()\n } else {\n this._disableFileDrop()\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._disableFileDrop()\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _enableFileDrop(): void {\n const divElement = this._googleMaps.getDiv()\n if (this._mapDiv === divElement) {\n return\n }\n\n if (this._mapDiv !== undefined) {\n // Disable file drop on previous map div.\n this._disableFileDrop()\n }\n\n this._mapDiv = divElement\n this._ngZone.runOutsideAngular(() => {\n this._listeners.push(this._renderer.listen('document', 'dragstart', (event: Event) => {\n this._globalDragInProgress = true\n }))\n\n this._listeners.push(this._renderer.listen('document', 'dragend', (event: Event) => {\n this._globalDragInProgress = false\n }))\n\n this._listeners.push(this._renderer.listen(divElement, 'dragover', this._handleDragOverEvent))\n this._listeners.push(this._renderer.listen(this._elementRef.nativeElement, 'dragover', this._handleDragOverEvent))\n this._listeners.push(this._renderer.listen(this._elementRef.nativeElement, 'drop', this._handleDropEvent))\n this._listeners.push(this._renderer.listen(divElement, 'dragenter', this._handleDragEnterEvent))\n this._listeners.push(this._renderer.listen(this._elementRef.nativeElement, 'dragleave', this._handleDragLeaveEvent))\n })\n }\n\n private _disableFileDrop(): void {\n if (this._listeners.length > 0) {\n this._listeners.forEach(l => l())\n this._listeners = []\n }\n }\n\n private readonly _handleDragOverEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n if (!this._isSupportedDataTransferTypes(event.dataTransfer)) {\n return\n }\n\n event.preventDefault()\n event.dataTransfer.dropEffect = 'copy'\n }\n\n private readonly _handleDropEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n this._renderer.setStyle(this._elementRef.nativeElement, 'display', 'none')\n\n // TODO: Show error if multiple files?\n if (!this._isSupportedDataTransfer(event.dataTransfer)) {\n return\n }\n\n const item = event.dataTransfer.items[0]\n const file = item.getAsFile()\n readGeoFile(file).then(json => {\n this._mapValueManager.setValue(json, MapValueSource.Input)\n })\n }\n\n private readonly _handleDragEnterEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n if (!this._isSupportedDataTransferTypes(event.dataTransfer)) {\n return\n }\n\n this._renderer.setStyle(this._elementRef.nativeElement, 'display', 'block')\n }\n\n private readonly _handleDragLeaveEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n this._renderer.setStyle(this._elementRef.nativeElement, 'display', 'none')\n }\n\n private _dropAllowed(): boolean {\n return !this._globalDragInProgress\n }\n\n private _isSupportedDataTransfer(dataTransfer: DataTransfer): boolean {\n return dataTransfer.files.length === 1 && dataTransfer.types[0] === 'Files'\n }\n\n private _isSupportedDataTransferTypes(dataTransfer: DataTransfer): boolean {\n return dataTransfer.types[0] === 'Files'\n }\n\n}\n","import { ObserversModule } from '@angular/cdk/observers'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { AgmCoreModule } from '@agm/core'\nimport { TheSeamFormFieldModule } from '@theseam/ui-common/form-field'\nimport { TheSeamIconModule } from '@theseam/ui-common/icon'\nimport { TheSeamMenuModule } from '@theseam/ui-common/menu'\nimport { TheSeamSharedModule } from '@theseam/ui-common/shared'\n\nimport { TheSeamGoogleMapsPlacesAutoCompleteComponent } from './google-maps-places-autocomplete/google-maps-places-autocomplete.component'\nimport { TheSeamGoogleMapsPlacesAutocompleteDirective } from './google-maps-places-autocomplete/google-maps-places-autocomplete.directive'\nimport { TheSeamGoogleMapsRecenterButtonControlComponent } from './google-maps-recenter-button-control/google-maps-recenter-button-control.component'\nimport { TheSeamGoogleMapsUploadButtonControlComponent } from './google-maps-upload-button-control/google-maps-upload-button-control.component'\nimport { TheSeamGoogleMapsComponent } from './google-maps/google-maps.component'\nimport { TheSeamMapsControlComponent } from './map-control.component'\nimport { TheSeamMapFileDropComponent } from './map-file-drop/map-file-drop.component'\n\n@NgModule({\n declarations: [\n TheSeamGoogleMapsComponent,\n TheSeamMapFileDropComponent,\n TheSeamGoogleMapsUploadButtonControlComponent,\n TheSeamGoogleMapsRecenterButtonControlComponent,\n TheSeamMapsControlComponent,\n TheSeamGoogleMapsPlacesAutocompleteDirective,\n TheSeamGoogleMapsPlacesAutoCompleteComponent,\n ],\n imports: [\n CommonModule,\n ObserversModule,\n TheSeamSharedModule,\n TheSeamMenuModule,\n TheSeamIconModule,\n TheSeamFormFieldModule,\n AgmCoreModule,\n ],\n exports: [\n TheSeamGoogleMapsComponent,\n TheSeamGoogleMapsPlacesAutocompleteDirective,\n TheSeamGoogleMapsPlacesAutoCompleteComponent\n ]\n})\nexport class TheSeamGoogleMapsModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {MAP_CONTROLS_SERVICE as ɵb,MAP_CONTROL_DATA as ɵc,MapControl as ɵa} from './map-controls-service';"],"names":["polygon","turfjsPolygon","multiPolygon","turfjsMultiPolygon"],"mappings":";;;;;;;;;;;;;;;;;;;;;IAWY;AAAZ,WAAY,sBAAsB;IAChC,0DAAgC,CAAA;AAClC,CAAC,EAFW,sBAAsB,KAAtB,sBAAsB,QAEjC;SAEe,oBAAoB,CAAC,YAAoB;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC;SACzC,SAAS,CAAC,KAAK,IAAI,KAAK,KAAK,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;AACtD,CAAC;SAEe,iBAAiB,CAAC,OAAiC;IACjE,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAA;IACzE,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAA;AAC1C,CAAC;SAEe,kBAAkB,CAAC,OAAiC,EAAE,UAAmB;IACvF,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AACpE,CAAC;AAED;AACA;AACA;SACgB,iCAAiC,CAAC,IAAS;IACzD,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,aAAJ,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AC1B,2BAA2B;oBAC3B,6CAA6C;oBAC7C,+CAA+C;oBAC/C,2BAA2B;oBAC3B,4CAA4C;oBAC5C,4CAA4C;iBAC7C;gBACD,OAAO,EAAE;oBACP,YAAY;oBACZ,eAAe;oBACf,mBAAmB;oBACnB,iBAAiB;oBACjB,iBAAiB;oBACjB,sBAAsB;oBACtB,aAAa;iBACd;gBACD,OAAO,EAAE;oBACP,0BAA0B;oBAC1B,4CAA4C;oBAC5C,4CAA4C;iBAC7C;aACF;;;AC1CD;;;;;;"}
@@ -349,6 +349,7 @@ class MenuToggleDirective {
349
349
  (_b = this._overlayRef) === null || _b === void 0 ? void 0 : _b.detach();
350
350
  }
351
351
  this._resetMenu();
352
+ this._elementRef.nativeElement.removeEventListener('touchstart', this._handleTouchStart, passiveEventListenerOptions);
352
353
  this._menuClosedSubscription.unsubscribe();
353
354
  this._closingActionsSubscription.unsubscribe();
354
355
  this._active = false;
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-menu.js","sources":["../../../projects/ui-common/menu/menu-animations.ts","../../../projects/ui-common/menu/menu-divider.component.ts","../../../projects/ui-common/menu/menu-panel-token.ts","../../../projects/ui-common/menu/menu-item.component.ts","../../../projects/ui-common/menu/menu-toggle.directive.ts","../../../projects/ui-common/menu/menu.component.ts","../../../projects/ui-common/menu/menu-footer-action/menu-footer-action.component.ts","../../../projects/ui-common/menu/menu-footer/menu-footer.component.ts","../../../projects/ui-common/menu/menu-header/menu-header.component.ts","../../../projects/ui-common/menu/menu.module.ts","../../../projects/ui-common/menu/theseam-ui-common-menu.ts"],"sourcesContent":["import { animate, animation, group, query, style, useAnimation } from '@angular/animations'\n\nexport const menuDropdownPanelSlideIn = animation([\n style({\n opacity: 0,\n transform: 'translateY(-70%)'\n }),\n group([\n animate('170ms linear', style({ opacity: 1 })),\n animate('220ms ease', style({ transform: 'translateY(0)' })),\n ])\n])\n\nexport const menuDropdownPanelSlideOut = animation([\n style({\n opacity: 1,\n transform: 'translateY(0)'\n }),\n group([\n animate('170ms linear', style({ opacity: 0 })),\n animate('220ms ease', style({ transform: 'translateY(-70%)' })),\n ])\n])\n\nexport const menuDropdownPanelExpandIn = animation([\n style({\n opacity: 0,\n transform: 'scale(0.8)'\n }),\n group([\n animate('100ms linear', style({ opacity: 1 })),\n animate('120ms ease', style({ transform: 'scale(1)' })),\n ])\n])\n\nexport const menuDropdownPanelExpandOut = animation([\n style({\n opacity: 1,\n transform: 'scale(1)'\n }),\n group([\n animate('100ms linear', style({ opacity: 0 })),\n animate('120ms ease', style({ transform: 'scale(0.8)' })),\n ])\n])\n\nexport const menuDropdownPanelFadeIn = animation([\n style({ transform: 'translateY(-30px)', opacity: '0' }),\n animate('250ms', style({ transform: 'translateY(0)', opacity: '1' }))\n])\n\nexport const menuDropdownPanelFadeOut = animation([\n style({ transform: 'translateY(0)', opacity: '1' }),\n animate('250ms', style({ transform: 'translateY(-30px)', opacity: '0' }))\n])\n\nexport const menuDropdownPanelIn = animation([\n query('.seam-menu-container.seam-menu-anim--slide .dropdown-menu', useAnimation(menuDropdownPanelSlideIn), { optional: true }),\n query('.seam-menu-container.seam-menu-anim--fade .dropdown-menu', useAnimation(menuDropdownPanelFadeIn), { optional: true })\n])\n\nexport const menuDropdownPanelOut = animation([\n query('.seam-menu-container.seam-menu-anim--slide .dropdown-menu', useAnimation(menuDropdownPanelSlideOut), { optional: true }),\n query('.seam-menu-container.seam-menu-anim--fade .dropdown-menu', useAnimation(menuDropdownPanelFadeOut), { optional: true })\n])\n","import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: 'seam-menu-divider',\n template: ``,\n styles: [],\n // tslint:disable-next-line:use-host-property-decorator\n host: {\n 'class': 'dropdown-divider d-block'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuDividerComponent { }\n","import { InjectionToken } from '@angular/core'\n\nimport { ITheSeamMenuPanel } from './menu-panel'\n\n/**\n * Injection token used to provide the parent menu to menu-specific components.\n */\nexport const THESEAM_MENU_PANEL = new InjectionToken<ITheSeamMenuPanel>('THESEAM_MENU_PANEL')\n","import { FocusableOption, FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'\nimport { DOCUMENT } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, ElementRef, HostListener, Inject, Input, OnDestroy, OnInit, Optional } from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { CanDisableCtor, mixinDisabled } from '@theseam/ui-common/core'\nimport { SeamIcon } from '@theseam/ui-common/icon'\n\nimport type { ITheSeamMenuPanel } from './menu-panel'\nimport { THESEAM_MENU_PANEL } from './menu-panel-token'\n\nclass TheSeamMenuItemBase {}\n\nconst _seamMenuItemMixinBase: CanDisableCtor & typeof TheSeamMenuItemBase =\n mixinDisabled(TheSeamMenuItemBase)\n\n@Component({\n // tslint:disable-next-line:component-selector\n selector: '[seamMenuItem]',\n templateUrl: './menu-item.component.html',\n styleUrls: ['./menu-item.component.scss'],\n exportAs: 'seamMenuItem',\n // tslint:disable-next-line:use-input-property-decorator\n inputs: [ 'disabled' ],\n // tslint:disable-next-line:use-host-property-decorator\n host: {\n '[attr.role]': 'role',\n 'class': 'dropdown-item',\n '[attr.tabindex]': '_getTabIndex()',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuItemComponent extends _seamMenuItemMixinBase implements OnInit, OnDestroy, FocusableOption {\n\n /** ARIA role for the menu item. */\n @Input() role: 'menuitem' | 'menuitemradio' | 'menuitemcheckbox' | undefined | null = 'menuitem'\n\n @Input() icon: SeamIcon | string | undefined | null\n @Input() iconClass: string | undefined | null\n\n @Input() badgeText: string | undefined | null\n @Input() badgeTheme: string | undefined | null = 'danger'\n\n /** Stream that emits when the menu item is hovered. */\n readonly _hovered: Subject<MenuItemComponent> = new Subject<MenuItemComponent>()\n\n /** Whether the menu item is highlighted. */\n _highlighted = false\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) public document: any,\n private _focusMonitor: FocusMonitor,\n @Inject(THESEAM_MENU_PANEL) @Optional() private _parentMenu?: ITheSeamMenuPanel<MenuItemComponent>\n ) {\n super()\n\n if (_focusMonitor) {\n // Start monitoring the element so it gets the appropriate focused classes. We want\n // to show the focus style for menu items only when the focus was not caused by a\n // mouse or touch interaction.\n _focusMonitor.monitor(this._elementRef, false)\n }\n\n // console.log(this._parentMenu)\n if (_parentMenu && _parentMenu.addItem) {\n _parentMenu.addItem(this)\n }\n }\n\n ngOnInit() { }\n\n ngOnDestroy() {\n if (this._focusMonitor) {\n this._focusMonitor.stopMonitoring(this._elementRef)\n }\n\n if (this._parentMenu && this._parentMenu.removeItem) {\n this._parentMenu.removeItem(this)\n }\n\n this._hovered.complete()\n }\n\n /** Focuses the menu item. */\n focus(origin: FocusOrigin = 'program'): void {\n if (this._focusMonitor) {\n this._focusMonitor.focusVia(this._getHostElement(), origin)\n } else {\n this._getHostElement().focus()\n }\n }\n\n /** Used to set the `tabindex`. */\n _getTabIndex(): string {\n return this.disabled ? '-1' : '0'\n }\n\n /** Returns the host DOM element. */\n _getHostElement(): HTMLElement {\n return this._elementRef.nativeElement\n }\n\n /** Prevents the default element actions if it is disabled. */\n @HostListener('click', ['$event'])\n _checkDisabled(event: Event): void {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n /** Emits to the hover stream. */\n @HostListener('mouseenter')\n _handleMouseEnter() {\n this._hovered.next(this)\n }\n\n /** Gets the label to be used when determining whether the option should be focused. */\n getLabel(): string {\n const element: HTMLElement = this._elementRef.nativeElement\n const textNodeType = this.document ? this.document.TEXT_NODE : 3\n let output = ''\n\n if (element.childNodes) {\n const length = element.childNodes.length\n\n // Go through all the top-level text nodes and extract their text.\n // We skip anything that's not a text node to prevent the text from\n // being thrown off by something like an icon.\n for (let i = 0; i < length; i++) {\n if (element.childNodes[i].nodeType === textNodeType) {\n output += element.childNodes[i].textContent\n }\n }\n }\n\n return output.trim()\n }\n\n}\n","import { FocusMonitor, FocusOrigin, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y'\nimport { DOWN_ARROW, ESCAPE, UP_ARROW } from '@angular/cdk/keycodes'\nimport { ConnectionPositionPair, Overlay, OverlayRef, PositionStrategy } from '@angular/cdk/overlay'\nimport { normalizePassiveListenerOptions } from '@angular/cdk/platform'\nimport { TemplatePortal } from '@angular/cdk/portal'\nimport { Directive, ElementRef, HostListener, Inject, Input, OnDestroy, Optional, ViewContainerRef } from '@angular/core'\nimport { merge, of, Subscription } from 'rxjs'\n\nimport { MenuItemComponent } from './menu-item.component'\nimport { ITheSeamMenuPanel } from './menu-panel'\nimport { THESEAM_MENU_PANEL } from './menu-panel-token'\nimport { MenuComponent } from './menu.component'\n\n/** Options for binding a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true})\n\n@Directive({\n selector: '[seamMenuToggle]',\n // tslint:disable-next-line:use-host-property-decorator\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'menuOpen() || null'\n },\n exportAs: 'seamMenuToggle'\n})\nexport class MenuToggleDirective implements OnDestroy {\n\n private _active = false\n private _overlayRef?: OverlayRef\n private _menuClosedSubscription = Subscription.EMPTY\n private _closingActionsSubscription = Subscription.EMPTY\n\n public restoreFocus = true\n\n // Tracking input type is necessary so it's possible to only auto-focus\n // the first item of the list when the menu is opened via the keyboard\n _openedBy: 'mouse' | 'touch' | null = null\n\n @Input() seamMenuToggle: MenuComponent | undefined | null\n\n @Input()\n set positions(val: ConnectionPositionPair[]) {\n this._positions = val\n if (this.menuOpen()) {\n this._overlayRef?.updatePositionStrategy(this.getOverlayPosition(this._elementRef.nativeElement))\n }\n }\n get positions() { return this._positions }\n private _positions: ConnectionPositionPair[] = [\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n },\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n },\n {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n ]\n\n @HostListener('mousedown', [ '$event' ])\n _onMouseDown(event: MouseEvent) {\n if (!isFakeMousedownFromScreenReader(event)) {\n // Since right or middle button clicks won't trigger the `click` event,\n // we shouldn't consider the menu as opened by mouse in those cases.\n this._openedBy = event.button === 0 ? 'mouse' : null\n\n // Since clicking on the trigger won't close the menu if it opens a sub-menu,\n // we should prevent focus from moving onto it via click to avoid the\n // highlight from lingering on the menu item.\n // if (this.triggersSubmenu()) {\n // event.preventDefault();\n // }\n }\n }\n\n @HostListener('keydown', [ '$event' ])\n _onKeydown(event: any) {\n this._openedBy = null\n\n // tslint:disable-next-line:deprecation\n const keyCode = event.keyCode\n\n if (keyCode === UP_ARROW || keyCode === DOWN_ARROW) {\n if (this.menuOpen()) {\n this.seamMenuToggle?.focusFirstItem(this._openedBy || 'program')\n }\n }\n }\n\n @HostListener('click', [ '$event' ])\n _onClick(event: any) {\n this.toggle()\n }\n\n @HostListener('document:keydown', [ '$event' ])\n _onDocumentKeydown(event: any) {\n if (event.keyCode === ESCAPE) {\n this.closeMenu()\n }\n }\n\n // @HostListener('document:mousedown', [ '$event' ])\n // _onDocumentMouseDown(event: any) {\n // console.log('outside click')\n // }\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _viewContainerRef: ViewContainerRef,\n private _overlay: Overlay,\n private _focusMonitor: FocusMonitor,\n // @Inject(THESEAM_MENU_PANEL) @Optional() private _parentMenu?: ITheSeamMenuPanel<MenuItemComponent>\n ) {\n this._elementRef.nativeElement.addEventListener('touchstart', this._handleTouchStart,\n passiveEventListenerOptions)\n }\n\n ngOnDestroy() {\n this.closeMenu()\n\n this._elementRef.nativeElement.removeEventListener('touchstart', this._handleTouchStart,\n passiveEventListenerOptions)\n\n this._menuClosedSubscription.unsubscribe()\n this._closingActionsSubscription.unsubscribe()\n }\n\n /**\n * Handles touch start events on the trigger.\n * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.\n */\n private _handleTouchStart = () => this._openedBy = 'touch'\n\n public toggle(): void {\n if (this._active) {\n this.closeMenu()\n } else {\n this.openMenu()\n }\n }\n\n public openMenu(): void {\n if (this._active || !this.seamMenuToggle) { return }\n this._active = true\n\n this._overlayRef = this._overlay.create({\n hasBackdrop: true,\n backdropClass: 'transparent',\n positionStrategy: this.getOverlayPosition(this._elementRef.nativeElement),\n })\n\n const tpl = this.seamMenuToggle.templateRef\n if (!tpl) {\n throw Error(`Menu template not found.`)\n }\n\n this._overlayRef.attach(new TemplatePortal(tpl, this._viewContainerRef))\n\n this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this.closeMenu())\n this._initMenu()\n\n this._menuClosedSubscription = this.seamMenuToggle.closed.subscribe(v => {\n // console.log('closed', v)\n this.closeMenu()\n })\n\n // this._overlayRef.backdropClick().subscribe(v => {\n // console.log('backdropClick', v)\n // })\n }\n\n public closeMenu(): void {\n if (!this._active) { return }\n\n if (this._overlayRef?.hasAttached()) {\n this._overlayRef?.detach()\n }\n\n this._resetMenu()\n\n this._menuClosedSubscription.unsubscribe()\n this._closingActionsSubscription.unsubscribe()\n\n this._active = false\n }\n\n public menuOpen(): boolean {\n return (this._overlayRef && this._overlayRef.hasAttached()) ?? false\n }\n\n private getOverlayPosition(origin: HTMLElement): PositionStrategy {\n const positionStrategy = this._overlay.position()\n .flexibleConnectedTo(origin)\n .withPositions(this.positions)\n .withFlexibleDimensions(false)\n .withPush(true)\n\n return positionStrategy\n }\n\n /**\n * Focuses the menu trigger.\n * @param origin Source of the menu trigger's focus.\n */\n focus(origin: FocusOrigin = 'program') {\n if (this._focusMonitor) {\n this._focusMonitor.focusVia(this._elementRef, origin)\n } else {\n this._elementRef.nativeElement.focus()\n }\n }\n\n /**\n * This method sets the menu state to open and focuses the first item if\n * the menu was opened via the keyboard.\n */\n private _initMenu(): void {\n // this.seamMenuToggle.parentMenu = this.triggersSubmenu() ? this._parentMenu : undefined\n // this.seamMenuToggle.direction = this.dir\n // this._setMenuElevation()\n // this._setIsMenuOpen(true)\n // this.seamMenuToggle.focusFirstItem(this._openedBy || 'program')\n }\n\n /**\n * This method resets the menu when it's closed, most importantly restoring\n * focus to the menu trigger if the menu was opened via the keyboard.\n */\n private _resetMenu(): void {\n // this._setIsMenuOpen(false)\n\n // We should reset focus if the user is navigating using a keyboard or\n // if we have a top-level trigger which might cause focus to be lost\n // when clicking on the backdrop.\n if (this.restoreFocus) {\n if (!this._openedBy) {\n // Note that the focus style will show up both for `program` and\n // `keyboard` so we don't have to specify which one it is.\n this.focus()\n }\n // else if (!this.triggersSubmenu()) {\n // this.focus(this._openedBy)\n // }\n }\n\n this._openedBy = null\n }\n\n /** Returns a stream that emits whenever an action that should close the menu occurs. */\n private _menuClosingActions() {\n const backdrop = this._overlayRef?.backdropClick() ?? of()\n const detachments = this._overlayRef?.detachments() ?? of()\n // const parentClose = this._parentMenu ? this._parentMenu.closed : of()\n const parentClose = of()\n // const hover = this._parentMenu ? this._parentMenu._hovered().pipe(\n // filter(active => active !== this._menuItemInstance),\n // filter(() => this._menuOpen)\n // ) : of()\n const hover = of()\n\n return merge(backdrop, parentClose, hover, detachments)\n }\n\n}\n","import { animate, group, query, style, transition, trigger, useAnimation } from '@angular/animations'\nimport { FocusKeyManager, FocusOrigin } from '@angular/cdk/a11y'\nimport { coerceNumberProperty } from '@angular/cdk/coercion'\nimport { DOWN_ARROW, END, ESCAPE, hasModifierKey, HOME, LEFT_ARROW, RIGHT_ARROW, UP_ARROW } from '@angular/cdk/keycodes'\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n EventEmitter,\n forwardRef,\n Input,\n OnDestroy,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core'\nimport { BehaviorSubject, fromEvent, merge, Observable, of, Subject, Subscription } from 'rxjs'\n\nimport { distinctUntilChanged, map, startWith, switchMap, takeUntil } from 'rxjs/operators'\nimport { menuDropdownPanelIn, menuDropdownPanelOut, menuDropdownPanelSlideIn, menuDropdownPanelSlideOut } from './menu-animations'\nimport { MenuItemComponent } from './menu-item.component'\nimport { ITheSeamMenuPanel } from './menu-panel'\nimport { THESEAM_MENU_PANEL } from './menu-panel-token'\n\nimport { MenuFooterComponent } from './menu-footer/menu-footer.component'\nimport { MenuHeaderComponent } from './menu-header/menu-header.component'\n\nexport const LIB_MENU: any = {\n provide: THESEAM_MENU_PANEL,\n // tslint:disable-next-line:no-use-before-declare\n useExisting: forwardRef(() => MenuComponent)\n}\n\n@Component({\n selector: 'seam-menu',\n templateUrl: './menu.component.html',\n styleUrls: ['./menu.component.scss'],\n providers: [ LIB_MENU ],\n animations: [\n trigger('slideDown', [\n transition(':enter', useAnimation(menuDropdownPanelIn)),\n transition(':leave', useAnimation(menuDropdownPanelOut)),\n ])\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'seamMenu'\n})\nexport class MenuComponent implements OnDestroy, AfterContentInit, ITheSeamMenuPanel {\n\n private readonly _ngUnsubscribe = new Subject()\n\n private _footer = new BehaviorSubject<MenuFooterComponent | undefined | null>(undefined)\n public hasFooter$ = this._footer.pipe(map(v => v !== null && v !== undefined))\n\n private _header = new BehaviorSubject<MenuHeaderComponent | undefined | null>(undefined)\n public hasHeader$ = this._header.pipe(map(v => v !== null && v !== undefined))\n\n private _keyManager?: FocusKeyManager<MenuItemComponent>\n\n /** Menu items inside the current menu. */\n private _items: MenuItemComponent[] = []\n\n /** Emits whenever the amount of menu items changes. */\n private _itemChanges = new Subject<MenuItemComponent[]>()\n\n /** Subscription to tab events on the menu panel */\n private _tabSubscription = Subscription.EMPTY\n\n /** Parent menu of the current menu panel. */\n parentMenu: ITheSeamMenuPanel | undefined\n\n @ViewChild(TemplateRef) templateRef?: TemplateRef<any>\n\n @Output() readonly closed = new EventEmitter<void | 'click' | 'keydown' | 'tab'>()\n\n @Input() menuClass: string | undefined | null\n\n /**\n * Defines a width for a menu that will scale down if the window innerWidth is\n * smaller than the value.\n */\n @Input()\n get baseWidth() { return this._baseWidth.value }\n set baseWidth(value: number | null) {\n const _val = coerceNumberProperty(value, null)\n if (_val !== this._baseWidth.value) {\n this._baseWidth.next(_val)\n }\n }\n private _baseWidth = new BehaviorSubject<number | null>(null)\n _menuWidth$: Observable<string | undefined>\n\n @Input() animationType: 'slide' | 'fade' = 'slide'\n\n constructor() {\n this._menuWidth$ = this._baseWidth.pipe(\n switchMap(baseWidth => {\n if (baseWidth) {\n return fromEvent(window, 'resize').pipe(\n startWith(undefined),\n map(() => window.innerWidth < baseWidth ? `${window.innerWidth}px` : `${baseWidth}px`)\n )\n }\n return of(undefined)\n }),\n distinctUntilChanged(),\n takeUntil(this._ngUnsubscribe)\n )\n }\n\n ngOnDestroy() {\n this._tabSubscription.unsubscribe()\n this.closed.complete()\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n ngAfterContentInit() {\n this._keyManager = new FocusKeyManager<MenuItemComponent>(this._items).withWrap().withTypeAhead()\n this._tabSubscription = this._keyManager.tabOut.subscribe(() => this.closed.emit('tab'))\n }\n\n /** Stream that emits whenever the hovered menu item changes. */\n _hovered(): Observable<MenuItemComponent> {\n return this._itemChanges.pipe(\n startWith(this._items),\n switchMap(items => merge(...items.map(item => item._hovered)))\n )\n }\n\n /** Handle a keyboard event from the menu, delegating to the appropriate action. */\n _handleKeydown(event: KeyboardEvent) {\n // tslint:disable-next-line:deprecation\n const keyCode = event.keyCode\n const manager = this._keyManager\n\n switch (keyCode) {\n case ESCAPE:\n if (!hasModifierKey(event)) {\n event.preventDefault()\n this.closed.emit('keydown')\n }\n break\n // case LEFT_ARROW:\n // if (this.parentMenu && this.direction === 'ltr') {\n // this.closed.emit('keydown')\n // }\n // break\n // case RIGHT_ARROW:\n // if (this.parentMenu && this.direction === 'rtl') {\n // this.closed.emit('keydown')\n // }\n // break\n case HOME:\n case END:\n if (!hasModifierKey(event)) {\n keyCode === HOME ? manager?.setFirstItemActive() : manager?.setLastItemActive()\n event.preventDefault()\n }\n break\n default:\n if (keyCode === UP_ARROW || keyCode === DOWN_ARROW) {\n manager?.setFocusOrigin('keyboard')\n }\n\n manager?.onKeydown(event)\n }\n }\n\n /**\n * Focus the first item in the menu.\n * @param origin Action from which the focus originated. Used to set the correct styling.\n */\n focusFirstItem(origin: FocusOrigin = 'program'): void {\n this._keyManager?.setFocusOrigin(origin).setFirstItemActive()\n }\n\n /**\n * Resets the active item in the menu. This is used when the menu is opened, allowing\n * the user to start from the first option when pressing the down arrow.\n */\n resetActiveItem() {\n this._keyManager?.setActiveItem(-1)\n }\n\n /** Registers a menu item with the menu. */\n addItem(item: MenuItemComponent) {\n // We register the items through this method, rather than picking them up through\n // `ContentChildren`, because we need the items to be picked up by their closest\n // `seam-menu` ancestor. If we used `@ContentChildren(MenuItemComponent, {descendants: true})`,\n // all descendant items will bleed into the top-level menu in the case where the consumer\n // has `seam-menu` instances nested inside each other.\n if (this._items.indexOf(item) === -1) {\n this._items.push(item)\n this._itemChanges.next(this._items)\n }\n }\n\n /** Removes an item from the menu. */\n removeItem(item: MenuItemComponent) {\n const index = this._items.indexOf(item)\n\n if (this._items.indexOf(item) > -1) {\n this._items.splice(index, 1)\n this._itemChanges.next(this._items)\n }\n }\n\n /** Sets the footer component. */\n setFooter(footer?: MenuFooterComponent) {\n this._footer.next(footer)\n }\n\n /** Sets the header component. */\n setHeader(header?: MenuHeaderComponent) {\n this._header.next(header)\n }\n\n _dropdownMenuClick(event: Event) {\n // This is needed, because some menu's will get stuck open if the component\n // managing the menu is destroyed before the menu finishes its cleanup. I\n // may look for a fix to that eventually.\n this.closed.emit('click')\n }\n\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input } from '@angular/core'\n\n// TODO: Split up the button and anchor classes.\n\n@Component({\n // tslint:disable-next-line:component-selector\n selector: 'button[seamMenuFooterAction],a[seamMenuFooterAction]',\n templateUrl: './menu-footer-action.component.html',\n styleUrls: ['./menu-footer-action.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuFooterActionComponent {\n\n @HostBinding('attr.type') get _attrType() { return this.type }\n\n /** ARIA type for the button. */\n @Input()\n get type() { return this._isButton() ? this._type || 'button' : undefined }\n set type(value: 'button' | 'submit' | 'reset' | undefined | null) {\n this._type = value\n }\n private _type: 'button' | 'submit' | 'reset' | undefined | null\n\n @HostBinding('class.btn') get _classBtn() { return this._isButton() }\n @HostBinding('class.btn-link') get _classBtnLink() { return this._isButton() }\n\n @HostBinding('style.padding.px') get _stylePadding() { return this._isButton() && 0 }\n @HostBinding('style.border.px') get _styleBorder() { return this._isButton() && 0 }\n @HostBinding('style.display.px') get _styleDisplay() { return this._isButton() && 'inline' }\n\n constructor(\n private _elementRef: ElementRef\n ) { }\n\n /** Determines if the component host is a button. */\n protected _isButton() {\n return this._elementRef.nativeElement.nodeName.toLowerCase() === 'button'\n }\n\n /** Determines if the component host is an anchor. */\n protected _isAnchor() {\n return this._elementRef.nativeElement.nodeName.toLowerCase() === 'a'\n }\n\n}\n","import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, Optional } from '@angular/core'\n\nimport { MenuItemComponent } from '../menu-item.component'\nimport type { ITheSeamMenuPanel } from '../menu-panel'\nimport { THESEAM_MENU_PANEL } from '../menu-panel-token'\n\n@Component({\n selector: 'seam-menu-footer',\n templateUrl: './menu-footer.component.html',\n styleUrls: ['./menu-footer.component.scss'],\n host: {\n 'class': 'd-flex flex-column text-center bg-light border-top rounded-bottom py-2'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuFooterComponent implements OnInit, OnDestroy {\n\n constructor(\n @Inject(THESEAM_MENU_PANEL) @Optional() private _parentMenu?: ITheSeamMenuPanel<MenuItemComponent>\n ) { }\n\n ngOnInit() {\n if (this._parentMenu && this._parentMenu.setFooter) {\n this._parentMenu.setFooter(this)\n }\n }\n\n ngOnDestroy() {\n if (this._parentMenu && this._parentMenu.setFooter) {\n this._parentMenu.setFooter(undefined)\n }\n }\n\n}\n","import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, Optional } from '@angular/core'\n\nimport { MenuItemComponent } from '../menu-item.component'\nimport type { ITheSeamMenuPanel } from '../menu-panel'\nimport { THESEAM_MENU_PANEL } from '../menu-panel-token'\n\n@Component({\n selector: 'seam-menu-header',\n templateUrl: './menu-header.component.html',\n styleUrls: ['./menu-header.component.scss'],\n host: {\n 'class': 'd-flex flex-column bg-light border-bottom rounded-top py-2 mb-2'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuHeaderComponent implements OnInit, OnDestroy {\n\n constructor(\n @Inject(THESEAM_MENU_PANEL) @Optional() private _parentMenu?: ITheSeamMenuPanel<MenuItemComponent>\n ) { }\n\n ngOnInit() {\n if (this._parentMenu && this._parentMenu.setHeader) {\n this._parentMenu.setHeader(this)\n }\n }\n\n ngOnDestroy() {\n if (this._parentMenu && this._parentMenu.setHeader) {\n this._parentMenu.setHeader(undefined)\n }\n }\n\n}\n","import { OverlayModule } from '@angular/cdk/overlay'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { TheSeamIconModule } from '@theseam/ui-common/icon'\n\nimport { MenuDividerComponent } from './menu-divider.component'\nimport { MenuFooterActionComponent } from './menu-footer-action/menu-footer-action.component'\nimport { MenuFooterComponent } from './menu-footer/menu-footer.component'\nimport { MenuHeaderComponent } from './menu-header/menu-header.component'\nimport { MenuItemComponent } from './menu-item.component'\nimport { MenuToggleDirective } from './menu-toggle.directive'\nimport { MenuComponent } from './menu.component'\n\n@NgModule({\n declarations: [\n MenuComponent,\n MenuToggleDirective,\n MenuItemComponent,\n MenuDividerComponent,\n MenuFooterComponent,\n MenuFooterActionComponent,\n MenuHeaderComponent,\n ],\n imports: [\n CommonModule,\n OverlayModule,\n TheSeamIconModule\n ],\n exports: [\n MenuComponent,\n MenuToggleDirective,\n MenuItemComponent,\n MenuDividerComponent,\n\n TheSeamIconModule,\n OverlayModule,\n MenuFooterComponent,\n MenuFooterActionComponent,\n MenuHeaderComponent\n ]\n})\nexport class TheSeamMenuModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAEa,wBAAwB,GAAG,SAAS,CAAC;IAChD,KAAK,CAAC;QACJ,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,kBAAkB;KAC9B,CAAC;IACF,KAAK,CAAC;QACJ,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;KAC7D,CAAC;CACH,EAAC;MAEW,yBAAyB,GAAG,SAAS,CAAC;IACjD,KAAK,CAAC;QACJ,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,eAAe;KAC3B,CAAC;IACF,KAAK,CAAC;QACJ,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAC;KAChE,CAAC;CACH,EAAC;MAEW,yBAAyB,GAAG,SAAS,CAAC;IACjD,KAAK,CAAC;QACJ,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,YAAY;KACxB,CAAC;IACF,KAAK,CAAC;QACJ,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;KACxD,CAAC;CACH,EAAC;MAEW,0BAA0B,GAAG,SAAS,CAAC;IAClD,KAAK,CAAC;QACJ,OAAO,EAAE,CAAC;QACV,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;;;YA5B7B,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,aAAa;oBACb,mBAAmB;oBACnB,iBAAiB;oBACjB,oBAAoB;oBACpB,mBAAmB;oBACnB,yBAAyB;oBACzB,mBAAmB;iBACpB;gBACD,OAAO,EAAE;oBACP,YAAY;oBACZ,aAAa;oBACb,iBAAiB;iBAClB;gBACD,OAAO,EAAE;oBACP,aAAa;oBACb,mBAAmB;oBACnB,iBAAiB;oBACjB,oBAAoB;oBAEpB,iBAAiB;oBACjB,aAAa;oBACb,mBAAmB;oBACnB,yBAAyB;oBACzB,mBAAmB;iBACpB;aACF;;;ACzCD;;;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-menu.js","sources":["../../../projects/ui-common/menu/menu-animations.ts","../../../projects/ui-common/menu/menu-divider.component.ts","../../../projects/ui-common/menu/menu-panel-token.ts","../../../projects/ui-common/menu/menu-item.component.ts","../../../projects/ui-common/menu/menu-toggle.directive.ts","../../../projects/ui-common/menu/menu.component.ts","../../../projects/ui-common/menu/menu-footer-action/menu-footer-action.component.ts","../../../projects/ui-common/menu/menu-footer/menu-footer.component.ts","../../../projects/ui-common/menu/menu-header/menu-header.component.ts","../../../projects/ui-common/menu/menu.module.ts","../../../projects/ui-common/menu/theseam-ui-common-menu.ts"],"sourcesContent":["import { animate, animation, group, query, style, useAnimation } from '@angular/animations'\n\nexport const menuDropdownPanelSlideIn = animation([\n style({\n opacity: 0,\n transform: 'translateY(-70%)'\n }),\n group([\n animate('170ms linear', style({ opacity: 1 })),\n animate('220ms ease', style({ transform: 'translateY(0)' })),\n ])\n])\n\nexport const menuDropdownPanelSlideOut = animation([\n style({\n opacity: 1,\n transform: 'translateY(0)'\n }),\n group([\n animate('170ms linear', style({ opacity: 0 })),\n animate('220ms ease', style({ transform: 'translateY(-70%)' })),\n ])\n])\n\nexport const menuDropdownPanelExpandIn = animation([\n style({\n opacity: 0,\n transform: 'scale(0.8)'\n }),\n group([\n animate('100ms linear', style({ opacity: 1 })),\n animate('120ms ease', style({ transform: 'scale(1)' })),\n ])\n])\n\nexport const menuDropdownPanelExpandOut = animation([\n style({\n opacity: 1,\n transform: 'scale(1)'\n }),\n group([\n animate('100ms linear', style({ opacity: 0 })),\n animate('120ms ease', style({ transform: 'scale(0.8)' })),\n ])\n])\n\nexport const menuDropdownPanelFadeIn = animation([\n style({ transform: 'translateY(-30px)', opacity: '0' }),\n animate('250ms', style({ transform: 'translateY(0)', opacity: '1' }))\n])\n\nexport const menuDropdownPanelFadeOut = animation([\n style({ transform: 'translateY(0)', opacity: '1' }),\n animate('250ms', style({ transform: 'translateY(-30px)', opacity: '0' }))\n])\n\nexport const menuDropdownPanelIn = animation([\n query('.seam-menu-container.seam-menu-anim--slide .dropdown-menu', useAnimation(menuDropdownPanelSlideIn), { optional: true }),\n query('.seam-menu-container.seam-menu-anim--fade .dropdown-menu', useAnimation(menuDropdownPanelFadeIn), { optional: true })\n])\n\nexport const menuDropdownPanelOut = animation([\n query('.seam-menu-container.seam-menu-anim--slide .dropdown-menu', useAnimation(menuDropdownPanelSlideOut), { optional: true }),\n query('.seam-menu-container.seam-menu-anim--fade .dropdown-menu', useAnimation(menuDropdownPanelFadeOut), { optional: true })\n])\n","import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: 'seam-menu-divider',\n template: ``,\n styles: [],\n // tslint:disable-next-line:use-host-property-decorator\n host: {\n 'class': 'dropdown-divider d-block'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuDividerComponent { }\n","import { InjectionToken } from '@angular/core'\n\nimport { ITheSeamMenuPanel } from './menu-panel'\n\n/**\n * Injection token used to provide the parent menu to menu-specific components.\n */\nexport const THESEAM_MENU_PANEL = new InjectionToken<ITheSeamMenuPanel>('THESEAM_MENU_PANEL')\n","import { FocusableOption, FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'\nimport { DOCUMENT } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, ElementRef, HostListener, Inject, Input, OnDestroy, OnInit, Optional } from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { CanDisableCtor, mixinDisabled } from '@theseam/ui-common/core'\nimport { SeamIcon } from '@theseam/ui-common/icon'\n\nimport type { ITheSeamMenuPanel } from './menu-panel'\nimport { THESEAM_MENU_PANEL } from './menu-panel-token'\n\nclass TheSeamMenuItemBase {}\n\nconst _seamMenuItemMixinBase: CanDisableCtor & typeof TheSeamMenuItemBase =\n mixinDisabled(TheSeamMenuItemBase)\n\n@Component({\n // tslint:disable-next-line:component-selector\n selector: '[seamMenuItem]',\n templateUrl: './menu-item.component.html',\n styleUrls: ['./menu-item.component.scss'],\n exportAs: 'seamMenuItem',\n // tslint:disable-next-line:use-input-property-decorator\n inputs: [ 'disabled' ],\n // tslint:disable-next-line:use-host-property-decorator\n host: {\n '[attr.role]': 'role',\n 'class': 'dropdown-item',\n '[attr.tabindex]': '_getTabIndex()',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuItemComponent extends _seamMenuItemMixinBase implements OnInit, OnDestroy, FocusableOption {\n\n /** ARIA role for the menu item. */\n @Input() role: 'menuitem' | 'menuitemradio' | 'menuitemcheckbox' | undefined | null = 'menuitem'\n\n @Input() icon: SeamIcon | string | undefined | null\n @Input() iconClass: string | undefined | null\n\n @Input() badgeText: string | undefined | null\n @Input() badgeTheme: string | undefined | null = 'danger'\n\n /** Stream that emits when the menu item is hovered. */\n readonly _hovered: Subject<MenuItemComponent> = new Subject<MenuItemComponent>()\n\n /** Whether the menu item is highlighted. */\n _highlighted = false\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) public document: any,\n private _focusMonitor: FocusMonitor,\n @Inject(THESEAM_MENU_PANEL) @Optional() private _parentMenu?: ITheSeamMenuPanel<MenuItemComponent>\n ) {\n super()\n\n if (_focusMonitor) {\n // Start monitoring the element so it gets the appropriate focused classes. We want\n // to show the focus style for menu items only when the focus was not caused by a\n // mouse or touch interaction.\n _focusMonitor.monitor(this._elementRef, false)\n }\n\n // console.log(this._parentMenu)\n if (_parentMenu && _parentMenu.addItem) {\n _parentMenu.addItem(this)\n }\n }\n\n ngOnInit() { }\n\n ngOnDestroy() {\n if (this._focusMonitor) {\n this._focusMonitor.stopMonitoring(this._elementRef)\n }\n\n if (this._parentMenu && this._parentMenu.removeItem) {\n this._parentMenu.removeItem(this)\n }\n\n this._hovered.complete()\n }\n\n /** Focuses the menu item. */\n focus(origin: FocusOrigin = 'program'): void {\n if (this._focusMonitor) {\n this._focusMonitor.focusVia(this._getHostElement(), origin)\n } else {\n this._getHostElement().focus()\n }\n }\n\n /** Used to set the `tabindex`. */\n _getTabIndex(): string {\n return this.disabled ? '-1' : '0'\n }\n\n /** Returns the host DOM element. */\n _getHostElement(): HTMLElement {\n return this._elementRef.nativeElement\n }\n\n /** Prevents the default element actions if it is disabled. */\n @HostListener('click', ['$event'])\n _checkDisabled(event: Event): void {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n /** Emits to the hover stream. */\n @HostListener('mouseenter')\n _handleMouseEnter() {\n this._hovered.next(this)\n }\n\n /** Gets the label to be used when determining whether the option should be focused. */\n getLabel(): string {\n const element: HTMLElement = this._elementRef.nativeElement\n const textNodeType = this.document ? this.document.TEXT_NODE : 3\n let output = ''\n\n if (element.childNodes) {\n const length = element.childNodes.length\n\n // Go through all the top-level text nodes and extract their text.\n // We skip anything that's not a text node to prevent the text from\n // being thrown off by something like an icon.\n for (let i = 0; i < length; i++) {\n if (element.childNodes[i].nodeType === textNodeType) {\n output += element.childNodes[i].textContent\n }\n }\n }\n\n return output.trim()\n }\n\n}\n","import { FocusMonitor, FocusOrigin, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y'\nimport { DOWN_ARROW, ESCAPE, UP_ARROW } from '@angular/cdk/keycodes'\nimport { ConnectionPositionPair, Overlay, OverlayRef, PositionStrategy } from '@angular/cdk/overlay'\nimport { normalizePassiveListenerOptions } from '@angular/cdk/platform'\nimport { TemplatePortal } from '@angular/cdk/portal'\nimport { Directive, ElementRef, HostListener, Inject, Input, OnDestroy, Optional, ViewContainerRef } from '@angular/core'\nimport { merge, of, Subscription } from 'rxjs'\n\nimport { MenuItemComponent } from './menu-item.component'\nimport { ITheSeamMenuPanel } from './menu-panel'\nimport { THESEAM_MENU_PANEL } from './menu-panel-token'\nimport { MenuComponent } from './menu.component'\n\n/** Options for binding a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true})\n\n@Directive({\n selector: '[seamMenuToggle]',\n // tslint:disable-next-line:use-host-property-decorator\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'menuOpen() || null'\n },\n exportAs: 'seamMenuToggle'\n})\nexport class MenuToggleDirective implements OnDestroy {\n\n private _active = false\n private _overlayRef?: OverlayRef\n private _menuClosedSubscription = Subscription.EMPTY\n private _closingActionsSubscription = Subscription.EMPTY\n\n public restoreFocus = true\n\n // Tracking input type is necessary so it's possible to only auto-focus\n // the first item of the list when the menu is opened via the keyboard\n _openedBy: 'mouse' | 'touch' | null = null\n\n @Input() seamMenuToggle: MenuComponent | undefined | null\n\n @Input()\n set positions(val: ConnectionPositionPair[]) {\n this._positions = val\n if (this.menuOpen()) {\n this._overlayRef?.updatePositionStrategy(this.getOverlayPosition(this._elementRef.nativeElement))\n }\n }\n get positions() { return this._positions }\n private _positions: ConnectionPositionPair[] = [\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n },\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n },\n {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n ]\n\n @HostListener('mousedown', [ '$event' ])\n _onMouseDown(event: MouseEvent) {\n if (!isFakeMousedownFromScreenReader(event)) {\n // Since right or middle button clicks won't trigger the `click` event,\n // we shouldn't consider the menu as opened by mouse in those cases.\n this._openedBy = event.button === 0 ? 'mouse' : null\n\n // Since clicking on the trigger won't close the menu if it opens a sub-menu,\n // we should prevent focus from moving onto it via click to avoid the\n // highlight from lingering on the menu item.\n // if (this.triggersSubmenu()) {\n // event.preventDefault();\n // }\n }\n }\n\n @HostListener('keydown', [ '$event' ])\n _onKeydown(event: any) {\n this._openedBy = null\n\n // tslint:disable-next-line:deprecation\n const keyCode = event.keyCode\n\n if (keyCode === UP_ARROW || keyCode === DOWN_ARROW) {\n if (this.menuOpen()) {\n this.seamMenuToggle?.focusFirstItem(this._openedBy || 'program')\n }\n }\n }\n\n @HostListener('click', [ '$event' ])\n _onClick(event: any) {\n this.toggle()\n }\n\n @HostListener('document:keydown', [ '$event' ])\n _onDocumentKeydown(event: any) {\n if (event.keyCode === ESCAPE) {\n this.closeMenu()\n }\n }\n\n // @HostListener('document:mousedown', [ '$event' ])\n // _onDocumentMouseDown(event: any) {\n // console.log('outside click')\n // }\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _viewContainerRef: ViewContainerRef,\n private _overlay: Overlay,\n private _focusMonitor: FocusMonitor,\n // @Inject(THESEAM_MENU_PANEL) @Optional() private _parentMenu?: ITheSeamMenuPanel<MenuItemComponent>\n ) {\n this._elementRef.nativeElement.addEventListener('touchstart', this._handleTouchStart,\n passiveEventListenerOptions)\n }\n\n ngOnDestroy() {\n this.closeMenu()\n\n this._elementRef.nativeElement.removeEventListener('touchstart', this._handleTouchStart,\n passiveEventListenerOptions)\n\n this._menuClosedSubscription.unsubscribe()\n this._closingActionsSubscription.unsubscribe()\n }\n\n /**\n * Handles touch start events on the trigger.\n * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.\n */\n private _handleTouchStart = () => this._openedBy = 'touch'\n\n public toggle(): void {\n if (this._active) {\n this.closeMenu()\n } else {\n this.openMenu()\n }\n }\n\n public openMenu(): void {\n if (this._active || !this.seamMenuToggle) { return }\n this._active = true\n\n this._overlayRef = this._overlay.create({\n hasBackdrop: true,\n backdropClass: 'transparent',\n positionStrategy: this.getOverlayPosition(this._elementRef.nativeElement),\n })\n\n const tpl = this.seamMenuToggle.templateRef\n if (!tpl) {\n throw Error(`Menu template not found.`)\n }\n\n this._overlayRef.attach(new TemplatePortal(tpl, this._viewContainerRef))\n\n this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this.closeMenu())\n this._initMenu()\n\n this._menuClosedSubscription = this.seamMenuToggle.closed.subscribe(v => {\n // console.log('closed', v)\n this.closeMenu()\n })\n\n // this._overlayRef.backdropClick().subscribe(v => {\n // console.log('backdropClick', v)\n // })\n }\n\n public closeMenu(): void {\n if (!this._active) { return }\n\n if (this._overlayRef?.hasAttached()) {\n this._overlayRef?.detach()\n }\n\n this._resetMenu()\n\n this._elementRef.nativeElement.removeEventListener('touchstart', this._handleTouchStart,\n passiveEventListenerOptions)\n\n this._menuClosedSubscription.unsubscribe()\n this._closingActionsSubscription.unsubscribe()\n\n this._active = false\n }\n\n public menuOpen(): boolean {\n return (this._overlayRef && this._overlayRef.hasAttached()) ?? false\n }\n\n private getOverlayPosition(origin: HTMLElement): PositionStrategy {\n const positionStrategy = this._overlay.position()\n .flexibleConnectedTo(origin)\n .withPositions(this.positions)\n .withFlexibleDimensions(false)\n .withPush(true)\n\n return positionStrategy\n }\n\n /**\n * Focuses the menu trigger.\n * @param origin Source of the menu trigger's focus.\n */\n focus(origin: FocusOrigin = 'program') {\n if (this._focusMonitor) {\n this._focusMonitor.focusVia(this._elementRef, origin)\n } else {\n this._elementRef.nativeElement.focus()\n }\n }\n\n /**\n * This method sets the menu state to open and focuses the first item if\n * the menu was opened via the keyboard.\n */\n private _initMenu(): void {\n // this.seamMenuToggle.parentMenu = this.triggersSubmenu() ? this._parentMenu : undefined\n // this.seamMenuToggle.direction = this.dir\n // this._setMenuElevation()\n // this._setIsMenuOpen(true)\n // this.seamMenuToggle.focusFirstItem(this._openedBy || 'program')\n }\n\n /**\n * This method resets the menu when it's closed, most importantly restoring\n * focus to the menu trigger if the menu was opened via the keyboard.\n */\n private _resetMenu(): void {\n // this._setIsMenuOpen(false)\n\n // We should reset focus if the user is navigating using a keyboard or\n // if we have a top-level trigger which might cause focus to be lost\n // when clicking on the backdrop.\n if (this.restoreFocus) {\n if (!this._openedBy) {\n // Note that the focus style will show up both for `program` and\n // `keyboard` so we don't have to specify which one it is.\n this.focus()\n }\n // else if (!this.triggersSubmenu()) {\n // this.focus(this._openedBy)\n // }\n }\n\n this._openedBy = null\n }\n\n /** Returns a stream that emits whenever an action that should close the menu occurs. */\n private _menuClosingActions() {\n const backdrop = this._overlayRef?.backdropClick() ?? of()\n const detachments = this._overlayRef?.detachments() ?? of()\n // const parentClose = this._parentMenu ? this._parentMenu.closed : of()\n const parentClose = of()\n // const hover = this._parentMenu ? this._parentMenu._hovered().pipe(\n // filter(active => active !== this._menuItemInstance),\n // filter(() => this._menuOpen)\n // ) : of()\n const hover = of()\n\n return merge(backdrop, parentClose, hover, detachments)\n }\n\n}\n","import { animate, group, query, style, transition, trigger, useAnimation } from '@angular/animations'\nimport { FocusKeyManager, FocusOrigin } from '@angular/cdk/a11y'\nimport { coerceNumberProperty } from '@angular/cdk/coercion'\nimport { DOWN_ARROW, END, ESCAPE, hasModifierKey, HOME, LEFT_ARROW, RIGHT_ARROW, UP_ARROW } from '@angular/cdk/keycodes'\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n EventEmitter,\n forwardRef,\n Input,\n OnDestroy,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core'\nimport { BehaviorSubject, fromEvent, merge, Observable, of, Subject, Subscription } from 'rxjs'\n\nimport { distinctUntilChanged, map, startWith, switchMap, takeUntil } from 'rxjs/operators'\nimport { menuDropdownPanelIn, menuDropdownPanelOut, menuDropdownPanelSlideIn, menuDropdownPanelSlideOut } from './menu-animations'\nimport { MenuItemComponent } from './menu-item.component'\nimport { ITheSeamMenuPanel } from './menu-panel'\nimport { THESEAM_MENU_PANEL } from './menu-panel-token'\n\nimport { MenuFooterComponent } from './menu-footer/menu-footer.component'\nimport { MenuHeaderComponent } from './menu-header/menu-header.component'\n\nexport const LIB_MENU: any = {\n provide: THESEAM_MENU_PANEL,\n // tslint:disable-next-line:no-use-before-declare\n useExisting: forwardRef(() => MenuComponent)\n}\n\n@Component({\n selector: 'seam-menu',\n templateUrl: './menu.component.html',\n styleUrls: ['./menu.component.scss'],\n providers: [ LIB_MENU ],\n animations: [\n trigger('slideDown', [\n transition(':enter', useAnimation(menuDropdownPanelIn)),\n transition(':leave', useAnimation(menuDropdownPanelOut)),\n ])\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'seamMenu'\n})\nexport class MenuComponent implements OnDestroy, AfterContentInit, ITheSeamMenuPanel {\n\n private readonly _ngUnsubscribe = new Subject()\n\n private _footer = new BehaviorSubject<MenuFooterComponent | undefined | null>(undefined)\n public hasFooter$ = this._footer.pipe(map(v => v !== null && v !== undefined))\n\n private _header = new BehaviorSubject<MenuHeaderComponent | undefined | null>(undefined)\n public hasHeader$ = this._header.pipe(map(v => v !== null && v !== undefined))\n\n private _keyManager?: FocusKeyManager<MenuItemComponent>\n\n /** Menu items inside the current menu. */\n private _items: MenuItemComponent[] = []\n\n /** Emits whenever the amount of menu items changes. */\n private _itemChanges = new Subject<MenuItemComponent[]>()\n\n /** Subscription to tab events on the menu panel */\n private _tabSubscription = Subscription.EMPTY\n\n /** Parent menu of the current menu panel. */\n parentMenu: ITheSeamMenuPanel | undefined\n\n @ViewChild(TemplateRef) templateRef?: TemplateRef<any>\n\n @Output() readonly closed = new EventEmitter<void | 'click' | 'keydown' | 'tab'>()\n\n @Input() menuClass: string | undefined | null\n\n /**\n * Defines a width for a menu that will scale down if the window innerWidth is\n * smaller than the value.\n */\n @Input()\n get baseWidth() { return this._baseWidth.value }\n set baseWidth(value: number | null) {\n const _val = coerceNumberProperty(value, null)\n if (_val !== this._baseWidth.value) {\n this._baseWidth.next(_val)\n }\n }\n private _baseWidth = new BehaviorSubject<number | null>(null)\n _menuWidth$: Observable<string | undefined>\n\n @Input() animationType: 'slide' | 'fade' = 'slide'\n\n constructor() {\n this._menuWidth$ = this._baseWidth.pipe(\n switchMap(baseWidth => {\n if (baseWidth) {\n return fromEvent(window, 'resize').pipe(\n startWith(undefined),\n map(() => window.innerWidth < baseWidth ? `${window.innerWidth}px` : `${baseWidth}px`)\n )\n }\n return of(undefined)\n }),\n distinctUntilChanged(),\n takeUntil(this._ngUnsubscribe)\n )\n }\n\n ngOnDestroy() {\n this._tabSubscription.unsubscribe()\n this.closed.complete()\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n ngAfterContentInit() {\n this._keyManager = new FocusKeyManager<MenuItemComponent>(this._items).withWrap().withTypeAhead()\n this._tabSubscription = this._keyManager.tabOut.subscribe(() => this.closed.emit('tab'))\n }\n\n /** Stream that emits whenever the hovered menu item changes. */\n _hovered(): Observable<MenuItemComponent> {\n return this._itemChanges.pipe(\n startWith(this._items),\n switchMap(items => merge(...items.map(item => item._hovered)))\n )\n }\n\n /** Handle a keyboard event from the menu, delegating to the appropriate action. */\n _handleKeydown(event: KeyboardEvent) {\n // tslint:disable-next-line:deprecation\n const keyCode = event.keyCode\n const manager = this._keyManager\n\n switch (keyCode) {\n case ESCAPE:\n if (!hasModifierKey(event)) {\n event.preventDefault()\n this.closed.emit('keydown')\n }\n break\n // case LEFT_ARROW:\n // if (this.parentMenu && this.direction === 'ltr') {\n // this.closed.emit('keydown')\n // }\n // break\n // case RIGHT_ARROW:\n // if (this.parentMenu && this.direction === 'rtl') {\n // this.closed.emit('keydown')\n // }\n // break\n case HOME:\n case END:\n if (!hasModifierKey(event)) {\n keyCode === HOME ? manager?.setFirstItemActive() : manager?.setLastItemActive()\n event.preventDefault()\n }\n break\n default:\n if (keyCode === UP_ARROW || keyCode === DOWN_ARROW) {\n manager?.setFocusOrigin('keyboard')\n }\n\n manager?.onKeydown(event)\n }\n }\n\n /**\n * Focus the first item in the menu.\n * @param origin Action from which the focus originated. Used to set the correct styling.\n */\n focusFirstItem(origin: FocusOrigin = 'program'): void {\n this._keyManager?.setFocusOrigin(origin).setFirstItemActive()\n }\n\n /**\n * Resets the active item in the menu. This is used when the menu is opened, allowing\n * the user to start from the first option when pressing the down arrow.\n */\n resetActiveItem() {\n this._keyManager?.setActiveItem(-1)\n }\n\n /** Registers a menu item with the menu. */\n addItem(item: MenuItemComponent) {\n // We register the items through this method, rather than picking them up through\n // `ContentChildren`, because we need the items to be picked up by their closest\n // `seam-menu` ancestor. If we used `@ContentChildren(MenuItemComponent, {descendants: true})`,\n // all descendant items will bleed into the top-level menu in the case where the consumer\n // has `seam-menu` instances nested inside each other.\n if (this._items.indexOf(item) === -1) {\n this._items.push(item)\n this._itemChanges.next(this._items)\n }\n }\n\n /** Removes an item from the menu. */\n removeItem(item: MenuItemComponent) {\n const index = this._items.indexOf(item)\n\n if (this._items.indexOf(item) > -1) {\n this._items.splice(index, 1)\n this._itemChanges.next(this._items)\n }\n }\n\n /** Sets the footer component. */\n setFooter(footer?: MenuFooterComponent) {\n this._footer.next(footer)\n }\n\n /** Sets the header component. */\n setHeader(header?: MenuHeaderComponent) {\n this._header.next(header)\n }\n\n _dropdownMenuClick(event: Event) {\n // This is needed, because some menu's will get stuck open if the component\n // managing the menu is destroyed before the menu finishes its cleanup. I\n // may look for a fix to that eventually.\n this.closed.emit('click')\n }\n\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input } from '@angular/core'\n\n// TODO: Split up the button and anchor classes.\n\n@Component({\n // tslint:disable-next-line:component-selector\n selector: 'button[seamMenuFooterAction],a[seamMenuFooterAction]',\n templateUrl: './menu-footer-action.component.html',\n styleUrls: ['./menu-footer-action.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuFooterActionComponent {\n\n @HostBinding('attr.type') get _attrType() { return this.type }\n\n /** ARIA type for the button. */\n @Input()\n get type() { return this._isButton() ? this._type || 'button' : undefined }\n set type(value: 'button' | 'submit' | 'reset' | undefined | null) {\n this._type = value\n }\n private _type: 'button' | 'submit' | 'reset' | undefined | null\n\n @HostBinding('class.btn') get _classBtn() { return this._isButton() }\n @HostBinding('class.btn-link') get _classBtnLink() { return this._isButton() }\n\n @HostBinding('style.padding.px') get _stylePadding() { return this._isButton() && 0 }\n @HostBinding('style.border.px') get _styleBorder() { return this._isButton() && 0 }\n @HostBinding('style.display.px') get _styleDisplay() { return this._isButton() && 'inline' }\n\n constructor(\n private _elementRef: ElementRef\n ) { }\n\n /** Determines if the component host is a button. */\n protected _isButton() {\n return this._elementRef.nativeElement.nodeName.toLowerCase() === 'button'\n }\n\n /** Determines if the component host is an anchor. */\n protected _isAnchor() {\n return this._elementRef.nativeElement.nodeName.toLowerCase() === 'a'\n }\n\n}\n","import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, Optional } from '@angular/core'\n\nimport { MenuItemComponent } from '../menu-item.component'\nimport type { ITheSeamMenuPanel } from '../menu-panel'\nimport { THESEAM_MENU_PANEL } from '../menu-panel-token'\n\n@Component({\n selector: 'seam-menu-footer',\n templateUrl: './menu-footer.component.html',\n styleUrls: ['./menu-footer.component.scss'],\n host: {\n 'class': 'd-flex flex-column text-center bg-light border-top rounded-bottom py-2'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuFooterComponent implements OnInit, OnDestroy {\n\n constructor(\n @Inject(THESEAM_MENU_PANEL) @Optional() private _parentMenu?: ITheSeamMenuPanel<MenuItemComponent>\n ) { }\n\n ngOnInit() {\n if (this._parentMenu && this._parentMenu.setFooter) {\n this._parentMenu.setFooter(this)\n }\n }\n\n ngOnDestroy() {\n if (this._parentMenu && this._parentMenu.setFooter) {\n this._parentMenu.setFooter(undefined)\n }\n }\n\n}\n","import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, Optional } from '@angular/core'\n\nimport { MenuItemComponent } from '../menu-item.component'\nimport type { ITheSeamMenuPanel } from '../menu-panel'\nimport { THESEAM_MENU_PANEL } from '../menu-panel-token'\n\n@Component({\n selector: 'seam-menu-header',\n templateUrl: './menu-header.component.html',\n styleUrls: ['./menu-header.component.scss'],\n host: {\n 'class': 'd-flex flex-column bg-light border-bottom rounded-top py-2 mb-2'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MenuHeaderComponent implements OnInit, OnDestroy {\n\n constructor(\n @Inject(THESEAM_MENU_PANEL) @Optional() private _parentMenu?: ITheSeamMenuPanel<MenuItemComponent>\n ) { }\n\n ngOnInit() {\n if (this._parentMenu && this._parentMenu.setHeader) {\n this._parentMenu.setHeader(this)\n }\n }\n\n ngOnDestroy() {\n if (this._parentMenu && this._parentMenu.setHeader) {\n this._parentMenu.setHeader(undefined)\n }\n }\n\n}\n","import { OverlayModule } from '@angular/cdk/overlay'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { TheSeamIconModule } from '@theseam/ui-common/icon'\n\nimport { MenuDividerComponent } from './menu-divider.component'\nimport { MenuFooterActionComponent } from './menu-footer-action/menu-footer-action.component'\nimport { MenuFooterComponent } from './menu-footer/menu-footer.component'\nimport { MenuHeaderComponent } from './menu-header/menu-header.component'\nimport { MenuItemComponent } from './menu-item.component'\nimport { MenuToggleDirective } from './menu-toggle.directive'\nimport { MenuComponent } from './menu.component'\n\n@NgModule({\n declarations: [\n MenuComponent,\n MenuToggleDirective,\n MenuItemComponent,\n MenuDividerComponent,\n MenuFooterComponent,\n MenuFooterActionComponent,\n MenuHeaderComponent,\n ],\n imports: [\n CommonModule,\n OverlayModule,\n TheSeamIconModule\n ],\n exports: [\n MenuComponent,\n MenuToggleDirective,\n MenuItemComponent,\n MenuDividerComponent,\n\n TheSeamIconModule,\n OverlayModule,\n MenuFooterComponent,\n MenuFooterActionComponent,\n MenuHeaderComponent\n ]\n})\nexport class TheSeamMenuModule { }\n","/**\n * Gener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;YA5B7B,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,aAAa;oBACb,mBAAmB;oBACnB,iBAAiB;oBACjB,oBAAoB;oBACpB,mBAAmB;oBACnB,yBAAyB;oBACzB,mBAAmB;iBACpB;gBACD,OAAO,EAAE;oBACP,YAAY;oBACZ,aAAa;oBACb,iBAAiB;iBAClB;gBACD,OAAO,EAAE;oBACP,aAAa;oBACb,mBAAmB;oBACnB,iBAAiB;oBACjB,oBAAoB;oBAEpB,iBAAiB;oBACjB,aAAa;oBACb,mBAAmB;oBACnB,yBAAyB;oBACzB,mBAAmB;iBACpB;aACF;;;ACzCD;;;;;;"}
@@ -43,7 +43,23 @@ class ModalRef {
43
43
  }
44
44
  });
45
45
  // NOTE: For current bootstrap style modal
46
- _overlayRef.overlayElement.addEventListener('click', _bootstrapBackdropClickListener);
46
+ // Replaced click event because it was easy to accidentally close
47
+ // the dialog by mousing down inside the modal and mousing up outside
48
+ // (like when dragging a map, selecting text, etc)
49
+ let clickStarted = false;
50
+ _overlayRef.overlayElement.addEventListener('mousedown', (event) => {
51
+ // @ts-ignore
52
+ if (!this._isModalMouseEvent(event.path)) {
53
+ clickStarted = true;
54
+ }
55
+ });
56
+ _overlayRef.overlayElement.addEventListener('mouseup', (event) => {
57
+ // @ts-ignore
58
+ if (clickStarted && !this._isModalMouseEvent(event.path)) {
59
+ clickStarted = false;
60
+ _bootstrapBackdropClickListener();
61
+ }
62
+ }, {});
47
63
  }
48
64
  this.beforeClosed().subscribe(() => {
49
65
  this._overlayRef.detachBackdrop();
@@ -138,6 +154,10 @@ class ModalRef {
138
154
  afterClosed() {
139
155
  return this._containerInstance._afterExit.pipe(map(() => this._result));
140
156
  }
157
+ // TODO: pull container name in from element, to protect against changes
158
+ _isModalMouseEvent(path) {
159
+ return path.findIndex(p => p.localName === 'seam-modal-container') !== -1;
160
+ }
141
161
  }
142
162
 
143
163
  /**