@theseam/ui-common 0.4.1 → 0.4.2

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 (56) hide show
  1. package/esm2020/datatable/datatable-action-menu/datatable-action-menu.component.mjs +1 -1
  2. package/esm2020/datatable/datatable-column-preferences-button/datatable-column-preferences-button.component.mjs +1 -1
  3. package/esm2020/datatable/datatable-export-button/datatable-export-button.component.mjs +1 -1
  4. package/esm2020/datatable-dynamic/datatable-dynamic-action-menu/datatable-dynamic-action-menu.component.mjs +1 -1
  5. package/esm2020/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.mjs +1 -1
  6. package/esm2020/framework/top-bar/top-bar.component.mjs +1 -1
  7. package/esm2020/google-maps/google-maps/google-maps.component.mjs +32 -8
  8. package/esm2020/google-maps/google-maps-feature-helpers.mjs +13 -1
  9. package/esm2020/google-maps/google-maps.module.mjs +4 -2
  10. package/esm2020/google-maps/google-maps.service.mjs +96 -25
  11. package/esm2020/menu/menu-item.component.mjs +43 -15
  12. package/esm2020/menu/menu-toggle.directive.mjs +202 -43
  13. package/esm2020/menu/menu.component.mjs +37 -14
  14. package/esm2020/utils/geo-json/close-polygons.mjs +38 -0
  15. package/esm2020/utils/public-api.mjs +2 -1
  16. package/esm2020/widget/widget/widget.component.mjs +54 -33
  17. package/fesm2015/theseam-ui-common-datatable-dynamic.mjs +1 -1
  18. package/fesm2015/theseam-ui-common-datatable-dynamic.mjs.map +1 -1
  19. package/fesm2015/theseam-ui-common-datatable.mjs +3 -3
  20. package/fesm2015/theseam-ui-common-datatable.mjs.map +1 -1
  21. package/fesm2015/theseam-ui-common-framework.mjs +2 -2
  22. package/fesm2015/theseam-ui-common-framework.mjs.map +1 -1
  23. package/fesm2015/theseam-ui-common-google-maps.mjs +138 -28
  24. package/fesm2015/theseam-ui-common-google-maps.mjs.map +1 -1
  25. package/fesm2015/theseam-ui-common-menu.mjs +442 -228
  26. package/fesm2015/theseam-ui-common-menu.mjs.map +1 -1
  27. package/fesm2015/theseam-ui-common-utils.mjs +39 -1
  28. package/fesm2015/theseam-ui-common-utils.mjs.map +1 -1
  29. package/fesm2015/theseam-ui-common-widget.mjs +53 -32
  30. package/fesm2015/theseam-ui-common-widget.mjs.map +1 -1
  31. package/fesm2020/theseam-ui-common-datatable-dynamic.mjs +1 -1
  32. package/fesm2020/theseam-ui-common-datatable-dynamic.mjs.map +1 -1
  33. package/fesm2020/theseam-ui-common-datatable.mjs +3 -3
  34. package/fesm2020/theseam-ui-common-datatable.mjs.map +1 -1
  35. package/fesm2020/theseam-ui-common-framework.mjs +2 -2
  36. package/fesm2020/theseam-ui-common-framework.mjs.map +1 -1
  37. package/fesm2020/theseam-ui-common-google-maps.mjs +141 -32
  38. package/fesm2020/theseam-ui-common-google-maps.mjs.map +1 -1
  39. package/fesm2020/theseam-ui-common-menu.mjs +432 -225
  40. package/fesm2020/theseam-ui-common-menu.mjs.map +1 -1
  41. package/fesm2020/theseam-ui-common-utils.mjs +39 -1
  42. package/fesm2020/theseam-ui-common-utils.mjs.map +1 -1
  43. package/fesm2020/theseam-ui-common-widget.mjs +53 -32
  44. package/fesm2020/theseam-ui-common-widget.mjs.map +1 -1
  45. package/google-maps/google-maps/google-maps.component.d.ts +8 -1
  46. package/google-maps/google-maps-feature-helpers.d.ts +3 -0
  47. package/google-maps/google-maps.module.d.ts +1 -1
  48. package/google-maps/google-maps.service.d.ts +7 -0
  49. package/menu/menu-item.component.d.ts +20 -9
  50. package/menu/menu-toggle.directive.d.ts +34 -11
  51. package/menu/menu.component.d.ts +16 -2
  52. package/package.json +1 -1
  53. package/utils/geo-json/close-polygons.d.ts +9 -0
  54. package/utils/public-api.d.ts +1 -0
  55. package/widget/widget/widget.component.d.ts +10 -11
  56. package/widget/widget/widget.component.scss +12 -1
