<!--

    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.

-->
<ng-container [formGroup]="aggregatedValueCardWidgetSettingsForm">
  <div class="tb-form-panel">
    <div class="tb-form-panel-title" translate>widgets.aggregated-value-card.aggregated-value-card-style</div>
    <div class="tb-form-row">
      <mat-slide-toggle class="mat-slide" formControlName="autoScale">
        {{ 'widgets.aggregated-value-card.auto-scale' | translate }}
      </mat-slide-toggle>
    </div>
    <div class="tb-form-row column-xs">
      <mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showSubtitle">
        {{ 'widgets.aggregated-value-card.subtitle' | translate }}
      </mat-slide-toggle>
      <div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
        <mat-form-field class="flex" appearance="outline" subscriptSizing="dynamic">
          <input matInput formControlName="subtitle" placeholder="{{ 'widget-config.set' | translate }}">
        </mat-form-field>
        <tb-font-settings formControlName="subtitleFont"
                          clearButton
                          [previewText]="aggregatedValueCardWidgetSettingsForm.get('subtitle').value">
        </tb-font-settings>
        <tb-color-input asBoxInput
                        colorClearButton
                        formControlName="subtitleColor">
        </tb-color-input>
      </div>
    </div>
    <div class="tb-form-row column-xs">
      <mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showDate">
        {{ 'widgets.value-card.date' | translate }}
      </mat-slide-toggle>
      <div fxFlex.gt-xs fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
        <tb-date-format-select fxFlex formControlName="dateFormat"></tb-date-format-select>
        <tb-font-settings formControlName="dateFont"
                          [previewText]="datePreviewFn">
        </tb-font-settings>
        <tb-color-input asBoxInput
                        colorClearButton
                        formControlName="dateColor">
        </tb-color-input>
      </div>
    </div>
    <div class="tb-form-row">
      <mat-slide-toggle class="mat-slide" formControlName="showChart">
        {{ 'widgets.aggregated-value-card.chart' | translate }}
      </mat-slide-toggle>
    </div>
    <div class="tb-form-row space-between">
      <div>{{ 'widgets.background.background' | translate }}</div>
      <tb-background-settings formControlName="background">
      </tb-background-settings>
    </div>
  </div>
</ng-container>
