<!--

    Copyright © 2016-2023 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<section class="tb-widget-settings" [formGroup]="mapEditorSettingsFormGroup">
  <fieldset class="fields-group">
    <legend class="group-title" translate>widgets.maps.editor-settings</legend>
    <mat-slide-toggle formControlName="snappable" class="flex-gap-xs">
      {{ 'widgets.maps.enable-snapping' | translate }}
    </mat-slide-toggle>
    <mat-slide-toggle formControlName="initDragMode" class="flex-gap-xs">
      {{ 'widgets.maps.init-draggable-mode' | translate }}
    </mat-slide-toggle>
    <mat-expansion-panel class="tb-settings" [expanded]="!mapEditorSettingsFormGroup.get('hideAllControlButton').value">
      <mat-expansion-panel-header fxLayout="row wrap">
        <mat-panel-title>
          <mat-slide-toggle formControlName="hideAllControlButton" (click)="$event.stopPropagation()"
                            fxLayoutAlign="center">
            {{ 'widgets.maps.hide-all-edit-buttons' | translate }}
          </mat-slide-toggle>
        </mat-panel-title>
        <mat-panel-description fxLayoutAlign="end center" fxHide.xs translate>
          widget-config.advanced-settings
        </mat-panel-description>
      </mat-expansion-panel-header>
      <ng-template matExpansionPanelContent>
        <mat-slide-toggle formControlName="hideDrawControlButton" class="slide-block">
          {{ 'widgets.maps.hide-draw-buttons' | translate }}
        </mat-slide-toggle>
        <mat-slide-toggle formControlName="hideEditControlButton" class="slide-block">
          {{ 'widgets.maps.hide-edit-buttons' | translate }}
        </mat-slide-toggle>
        <mat-slide-toggle formControlName="hideRemoveControlButton" class="slide-block">
          {{ 'widgets.maps.hide-remove-button' | translate }}
        </mat-slide-toggle>
      </ng-template>
    </mat-expansion-panel>
  </fieldset>
</section>