@@ -43,6 +43,18 @@ function isFeatureSelected(feature) {
43
43
  function setFeatureSelected(feature, isSelected) {
44
44
  feature.setProperty(AppFeaturePropertyName.IsSelected, isSelected);
45
45
  }
46
+ const EXTERNAL_FEATURE_DEFINED_STYLE_OPTIONS_PROPERTY_NAME = 'styleOptions';
47
+ const EXTERNAL_FEATURE_DEFINED_STYLE_OPTIONS_HOVERED_PROPERTY_NAME = 'styleOptionsHovered';
48
+ const EXTERNAL_FEATURE_DEFINED_STYLE_OPTIONS_SELECTED_PROPERTY_NAME = 'styleOptionsSelected';
49
+ function getStyleOptionsDefinedByFeature(feature) {
50
+ return feature.getProperty(EXTERNAL_FEATURE_DEFINED_STYLE_OPTIONS_PROPERTY_NAME) || undefined;
51
+ }
52
+ function getHoveredStyleOptionsDefinedByFeature(feature) {
53
+ return feature.getProperty(EXTERNAL_FEATURE_DEFINED_STYLE_OPTIONS_HOVERED_PROPERTY_NAME) || undefined;
54
+ }
55
+ function getSelectedStyleOptionsDefinedByFeature(feature) {
56
+ return feature.getProperty(EXTERNAL_FEATURE_DEFINED_STYLE_OPTIONS_SELECTED_PROPERTY_NAME) || undefined;
57
+ }
46
58
  // TODO: Check performance of cloning a google.maps.Data instance, so the
47
59
  // properties can be removed with the google maps api, instead of on the
48
60
  // resulting json.
@@ -390,25 +402,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
390
402
  type: Injectable
391
403
  }], ctorParameters: function () { return []; } });
392
404
 
393
- const DEFAULT_POLYGON_OPTIONS = {
394
- clickable: true,
395
- draggable: true,
396
- editable: true,
397
- // fillColor: 'rgba(60,150,60,1)',
398
- // strokeColor: 'rgba(155,255,0,1)'
399
- };
400
- const DEFAULT_DRAWING_MANAGER_OPTIONS = () => ({
401
- drawingControl: true,
405
+ const DEFAULT_POLYGON_OPTIONS = (editingEnabled) => ({
406
+ clickable: editingEnabled,
407
+ draggable: editingEnabled,
408
+ editable: editingEnabled,
409
+ });
410
+ const DEFAULT_DRAWING_MANAGER_OPTIONS = (editingEnabled) => ({
411
+ drawingControl: editingEnabled,
402
412
  drawingControlOptions: {
403
413
  drawingModes: [
404
414
  google.maps.drawing.OverlayType.POLYGON,
405
415
  ],
406
416
  },
407
- polygonOptions: DEFAULT_POLYGON_OPTIONS,
417
+ polygonOptions: DEFAULT_POLYGON_OPTIONS(editingEnabled),
408
418
  drawingMode: null,
409
419
  });
410
- const FEATURE_STYLE_OPTIONS_DEFAULT = {
420
+ const FEATURE_STYLE_OPTIONS_DEFAULT = (editingEnabled) => ({
411
421
  clickable: true,
422
+ // clickable: editingEnabled,
412
423
  visible: true,
413
424
  // zIndex?: number;
414
425
  // cursor?: string;
@@ -419,8 +430,25 @@ const FEATURE_STYLE_OPTIONS_DEFAULT = {
419
430
  strokeColor: 'blue',
420
431
  strokeOpacity: 1,
421
432
  strokeWeight: 2,
422
- };
423
- const FEATURE_STYLE_OPTIONS_SELECTED = Object.assign(Object.assign({}, FEATURE_STYLE_OPTIONS_DEFAULT), { draggable: true, editable: true, fillColor: 'green', fillOpacity: 0.7, strokeColor: 'limegreen', strokeOpacity: 1, strokeWeight: 2 });
433
+ });
434
+ const FEATURE_STYLE_OPTIONS_SELECTED = (editingEnabled) => (Object.assign(Object.assign({}, FEATURE_STYLE_OPTIONS_DEFAULT(editingEnabled)), { draggable: editingEnabled, editable: editingEnabled, fillColor: 'green', fillOpacity: 0.7, strokeColor: 'limegreen', strokeOpacity: 1, strokeWeight: 2 }));
435
+ const FEATURE_STYLE_OVERRIDE_OPTIONS_HOVERED = (editingEnabled) => ({
436
+ strokeColor: 'black',
437
+ strokeOpacity: 1,
438
+ strokeWeight: 4,
439
+ });
440
+ const SUPPORTED_PROPERTY_STYLE_OPTIONS = [
441
+ 'fillColor',
442
+ 'fillOpacity',
443
+ 'strokeColor',
444
+ 'strokeOpacity',
445
+ 'strokeWeight',
446
+ 'label',
447
+ 'opacity',
448
+ 'icon',
449
+ 'clickable',
450
+ 'visible',
451
+ ];
424
452
  class GoogleMapsService {
425
453
  get mapReady() { return this._mapReadySubject.value; }
426
454
  constructor(_mapValueManager, _ngZone, _vcr) {
@@ -429,9 +457,11 @@ class GoogleMapsService {
429
457
  this._vcr = _vcr;
430
458
  this._ngUnsubscribe = new Subject();
431
459
  this._mapReadySubject = new BehaviorSubject(false);
460
+ this._editingEnabledSubject = new BehaviorSubject(true);
432
461
  this._featureContextMenu = null;
433
462
  this._activeContextMenu = null;
434
463
  this._allowDrawingHoleInPolygon = false;
464
+ this.editingEnabled$ = this._editingEnabledSubject.asObservable();
435
465
  this.mapReady$ = this._mapReadySubject.asObservable();
436
466
  }
437
467
  ngOnDestroy() {
@@ -450,8 +480,36 @@ class GoogleMapsService {
450
480
  }
451
481
  // TODO: Refactor out of the service meant to just wrap the google maps api.
452
482
  setFeatureContextMenu(menu) {
483
+ this.closeContextMenu();
453
484
  this._featureContextMenu = menu;
454
485
  }
486
+ setEditingEnabled(enabled) {
487
+ var _a, _b, _c, _d;
488
+ this._editingEnabledSubject.next(enabled);
489
+ if (this.mapReady) {
490
+ this._assertInitialized();
491
+ this.googleMap.data.revertStyle();
492
+ if (!enabled) {
493
+ this.stopDrawing();
494
+ const options = DEFAULT_DRAWING_MANAGER_OPTIONS(this.isEditingEnabled());
495
+ (_a = this._drawingManager) === null || _a === void 0 ? void 0 : _a.setOptions(options);
496
+ (_b = this._drawingManager) === null || _b === void 0 ? void 0 : _b.setMap(null);
497
+ this.googleMap.data.forEach(f => {
498
+ if (isFeatureSelected(f)) {
499
+ setFeatureSelected(f, false);
500
+ }
501
+ });
502
+ }
503
+ else {
504
+ const options = DEFAULT_DRAWING_MANAGER_OPTIONS(this.isEditingEnabled());
505
+ (_c = this._drawingManager) === null || _c === void 0 ? void 0 : _c.setOptions(options);
506
+ (_d = this._drawingManager) === null || _d === void 0 ? void 0 : _d.setMap(this.googleMap);
507
+ }
508
+ }
509
+ }
510
+ isEditingEnabled() {
511
+ return this._editingEnabledSubject.value;
512
+ }
455
513
  getDiv() {
456
514
  this._assertInitialized();
457
515
  return this.googleMap.getDiv();
@@ -490,7 +548,7 @@ class GoogleMapsService {
490
548
  listener.remove();
491
549
  });
492
550
  // To fake canceling the current drawing, without disabling the drawing
493
- // mode, the drawin mode is being unset then immediately set back. When
551
+ // mode, the drawing mode is being unset then immediately set back. When
494
552
  // the mode is unset the 'overlaycomplete' event will fire, which will
495
553
  // give a reference to the current overlay to remove, then it is set back
496
554
  // to the mode the user was using. To the user is should just seem like
@@ -510,7 +568,7 @@ class GoogleMapsService {
510
568
  throw Error(`DrawingManager is already initialized.`);
511
569
  }
512
570
  this._assertInitialized();
513
- const options = DEFAULT_DRAWING_MANAGER_OPTIONS();
571
+ const options = DEFAULT_DRAWING_MANAGER_OPTIONS(this.isEditingEnabled());
514
572
  const drawingManager = new google.maps.drawing.DrawingManager(options);
515
573
  drawingManager.setMap(this.googleMap);
516
574
  this._drawingManager = drawingManager;
@@ -575,10 +633,15 @@ class GoogleMapsService {
575
633
  });
576
634
  // Determine what the style of the features are.
577
635
  this.googleMap.data.setStyle(feature => {
636
+ let opts = FEATURE_STYLE_OPTIONS_DEFAULT(this.isEditingEnabled());
637
+ const options = getStyleOptionsDefinedByFeature(feature);
638
+ this._mergeStyleOptions(opts, options !== null && options !== void 0 ? options : {});
578
639
  if (isFeatureSelected(feature)) {
579
- return FEATURE_STYLE_OPTIONS_SELECTED;
640
+ const hoverOptions = getHoveredStyleOptionsDefinedByFeature(feature);
641
+ opts = FEATURE_STYLE_OPTIONS_SELECTED(this.isEditingEnabled());
642
+ this._mergeStyleOptions(opts, hoverOptions !== null && hoverOptions !== void 0 ? hoverOptions : {});
580
643
  }
581
- return FEATURE_STYLE_OPTIONS_DEFAULT;
644
+ return opts;
582
645
  });
583
646
  // Select a feature when clicked.
584
647
  this.googleMap.data.addListener('click', (event) => {
@@ -595,7 +658,7 @@ class GoogleMapsService {
595
658
  this._assertInitialized();
596
659
  this.googleMap.data.revertStyle();
597
660
  if (!this.isDrawing() && !isFeatureSelected(event.feature)) {
598
- this.googleMap.data.overrideStyle(event.feature, { strokeWeight: 4 });
661
+ this.setFeatureHoveredStyleOverride(event.feature);
599
662
  }
600
663
  });
601
664
  // Remove any hover styles when mouse moves away.
@@ -604,6 +667,23 @@ class GoogleMapsService {
604
667
  this.googleMap.data.revertStyle();
605
668
  });
606
669
  }
670
+ setFeatureHoveredStyleOverride(feature) {
671
+ this._assertInitialized();
672
+ const overrideOpts = FEATURE_STYLE_OVERRIDE_OPTIONS_HOVERED(this.isEditingEnabled());
673
+ const hoverOptions = getHoveredStyleOptionsDefinedByFeature(feature);
674
+ this._mergeStyleOptions(overrideOpts, hoverOptions !== null && hoverOptions !== void 0 ? hoverOptions : {});
675
+ this.googleMap.data.overrideStyle(feature, overrideOpts);
676
+ }
677
+ _mergeStyleOptions(options, propertiesStyleOptions) {
678
+ if (Object.keys(propertiesStyleOptions).length === 0) {
679
+ return;
680
+ }
681
+ for (const opt of SUPPORTED_PROPERTY_STYLE_OPTIONS) {
682
+ if (Object.prototype.hasOwnProperty.call(propertiesStyleOptions, opt)) {
683
+ options[opt] = propertiesStyleOptions[opt];
684
+ }
685
+ }
686
+ }
607
687
  _initFeatureChangeListeners() {
608
688
  this._assertInitialized();
609
689
  createFeatureChangeObservable(this.googleMap.data, this._ngZone).pipe(switchMap(() => from(this.getGeoJson()).pipe(tap(geoJson => this._mapValueManager.setValue(geoJson, MapValueSource.FeatureChange)))), takeUntil(this._ngUnsubscribe)).subscribe();
@@ -694,11 +774,15 @@ class GoogleMapsService {
694
774
  }
695
775
  }
696
776
  // TODO: Refactor out of the service meant to just wrap the google maps api.
697
- _openContextMenuForFeature(feature, position) {
777
+ closeContextMenu() {
698
778
  if (this._activeContextMenu) {
699
779
  this._activeContextMenu.close();
700
780
  this._activeContextMenu = null;
701
781
  }
782
+ }
783
+ // TODO: Refactor out of the service meant to just wrap the google maps api.
784
+ _openContextMenuForFeature(feature, position) {
785
+ this.closeContextMenu();
702
786
  this._assertInitialized();
703
787
  let _position = position;
704
788
  if (!_position) {
@@ -1200,6 +1284,7 @@ class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinBase {
1200
1284
  this.mapTypeControlEnabled = true;
1201
1285
  this.streetViewControlEnabled = false;
1202
1286
  this.allowDrawingHoleInPolygon = false;
1287
+ this.editingEnabled = true;
1203
1288
  this.zoom = 14;
1204
1289
  this.longitude = -98.570209;
1205
1290
  this.latitude = 37.633814;
@@ -1223,17 +1308,32 @@ class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinBase {
1223
1308
  this._googleMaps.setData(changed.value);
1224
1309
  }
1225
1310
  }), takeUntil(this._ngUnsubscribe)).subscribe();
1311
+ this._contextMenuItems$ = this._googleMaps.editingEnabled$.pipe(map(enabled => {
1312
+ const items = [];
1313
+ if (enabled) {
1314
+ items.push({ label: 'Delete', action: () => this._onClickDeleteFeature() });
1315
+ }
1316
+ return items;
1317
+ }), tap(items => {
1318
+ if (items.length === 0) {
1319
+ this._googleMaps.setFeatureContextMenu(null);
1320
+ }
1321
+ else {
1322
+ this._googleMaps.setFeatureContextMenu(this.featureContextMenu);
1323
+ }
1324
+ }));
1226
1325
  this._googleMaps.setBaseLatLng(this.latitude, this.longitude);
1227
1326
  this._gmApiLoaded = this._googleMapsApiLoader.load().pipe(map(() => true), catchError(() => of(false)));
1228
1327
  }
1229
1328
  ngOnInit() {
1230
- this._googleMaps.setFeatureContextMenu(this.featureContextMenu);
1231
1329
  fromEvent(window, 'keydown').pipe(tap((event) => {
1232
1330
  switch (event.code) {
1233
1331
  case 'Delete':
1234
- this._googleMaps.deleteSelection();
1235
- event.preventDefault();
1236
- event.stopPropagation();
1332
+ if (this._googleMaps.isEditingEnabled()) {
1333
+ this._googleMaps.deleteSelection();
1334
+ event.preventDefault();
1335
+ event.stopPropagation();
1336
+ }
1237
1337
  break;
1238
1338
  case 'Escape':
1239
1339
  this._googleMaps.stopDrawing();
@@ -1275,6 +1375,9 @@ class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinBase {
1275
1375
  this._options = Object.assign(Object.assign({}, this._options), { fullscreenControl });
1276
1376
  }
1277
1377
  }
1378
+ if (Object.prototype.hasOwnProperty.call(changes, 'editingEnabled')) {
1379
+ this._googleMaps.setEditingEnabled(this.editingEnabled);
1380
+ }
1278
1381
  }
1279
1382
  writeValue(value) {
1280
1383
  this.value = value;
@@ -1321,7 +1424,7 @@ class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinBase {
1321
1424
  }
1322
1425
  }
1323
1426
  TheSeamGoogleMapsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TheSeamGoogleMapsComponent, deps: [{ token: i0.ElementRef }, { token: i1.FocusMonitor }, { token: GoogleMapsService }, { token: MapValueManagerService }, { token: TheSeamGoogleMapsApiLoader }], target: i0.ɵɵFactoryTarget.Component });
1324
- TheSeamGoogleMapsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TheSeamGoogleMapsComponent, selector: "seam-google-maps", inputs: { disabled: "disabled", value: "value", tabIndex: "tabIndex", fileDropEnabled: "fileDropEnabled", fileUploadControlEnabled: "fileUploadControlEnabled", fullscreenControlEnabled: "fullscreenControlEnabled", reCenterControlEnabled: "reCenterControlEnabled", mapTypeControlEnabled: "mapTypeControlEnabled", streetViewControlEnabled: "streetViewControlEnabled", allowDrawingHoleInPolygon: "allowDrawingHoleInPolygon", fileImportHandler: "fileImportHandler", zoom: "zoom", longitude: "longitude", latitude: "latitude" }, outputs: { mapReady: "mapReady" }, host: { properties: { "attr.disabled": "this._attrDisabled", "attr.tabindex": "this._attrTabIndex" } }, providers: [
1427
+ TheSeamGoogleMapsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TheSeamGoogleMapsComponent, selector: "seam-google-maps", inputs: { disabled: "disabled", value: "value", tabIndex: "tabIndex", fileDropEnabled: "fileDropEnabled", fileUploadControlEnabled: "fileUploadControlEnabled", fullscreenControlEnabled: "fullscreenControlEnabled", reCenterControlEnabled: "reCenterControlEnabled", mapTypeControlEnabled: "mapTypeControlEnabled", streetViewControlEnabled: "streetViewControlEnabled", allowDrawingHoleInPolygon: "allowDrawingHoleInPolygon", editingEnabled: "editingEnabled", fileImportHandler: "fileImportHandler", zoom: "zoom", longitude: "longitude", latitude: "latitude" }, outputs: { mapReady: "mapReady" }, host: { properties: { "attr.disabled": "this._attrDisabled", "attr.tabindex": "this._attrTabIndex" } }, providers: [
1325
1428
  MapValueManagerService,
1326
1429
  GoogleMapsService,
1327
1430
  { provide: MAP_CONTROLS_SERVICE, useClass: GoogleMapsControlsService },
@@ -1331,7 +1434,7 @@ TheSeamGoogleMapsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0
1331
1434
  useExisting: forwardRef(() => TheSeamGoogleMapsComponent),
1332
1435
  multi: true,
1333
1436
  },
1334
- ], viewQueries: [{ propertyName: "featureContextMenu", first: true, predicate: ["featureContextMenu"], descendants: true, read: MenuComponent, static: true }], exportAs: ["seamGoogleMaps"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"_gmApiLoaded | async\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [center]=\"{ lat: latitude, lng: longitude }\"\n [zoom]=\"zoom\"\n [options]=\"_options\"\n (mapInitialized)=\"_onMapReady($any($event))\"\n >\n </google-map>\n</ng-container>\n<seam-menu #featureContextMenu>\n <button seamMenuItem (click)=\"_onClickDeleteFeature()\">Delete</button>\n</seam-menu>\n<seam-map-file-drop *ngIf=\"fileDropEnabled\"></seam-map-file-drop>\n\n<seam-map-control *ngIf=\"fileUploadControlEnabled\" [def]=\"_fileUploadControlDef\"></seam-map-control>\n<seam-map-control *ngIf=\"reCenterControlEnabled\" [def]=\"_reCenterControlDef\"></seam-map-control>\n", styles: [":host{display:block;position:relative;height:400px;width:100%}:host.show-focus-border.cdk-focused{outline:0;box-shadow:0 0 0 .2rem #357ebd40}:host.show-focus-border[disabled]{opacity:.65}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.MenuComponent, selector: "seam-menu", inputs: ["menuClass", "baseWidth", "animationType"], outputs: ["closed"], exportAs: ["seamMenu"] }, { kind: "component", type: i6.MenuItemComponent, selector: "[seamMenuItem]", inputs: ["disabled", "role", "icon", "iconClass", "badgeText", "badgeTheme"], exportAs: ["seamMenuItem"] }, { kind: "component", type: i7.GoogleMap, selector: "google-map", inputs: ["height", "width", "mapTypeId", "center", "zoom", "options"], outputs: ["mapInitialized", "authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { kind: "component", type: TheSeamMapFileDropComponent, selector: "seam-map-file-drop" }, { kind: "component", type: TheSeamMapsControlComponent, selector: "seam-map-control", inputs: ["def"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1437
+ ], viewQueries: [{ propertyName: "featureContextMenu", first: true, predicate: ["featureContextMenu"], descendants: true, read: MenuComponent, static: true }], exportAs: ["seamGoogleMaps"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"_gmApiLoaded | async\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [center]=\"{ lat: latitude, lng: longitude }\"\n [zoom]=\"zoom\"\n [options]=\"_options\"\n (mapInitialized)=\"_onMapReady($any($event))\"\n >\n </google-map>\n</ng-container>\n<seam-menu #featureContextMenu>\n <button seamMenuItem *ngFor=\"let item of _contextMenuItems$ | async\" (click)=\"item.action(item)\">{{ item.label }}</button>\n</seam-menu>\n<seam-map-file-drop *ngIf=\"fileDropEnabled\"></seam-map-file-drop>\n\n<seam-map-control *ngIf=\"fileUploadControlEnabled\" [def]=\"_fileUploadControlDef\"></seam-map-control>\n<seam-map-control *ngIf=\"reCenterControlEnabled\" [def]=\"_reCenterControlDef\"></seam-map-control>\n", styles: [":host{display:block;position:relative;height:400px;width:100%}:host.show-focus-border.cdk-focused{outline:0;box-shadow:0 0 0 .2rem #357ebd40}:host.show-focus-border[disabled]{opacity:.65}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.MenuComponent, selector: "seam-menu", inputs: ["menuClass", "baseWidth", "animationType"], outputs: ["closed"], exportAs: ["seamMenu"] }, { kind: "component", type: i6.MenuItemComponent, selector: "[seamMenuItem]", inputs: ["disabled", "role", "icon", "iconClass", "sublevelIcon", "subLevelIconClass", "badgeText", "badgeTheme"], exportAs: ["seamMenuItem"] }, { kind: "component", type: i7.GoogleMap, selector: "google-map", inputs: ["height", "width", "mapTypeId", "center", "zoom", "options"], outputs: ["mapInitialized", "authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { kind: "component", type: TheSeamMapFileDropComponent, selector: "seam-map-file-drop" }, { kind: "component", type: TheSeamMapsControlComponent, selector: "seam-map-control", inputs: ["def"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1335
1438
  __decorate([
1336
1439
  InputBoolean()
1337
1440
  ], TheSeamGoogleMapsComponent.prototype, "fileDropEnabled", void 0);
@@ -1353,6 +1456,9 @@ __decorate([
1353
1456
  __decorate([
1354
1457
  InputBoolean()
1355
1458
  ], TheSeamGoogleMapsComponent.prototype, "allowDrawingHoleInPolygon", void 0);
1459
+ __decorate([
1460
+ InputBoolean()
1461
+ ], TheSeamGoogleMapsComponent.prototype, "editingEnabled", void 0);
1356
1462
  __decorate([
1357
1463
  InputNumber()
1358
1464
  ], TheSeamGoogleMapsComponent.prototype, "zoom", void 0);
@@ -1376,7 +1482,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1376
1482
  useExisting: forwardRef(() => TheSeamGoogleMapsComponent),
1377
1483
  multi: true,
1378
1484
  },
1379
- ], changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'seamGoogleMaps', template: "<ng-container *ngIf=\"_gmApiLoaded | async\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [center]=\"{ lat: latitude, lng: longitude }\"\n [zoom]=\"zoom\"\n [options]=\"_options\"\n (mapInitialized)=\"_onMapReady($any($event))\"\n >\n </google-map>\n</ng-container>\n<seam-menu #featureContextMenu>\n <button seamMenuItem (click)=\"_onClickDeleteFeature()\">Delete</button>\n</seam-menu>\n<seam-map-file-drop *ngIf=\"fileDropEnabled\"></seam-map-file-drop>\n\n<seam-map-control *ngIf=\"fileUploadControlEnabled\" [def]=\"_fileUploadControlDef\"></seam-map-control>\n<seam-map-control *ngIf=\"reCenterControlEnabled\" [def]=\"_reCenterControlDef\"></seam-map-control>\n", styles: [":host{display:block;position:relative;height:400px;width:100%}:host.show-focus-border.cdk-focused{outline:0;box-shadow:0 0 0 .2rem #357ebd40}:host.show-focus-border[disabled]{opacity:.65}\n"] }]
1485
+ ], changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'seamGoogleMaps', template: "<ng-container *ngIf=\"_gmApiLoaded | async\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [center]=\"{ lat: latitude, lng: longitude }\"\n [zoom]=\"zoom\"\n [options]=\"_options\"\n (mapInitialized)=\"_onMapReady($any($event))\"\n >\n </google-map>\n</ng-container>\n<seam-menu #featureContextMenu>\n <button seamMenuItem *ngFor=\"let item of _contextMenuItems$ | async\" (click)=\"item.action(item)\">{{ item.label }}</button>\n</seam-menu>\n<seam-map-file-drop *ngIf=\"fileDropEnabled\"></seam-map-file-drop>\n\n<seam-map-control *ngIf=\"fileUploadControlEnabled\" [def]=\"_fileUploadControlDef\"></seam-map-control>\n<seam-map-control *ngIf=\"reCenterControlEnabled\" [def]=\"_reCenterControlDef\"></seam-map-control>\n", styles: [":host{display:block;position:relative;height:400px;width:100%}:host.show-focus-border.cdk-focused{outline:0;box-shadow:0 0 0 .2rem #357ebd40}:host.show-focus-border[disabled]{opacity:.65}\n"] }]
1380
1486
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FocusMonitor }, { type: GoogleMapsService }, { type: MapValueManagerService }, { type: TheSeamGoogleMapsApiLoader }]; }, propDecorators: { value: [{
1381
1487
  type: Input
1382
1488
  }], tabIndex: [{
@@ -1395,6 +1501,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1395
1501
  type: Input
1396
1502
  }], allowDrawingHoleInPolygon: [{
1397
1503
  type: Input
1504
+ }], editingEnabled: [{
1505
+ type: Input
1398
1506
  }], fileImportHandler: [{
1399
1507
  type: Input
1400
1508
  }], _attrDisabled: [{
@@ -1790,7 +1898,8 @@ TheSeamGoogleMapsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
1790
1898
  TheSeamFormFieldModule,
1791
1899
  GoogleMapsModule], exports: [TheSeamGoogleMapsComponent,
1792
1900
  TheSeamGoogleMapsPlacesAutocompleteDirective,
1793
- TheSeamGoogleMapsPlacesAutoCompleteComponent] });
1901
+ TheSeamGoogleMapsPlacesAutoCompleteComponent,
1902
+ TheSeamMapsControlComponent] });
1794
1903
  TheSeamGoogleMapsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TheSeamGoogleMapsModule, imports: [CommonModule,
1795
1904
  ObserversModule,
1796
1905
  TheSeamSharedModule,
@@ -1823,6 +1932,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1823
1932
  TheSeamGoogleMapsComponent,
1824
1933
  TheSeamGoogleMapsPlacesAutocompleteDirective,
1825
1934
  TheSeamGoogleMapsPlacesAutoCompleteComponent,
1935
+ TheSeamMapsControlComponent,
1826
1936
  ]
1827
1937
  }]
1828
1938
  }] });
@@ -1953,5 +2063,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1953
2063
  * Generated bundle index. Do not edit.
1954
2064
  */
1955
2065
 
1956
- export { AppFeaturePropertyName, GoogleMapsContextMenu, GoogleMapsControlsService, GoogleMapsService, MapControlRef, MapValueManagerService, MapValueSource, SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS, THESEAM_LAZY_MAPS_API_CONFIG, TheSeamGoogleMapsApiLoader, TheSeamGoogleMapsComponent, TheSeamGoogleMapsModule, TheSeamGoogleMapsPlacesAutoCompleteComponent, TheSeamGoogleMapsPlacesAutocompleteDirective, TheSeamGoogleMapsRecenterButtonControlComponent, TheSeamGoogleMapsUploadButtonControlComponent, TheSeamLazyMapsApiLoader, TheSeamMapFileDropComponent, TheSeamMapsControlComponent, TheSeamNoopGoogleMapsAPILoader, addInnerFeatureCutoutToExteriorFeature, createDataFeatureFromPolygon, createFeatureChangeObservable, featureContains, fixPathDifferentStartingAndEndingPoint, getBoundsWithAllFeatures, getFeatureBounds, getFeatureCenter, getFeaturesCount, getPossibleExteriorFeature, isAppFeatureProperty, isFeatureSelected, multiPolygonCoordinates, polygonCoordinates, polygonHasValidPathsLengths, removeAllFeatures, setFeatureSelected, stripAppFeaturePropertiesFromJson, toTurfJsFeature, toTurfJsMultiPolygon, toTurfJsPolygon };
2066
+ export { AppFeaturePropertyName, GoogleMapsContextMenu, GoogleMapsControlsService, GoogleMapsService, MapControlRef, MapValueManagerService, MapValueSource, SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS, THESEAM_LAZY_MAPS_API_CONFIG, TheSeamGoogleMapsApiLoader, TheSeamGoogleMapsComponent, TheSeamGoogleMapsModule, TheSeamGoogleMapsPlacesAutoCompleteComponent, TheSeamGoogleMapsPlacesAutocompleteDirective, TheSeamGoogleMapsRecenterButtonControlComponent, TheSeamGoogleMapsUploadButtonControlComponent, TheSeamLazyMapsApiLoader, TheSeamMapFileDropComponent, TheSeamMapsControlComponent, TheSeamNoopGoogleMapsAPILoader, addInnerFeatureCutoutToExteriorFeature, createDataFeatureFromPolygon, createFeatureChangeObservable, featureContains, fixPathDifferentStartingAndEndingPoint, getBoundsWithAllFeatures, getFeatureBounds, getFeatureCenter, getFeaturesCount, getHoveredStyleOptionsDefinedByFeature, getPossibleExteriorFeature, getSelectedStyleOptionsDefinedByFeature, getStyleOptionsDefinedByFeature, isAppFeatureProperty, isFeatureSelected, multiPolygonCoordinates, polygonCoordinates, polygonHasValidPathsLengths, removeAllFeatures, setFeatureSelected, stripAppFeaturePropertiesFromJson, toTurfJsFeature, toTurfJsMultiPolygon, toTurfJsPolygon };
1957
2067
  //# sourceMappingURL=theseam-ui-common-google-maps.mjs.map