Browse Source

UI: Responsive layout improvements.

pull/9044/head
Igor Kulikov 3 years ago
parent
commit
544f29f0e1
  1. 5
      ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html
  2. 16
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-image-dialog.component.html
  3. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.scss
  4. 14
      ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-card-basic-config.component.html
  5. 2
      ui-ngx/src/app/modules/home/components/widget/config/basic/common/data-key-row.component.html
  6. 2
      ui-ngx/src/app/modules/home/components/widget/config/data-key-config-dialog.component.html
  7. 130
      ui-ngx/src/app/modules/home/components/widget/config/data-key-config.component.html
  8. 4
      ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.html
  9. 3
      ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.scss
  10. 24
      ui-ngx/src/app/modules/home/components/widget/config/datasources.component.html
  11. 43
      ui-ngx/src/app/modules/home/components/widget/config/datasources.component.scss
  12. 2
      ui-ngx/src/app/modules/home/components/widget/lib/navigation-card-widget.component.html
  13. 8
      ui-ngx/src/app/modules/home/components/widget/lib/settings/alarm/alarms-table-key-settings.component.html
  14. 6
      ui-ngx/src/app/modules/home/components/widget/lib/settings/alarm/alarms-table-widget-settings.component.html
  15. 8
      ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/entities-table-key-settings.component.html
  16. 10
      ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/entities-table-widget-settings.component.html
  17. 8
      ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/timeseries-table-key-settings.component.html
  18. 8
      ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/timeseries-table-latest-key-settings.component.html
  19. 6
      ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/timeseries-table-widget-settings.component.html
  20. 8
      ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/value-card-widget-settings.component.html
  21. 8
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/flot-key-settings.component.html
  22. 2
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/flot-threshold.component.html
  23. 7
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/flot-threshold.component.scss
  24. 24
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/flot-widget-settings.component.html
  25. 2
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/background-settings-panel.component.html
  26. 2
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/background-settings-panel.component.ts
  27. 2
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.html
  28. 6
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/value-source.component.html
  29. 66
      ui-ngx/src/app/shared/components/image-input.component.html
  30. 118
      ui-ngx/src/app/shared/components/image-input.component.scss
  31. 3
      ui-ngx/src/app/shared/components/image-input.component.ts
  32. 4
      ui-ngx/src/app/shared/components/toggle-header.component.scss
  33. 37
      ui-ngx/src/app/shared/components/toggle-header.component.ts
  34. 2
      ui-ngx/src/app/shared/components/unit-input.component.html
  35. 1
      ui-ngx/src/assets/locale/locale.constant-ca_ES.json
  36. 4
      ui-ngx/src/assets/locale/locale.constant-en_US.json
  37. 1
      ui-ngx/src/assets/locale/locale.constant-es_ES.json
  38. 1
      ui-ngx/src/assets/locale/locale.constant-zh_CN.json
  39. 1
      ui-ngx/src/assets/locale/locale.constant-zh_TW.json
  40. 25
      ui-ngx/src/form.scss

5
ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html

@ -18,8 +18,9 @@
<form class="tb-add-widget-dialog" [formGroup]="widgetFormGroup"> <form class="tb-add-widget-dialog" [formGroup]="widgetFormGroup">
<mat-toolbar color="primary"> <mat-toolbar color="primary">
<div class="tb-add-widget-toolbar"> <div class="tb-add-widget-toolbar">
<h2 fxFlex>{{'widget.add' | translate}}: {{data.widgetInfo.widgetName}}</h2> <h2>{{'widget.add' | translate}}:</h2>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap.gt-xs="16px"> <span fxFlex>{{data.widgetInfo.widgetName}}</span>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap.gt-xs="16px" style="min-width: fit-content;">
<tb-toggle-select *ngIf="hasBasicMode" appearance="fill-invert" selectMediaBreakpoint="xs" <tb-toggle-select *ngIf="hasBasicMode" appearance="fill-invert" selectMediaBreakpoint="xs"
[(ngModel)]="widgetConfigMode" [ngModelOptions]="{standalone: true}"> [(ngModel)]="widgetConfigMode" [ngModelOptions]="{standalone: true}">
<tb-toggle-option value="basic">{{ 'widget.basic-mode' | translate }}</tb-toggle-option> <tb-toggle-option value="basic">{{ 'widget.basic-mode' | translate }}</tb-toggle-option>

16
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-image-dialog.component.html

@ -28,7 +28,7 @@
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async"> <mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
</mat-progress-bar> </mat-progress-bar>
<div mat-dialog-content style="position: relative;"> <div mat-dialog-content style="position: relative;">
<fieldset [disabled]="(isLoading$ | async) || (takingScreenshot$ | async)" fxLayout="column" fxLayoutAlign="center center" fxLayoutGap="8px"> <fieldset [disabled]="(isLoading$ | async) || (takingScreenshot$ | async)" fxLayout="column" fxLayoutAlign="center stretch" fxLayoutGap="8px">
<div [formGroup]="dashboardRectFormGroup" fxLayout="column" fxLayoutGap="8px" fxLayoutAlign="center center"> <div [formGroup]="dashboardRectFormGroup" fxLayout="column" fxLayoutGap="8px" fxLayoutAlign="center center">
<mat-form-field class="rect-field"> <mat-form-field class="rect-field">
<mat-label>Top %</mat-label> <mat-label>Top %</mat-label>
@ -53,14 +53,14 @@
<input matInput formControlName="bottom" type="number" step="1" min="0" max="100"> <input matInput formControlName="bottom" type="number" step="1" min="0" max="100">
</mat-form-field> </mat-form-field>
</div> </div>
<div [formGroup]="dashboardRectFormGroup" fxFlex fxLayout="row" fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="center center">
<button mat-raised-button color="accent"
type="button"
[disabled]="(isLoading$ | async) || (takingScreenshot$ | async)"
(click)="takeScreenShot()">
{{ 'dashboard.take-screenshot' | translate }}
</button>
</div> </div>
<button mat-raised-button color="accent"
type="button"
[disabled]="(isLoading$ | async) || (takingScreenshot$ | async)"
(click)="takeScreenShot()">
{{ 'dashboard.take-screenshot' | translate }}
</button>
<div [formGroup]="dashboardImageFormGroup"> <div [formGroup]="dashboardImageFormGroup">
<tb-image-input [showPreview]="false" label="{{'dashboard.image' | translate}}" <tb-image-input [showPreview]="false" label="{{'dashboard.image' | translate}}"
formControlName="dashboardImage"> formControlName="dashboardImage">

2
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.scss

@ -45,8 +45,6 @@
} }
.preview { .preview {
width: 100%;
height: 100%;
max-width: 100%; max-width: 100%;
max-height: 100%; max-height: 100%;
object-fit: contain; object-fit: contain;

14
ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-card-basic-config.component.html

@ -45,7 +45,7 @@
{{ 'widgets.value-card.label' | translate }} {{ 'widgets.value-card.label' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<mat-form-field fxFlex appearance="outline" subscriptSizing="dynamic"> <mat-form-field class="flex" appearance="outline" subscriptSizing="dynamic">
<input matInput formControlName="label" placeholder="{{ 'widget-config.set' | translate }}"> <input matInput formControlName="label" placeholder="{{ 'widget-config.set' | translate }}">
</mat-form-field> </mat-form-field>
<tb-font-settings formControlName="labelFont" <tb-font-settings formControlName="labelFont"
@ -60,7 +60,7 @@
{{ 'widgets.value-card.icon' | translate }} {{ 'widgets.value-card.icon' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<mat-form-field fxFlex appearance="outline" class="number" subscriptSizing="dynamic"> <mat-form-field appearance="outline" class="flex number" subscriptSizing="dynamic">
<input matInput type="number" min="0" formControlName="iconSize" placeholder="{{ 'widget-config.set' | translate }}"> <input matInput type="number" min="0" formControlName="iconSize" placeholder="{{ 'widget-config.set' | translate }}">
</mat-form-field> </mat-form-field>
<tb-css-unit-select fxFlex formControlName="iconSizeUnit"></tb-css-unit-select> <tb-css-unit-select fxFlex formControlName="iconSizeUnit"></tb-css-unit-select>
@ -75,10 +75,10 @@
<div class="tb-form-row"> <div class="tb-form-row">
<div class="fixed-title-width" translate>widgets.value-card.value</div> <div class="fixed-title-width" translate>widgets.value-card.value</div>
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-unit-input fxFlex formControlName="units"></tb-unit-input> <tb-unit-input class="flex" formControlName="units"></tb-unit-input>
<mat-form-field fxFlex appearance="outline" class="number" subscriptSizing="dynamic"> <mat-form-field appearance="outline" class="flex number" subscriptSizing="dynamic">
<input matInput formControlName="decimals" type="number" min="0" max="15" step="1" placeholder="{{ 'widget-config.set' | translate }}"> <input matInput formControlName="decimals" type="number" min="0" max="15" step="1" placeholder="{{ 'widget-config.set' | translate }}">
<div matSuffix translate>widget-config.decimals-suffix</div> <div matSuffix fxHide.lt-md translate>widget-config.decimals-suffix</div>
</mat-form-field> </mat-form-field>
<tb-font-settings formControlName="valueFont" <tb-font-settings formControlName="valueFont"
[previewText]="valuePreviewFn"> [previewText]="valuePreviewFn">
@ -87,11 +87,11 @@
</tb-color-settings> </tb-color-settings>
</div> </div>
</div> </div>
<div [fxShow]="dateEnabled" class="tb-form-row"> <div [fxShow]="dateEnabled" class="tb-form-row column-xs">
<mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showDate"> <mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showDate">
{{ 'widgets.value-card.date' | translate }} {{ 'widgets.value-card.date' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxFlex.gt-xs fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-date-format-select fxFlex formControlName="dateFormat"></tb-date-format-select> <tb-date-format-select fxFlex formControlName="dateFormat"></tb-date-format-select>
<tb-font-settings formControlName="dateFont" <tb-font-settings formControlName="dateFont"
[previewText]="datePreviewFn"> [previewText]="datePreviewFn">

2
ui-ngx/src/app/modules/home/components/widget/config/basic/common/data-key-row.component.html

@ -28,7 +28,7 @@
(removed)="removeKey()"> (removed)="removeKey()">
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="4px" class="tb-attribute-chip"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="4px" class="tb-attribute-chip">
<div class="tb-chip-labels"> <div class="tb-chip-labels">
<div class="tb-chip-label"> <div class="tb-chip-label tb-chip-text tb-chip-icon">
<ng-container *ngIf="isEntityDatasource"> <ng-container *ngIf="isEntityDatasource">
<mat-icon class="tb-mat-18 tb-datakey-icon" *ngIf="modelValue.type === dataKeyTypes.alarm" <mat-icon class="tb-mat-18 tb-datakey-icon" *ngIf="modelValue.type === dataKeyTypes.alarm"
matTooltip="{{'datakey.alarm' | translate }}" matTooltip="{{'datakey.alarm' | translate }}"

2
ui-ngx/src/app/modules/home/components/widget/config/data-key-config-dialog.component.html

@ -20,7 +20,7 @@
<h2>{{ 'datakey.configuration' | translate }}</h2> <h2>{{ 'datakey.configuration' | translate }}</h2>
<span fxFlex></span> <span fxFlex></span>
<tb-toggle-select *ngIf="hasAdvanced" <tb-toggle-select *ngIf="hasAdvanced"
appearance="fill-invert" [options]="dataKeyConfigHeaderOptions" appearance="fill-invert" selectMediaBreakpoint="xs" [options]="dataKeyConfigHeaderOptions"
[(ngModel)]="dataKeyConfigMode" [ngModelOptions]="{ standalone: true }"> [(ngModel)]="dataKeyConfigMode" [ngModelOptions]="{ standalone: true }">
</tb-toggle-select> </tb-toggle-select>
<button mat-icon-button <button mat-icon-button

130
ui-ngx/src/app/modules/home/components/widget/config/data-key-config.component.html

@ -65,6 +65,18 @@
formControlName="color"> formControlName="color">
</tb-color-input> </tb-color-input>
</div> </div>
<section fxLayout="column" *ngIf="modelValue.type === dataKeyTypes.function">
<span translate>datakey.data-generation-func</span>
<br/>
<tb-js-func #funcBodyEdit
[functionArgs]="['time', 'prevValue']"
[globalVariables]="functionScopeVariables"
[validationArgs]="[[1, 1],[1, '1']]"
resultType="any"
helpId="widget/config/datakey_generation_fn"
formControlName="funcBody">
</tb-js-func>
</section>
<ng-container *ngIf="widgetType === widgetTypes.latest && modelValue.type === dataKeyTypes.timeseries"> <ng-container *ngIf="widgetType === widgetTypes.latest && modelValue.type === dataKeyTypes.timeseries">
<mat-form-field subscriptSizing="dynamic"> <mat-form-field subscriptSizing="dynamic">
<mat-label translate>datakey.aggregation</mat-label> <mat-label translate>datakey.aggregation</mat-label>
@ -80,72 +92,62 @@
{{ 'datakey.aggregation-type-hint-common' | translate }} {{ 'datakey.aggregation-type-hint-common' | translate }}
</section> </section>
</div> </div>
<fieldset *ngIf="dataKeyFormGroup.get('aggregationType').value && dataKeyFormGroup.get('aggregationType').value !== aggregationTypes.NONE" class="fields-group fields-group-slider">
<legend class="group-title" translate>datakey.delta-calculation</legend>
<mat-expansion-panel class="tb-settings comparison" [expanded]="dataKeyFormGroup.get('comparisonEnabled').value" [disabled]="!dataKeyFormGroup.get('comparisonEnabled').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width">
<mat-panel-title fxLayout="column" fxLayoutAlign="center start">
<mat-slide-toggle formControlName="comparisonEnabled" (click)="$event.stopPropagation()">
{{ 'datakey.enable-delta-calculation' | translate }}
</mat-slide-toggle>
<mat-hint class="tb-hint" style="line-height: 15px; padding-left: 45px;">{{ 'datakey.enable-delta-calculation-hint' | translate }}</mat-hint>
</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<section fxLayout="column" *ngIf="dataKeyFormGroup.get('comparisonEnabled').value">
<mat-form-field fxFlex class="mat-block">
<mat-label translate>widgets.chart.time-for-comparison</mat-label>
<mat-select formControlName="timeForComparison">
<mat-option [value]="'previousInterval'">
{{ 'widgets.chart.time-for-comparison-previous-interval' | translate }}
</mat-option>
<mat-option [value]="'days'">
{{ 'widgets.chart.time-for-comparison-days' | translate }}
</mat-option>
<mat-option [value]="'weeks'">
{{ 'widgets.chart.time-for-comparison-weeks' | translate }}
</mat-option>
<mat-option [value]="'months'">
{{ 'widgets.chart.time-for-comparison-months' | translate }}
</mat-option>
<mat-option [value]="'years'">
{{ 'widgets.chart.time-for-comparison-years' | translate }}
</mat-option>
<mat-option [value]="'customInterval'">
{{ 'widgets.chart.time-for-comparison-custom-interval' | translate }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="dataKeyFormGroup.get('timeForComparison').value === 'customInterval'" fxFlex class="mat-block">
<mat-label translate>widgets.chart.custom-interval-value</mat-label>
<input required matInput type="number" min="0" formControlName="comparisonCustomIntervalValue">
</mat-form-field>
<mat-form-field style="padding-bottom: 16px;">
<mat-label translate>datakey.delta-calculation-result</mat-label>
<mat-select formControlName="comparisonResultType" style="min-width: 150px;">
<mat-option *ngFor="let comparisonResultType of comparisonResults" [value]="comparisonResultType">
{{ comparisonResultTypeTranslations.get(comparisonResultTypes[comparisonResultType]) | translate }}
</mat-option>
</mat-select>
</mat-form-field>
</section>
</ng-template>
</mat-expansion-panel>
</fieldset>
</ng-container> </ng-container>
<section fxLayout="column" *ngIf="modelValue.type === dataKeyTypes.function">
<span translate>datakey.data-generation-func</span>
<br/>
<tb-js-func #funcBodyEdit
[functionArgs]="['time', 'prevValue']"
[globalVariables]="functionScopeVariables"
[validationArgs]="[[1, 1],[1, '1']]"
resultType="any"
helpId="widget/config/datakey_generation_fn"
formControlName="funcBody">
</tb-js-func>
</section>
</div> </div>
<div *ngIf="dataKeyFormGroup.get('aggregationType').value && dataKeyFormGroup.get('aggregationType').value !== aggregationTypes.NONE"
class="tb-form-panel tb-slide-toggle">
<div class="tb-form-panel-title" translate>datakey.delta-calculation</div>
<mat-expansion-panel class="tb-settings" [expanded]="dataKeyFormGroup.get('comparisonEnabled').value" [disabled]="!dataKeyFormGroup.get('comparisonEnabled').value">
<mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxLayout="column" fxLayoutAlign="center start">
<mat-slide-toggle class="mat-slide" formControlName="comparisonEnabled" (click)="$event.stopPropagation()">
{{ 'datakey.enable-delta-calculation' | translate }}
</mat-slide-toggle>
<mat-hint class="tb-hint" style="line-height: 15px; padding-left: 52px;">{{ 'datakey.enable-delta-calculation-hint' | translate }}</mat-hint>
</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<section fxLayout="column" *ngIf="dataKeyFormGroup.get('comparisonEnabled').value">
<mat-form-field fxFlex class="mat-block">
<mat-label translate>widgets.chart.time-for-comparison</mat-label>
<mat-select formControlName="timeForComparison">
<mat-option [value]="'previousInterval'">
{{ 'widgets.chart.time-for-comparison-previous-interval' | translate }}
</mat-option>
<mat-option [value]="'days'">
{{ 'widgets.chart.time-for-comparison-days' | translate }}
</mat-option>
<mat-option [value]="'weeks'">
{{ 'widgets.chart.time-for-comparison-weeks' | translate }}
</mat-option>
<mat-option [value]="'months'">
{{ 'widgets.chart.time-for-comparison-months' | translate }}
</mat-option>
<mat-option [value]="'years'">
{{ 'widgets.chart.time-for-comparison-years' | translate }}
</mat-option>
<mat-option [value]="'customInterval'">
{{ 'widgets.chart.time-for-comparison-custom-interval' | translate }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="dataKeyFormGroup.get('timeForComparison').value === 'customInterval'" fxFlex class="mat-block">
<mat-label translate>widgets.chart.custom-interval-value</mat-label>
<input required matInput type="number" min="0" formControlName="comparisonCustomIntervalValue">
</mat-form-field>
<mat-form-field style="padding-bottom: 16px;">
<mat-label translate>datakey.delta-calculation-result</mat-label>
<mat-select formControlName="comparisonResultType" style="min-width: 150px;">
<mat-option *ngFor="let comparisonResultType of comparisonResults" [value]="comparisonResultType">
{{ comparisonResultTypeTranslations.get(comparisonResultTypes[comparisonResultType]) | translate }}
</mat-option>
</mat-select>
</mat-form-field>
</section>
</ng-template>
</mat-expansion-panel>
</div>
<div class="tb-form-panel tb-slide-toggle" <div class="tb-form-panel tb-slide-toggle"
*ngIf="(modelValue.type === dataKeyTypes.timeseries || modelValue.type === dataKeyTypes.attribute || modelValue.type === dataKeyTypes.count) && showPostProcessing"> *ngIf="(modelValue.type === dataKeyTypes.timeseries || modelValue.type === dataKeyTypes.attribute || modelValue.type === dataKeyTypes.count) && showPostProcessing">
<mat-expansion-panel class="tb-settings" [expanded]="dataKeyFormGroup.get('usePostProcessing').value" [disabled]="!dataKeyFormGroup.get('usePostProcessing').value"> <mat-expansion-panel class="tb-settings" [expanded]="dataKeyFormGroup.get('usePostProcessing').value" [disabled]="!dataKeyFormGroup.get('usePostProcessing').value">

4
ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.html

@ -47,7 +47,7 @@
<mat-icon class="tb-mat-18">drag_indicator</mat-icon> <mat-icon class="tb-mat-18">drag_indicator</mat-icon>
</div> </div>
<div class="tb-chip-labels"> <div class="tb-chip-labels">
<div class="tb-chip-label"> <div class="tb-chip-label tb-chip-text tb-chip-icon">
<ng-container *ngIf="isEntityDatasource"> <ng-container *ngIf="isEntityDatasource">
<mat-icon class="tb-mat-18 tb-datakey-icon" *ngIf="key.type === dataKeyTypes.alarm" <mat-icon class="tb-mat-18 tb-datakey-icon" *ngIf="key.type === dataKeyTypes.alarm"
matTooltip="{{'datakey.alarm' | translate }}" matTooltip="{{'datakey.alarm' | translate }}"
@ -71,7 +71,7 @@
</strong> </strong>
</div> </div>
</div> </div>
<div *ngIf="!hideDataKeyColor" style="padding: 3px;"> <div *ngIf="!hideDataKeyColor" fxHide.xs style="padding: 3px;">
<div #keyColorButton class="tb-color-preview small box" (click)="openColorPickerPopup(key, $event, keyColorButton)"> <div #keyColorButton class="tb-color-preview small box" (click)="openColorPickerPopup(key, $event, keyColorButton)">
<div class="tb-color-result" [style]="{background: key.color}"></div> <div class="tb-color-result" [style]="{background: key.color}"></div>
</div> </div>

3
ui-ngx/src/app/modules/home/components/widget/config/data-keys.component.scss

@ -70,6 +70,9 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
&.tb-chip-icon {
min-width: 24px;
}
.mat-icon.tb-datakey-icon { .mat-icon.tb-datakey-icon {
margin-right: 4px; margin-right: 4px;
margin-left: 4px; margin-left: 4px;

24
ui-ngx/src/app/modules/home/components/widget/config/datasources.component.html

@ -44,29 +44,27 @@
[cdkDropListDisabled]="dragDisabled" [cdkDropListDisabled]="dragDisabled"
formArrayName="datasources"> formArrayName="datasources">
<mat-list-item *ngFor="let datasourceControl of datasourcesControls; trackBy: trackByDatasource; let $index = index;" <mat-list-item *ngFor="let datasourceControl of datasourcesControls; trackBy: trackByDatasource; let $index = index;"
class="tb-datasource-list-item tb-draggable" [ngClass]="{'bordered': !singleDatasource}" cdkDrag class="tb-datasource-list-item tb-draggable" cdkDrag
[cdkDragDisabled]="dragDisabled"> [cdkDragDisabled]="dragDisabled">
<div fxFlex fxLayout="row" fxLayoutAlign="start start"> <div class="tb-datasource-row">
<div *ngIf="!singleDatasource" fxLayout="row" fxLayoutAlign="center center" style="width: 42px; height: 56px;"> <div *ngIf="!singleDatasource" class="tb-datasource-index-container">
<div class="tb-datasource-index">{{$index + 1}}</div> <div class="tb-datasource-index">{{$index + 1}}</div>
</div> </div>
<div class="tb-datasource-params" fxFlex> <div class="tb-datasource-params">
<div fxFlex <div class="tb-datasource-item">
fxLayout="row" <tb-datasource [formControl]="datasourceControl">
fxLayoutAlign="start">
<tb-datasource fxFlex
[formControl]="datasourceControl">
</tb-datasource> </tb-datasource>
<div *ngIf="!singleDatasource && !disabled" fxLayout="row" fxLayoutAlign="center center" style="height: 56px;"> <div *ngIf="!singleDatasource && !disabled" class="tb-datasource-buttons">
<button type="button" <button class="tb-box-button" type="button"
mat-icon-button color="primary" mat-icon-button
(click)="removeDatasource($index)" (click)="removeDatasource($index)"
matTooltip="{{ 'widget-config.remove-datasource' | translate }}" matTooltip="{{ 'widget-config.remove-datasource' | translate }}"
matTooltipPosition="above"> matTooltipPosition="above">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
<button *ngIf="!dragDisabled" <button *ngIf="!dragDisabled"
mat-icon-button color="primary" class="tb-box-button"
mat-icon-button
type="button" type="button"
cdkDragHandle cdkDragHandle
matTooltip="{{ 'action.drag' | translate }}" matTooltip="{{ 'action.drag' | translate }}"

43
ui-ngx/src/app/modules/home/components/widget/config/datasources.component.scss

@ -20,11 +20,6 @@
height: auto; height: auto;
display: block; display: block;
padding: 0; padding: 0;
&.bordered {
padding-top: 16px;
border: 1px solid rgba(0, 0, 0, 0.12);
border-radius: 6px;
}
} }
&.tb-draggable { &.tb-draggable {
&.cdk-drag-preview { &.cdk-drag-preview {
@ -34,7 +29,24 @@
} }
.tb-datasource-list-item + .tb-datasource-list-item { .tb-datasource-list-item + .tb-datasource-list-item {
margin-top: 16px; margin-top: 24px;
}
.tb-datasource-row {
flex: 1;
display: flex;
flex-direction: row;
place-content: flex-start;
align-items: flex-start;
}
.tb-datasource-index-container {
width: 36px;
height: 56px;
display: flex;
flex-direction: row;
place-content: flex-start;
align-items: center;
} }
.tb-datasource-index { .tb-datasource-index {
@ -61,6 +73,25 @@
.tb-datasource-params { .tb-datasource-params {
position: relative; position: relative;
flex: 1;
min-width: 0;
.tb-datasource-item {
flex: 1;
display: flex;
flex-direction: row;
align-items: flex-start;
tb-datasource {
flex: 1;
min-width: 0;
}
.tb-datasource-buttons {
height: 56px;
display: flex;
flex-direction: row;
place-content: center;
align-items: center;
}
}
tb-error.tb-datasource-error { tb-error.tb-datasource-error {
position: absolute; position: absolute;
bottom: 4px; bottom: 4px;

2
ui-ngx/src/app/modules/home/components/widget/lib/navigation-card-widget.component.html

@ -16,6 +16,6 @@
--> -->
<a mat-raised-button color="primary" class="tb-nav-button" href="{{settings.path}}" (click)="navigate($event, settings.path)"> <a mat-raised-button color="primary" class="tb-nav-button" href="{{settings.path}}" (click)="navigate($event, settings.path)">
<tb-icon class="tb-mat-96">{{settings.icon}}</tb-icon> <tb-icon matButtonIcon class="tb-mat-96">{{settings.icon}}</tb-icon>
<span>{{translatedName}}</span> <span>{{translatedName}}</span>
</a> </a>

8
ui-ngx/src/app/modules/home/components/widget/lib/settings/alarm/alarms-table-key-settings.component.html

@ -62,8 +62,8 @@
</div> </div>
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="alarmsTableKeySettingsForm.get('useCellStyleFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="alarmsTableKeySettingsForm.get('useCellStyleFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useCellStyleFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useCellStyleFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-cell-style-function' | translate }} {{ 'widgets.table.use-cell-style-function' | translate }}
@ -86,8 +86,8 @@
</div> </div>
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="alarmsTableKeySettingsForm.get('useCellContentFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="alarmsTableKeySettingsForm.get('useCellContentFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useCellContentFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useCellContentFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-cell-content-function' | translate }} {{ 'widgets.table.use-cell-content-function' | translate }}

6
ui-ngx/src/app/modules/home/components/widget/lib/settings/alarm/alarms-table-widget-settings.component.html

@ -94,7 +94,7 @@
<mat-slide-toggle class="mat-slide" formControlName="displayPagination"> <mat-slide-toggle class="mat-slide" formControlName="displayPagination">
{{ 'widgets.table.display-pagination' | translate }} {{ 'widgets.table.display-pagination' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
<div class="tb-form-row space-between"> <div class="tb-form-row space-between column-xs">
<div translate>widgets.table.default-page-size</div> <div translate>widgets.table.default-page-size</div>
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> <mat-form-field appearance="outline" class="number" subscriptSizing="dynamic">
<input matInput formControlName="defaultPageSize" type="number" min="1" step="1" placeholder="{{ 'widget-config.set' | translate }}"> <input matInput formControlName="defaultPageSize" type="number" min="1" step="1" placeholder="{{ 'widget-config.set' | translate }}">
@ -104,8 +104,8 @@
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<div class="tb-form-panel-title" translate>widgets.table.rows</div> <div class="tb-form-panel-title" translate>widgets.table.rows</div>
<mat-expansion-panel class="tb-settings" [expanded]="alarmsTableWidgetSettingsForm.get('useRowStyleFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="alarmsTableWidgetSettingsForm.get('useRowStyleFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useRowStyleFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useRowStyleFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-row-style-function' | translate }} {{ 'widgets.table.use-row-style-function' | translate }}

8
ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/entities-table-key-settings.component.html

@ -62,8 +62,8 @@
</div> </div>
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="entitiesTableKeySettingsForm.get('useCellStyleFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="entitiesTableKeySettingsForm.get('useCellStyleFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useCellStyleFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useCellStyleFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-cell-style-function' | translate }} {{ 'widgets.table.use-cell-style-function' | translate }}
@ -86,8 +86,8 @@
</div> </div>
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="entitiesTableKeySettingsForm.get('useCellContentFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="entitiesTableKeySettingsForm.get('useCellContentFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useCellContentFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useCellContentFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-cell-content-function' | translate }} {{ 'widgets.table.use-cell-content-function' | translate }}

10
ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/entities-table-widget-settings.component.html

@ -41,7 +41,7 @@
</div> </div>
<div class="tb-form-panel"> <div class="tb-form-panel">
<div class="tb-form-panel-title" translate>widgets.table.columns</div> <div class="tb-form-panel-title" translate>widgets.table.columns</div>
<div class="tb-form-row"> <div class="tb-form-row column-xs">
<mat-slide-toggle class="mat-slide fixed-title-width" formControlName="displayEntityName"> <mat-slide-toggle class="mat-slide fixed-title-width" formControlName="displayEntityName">
{{ 'widgets.table.display-entity-name' | translate }} {{ 'widgets.table.display-entity-name' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
@ -49,7 +49,7 @@
<input matInput formControlName="entityNameColumnTitle" placeholder="{{ 'widget-config.set' | translate }}"> <input matInput formControlName="entityNameColumnTitle" placeholder="{{ 'widget-config.set' | translate }}">
</mat-form-field> </mat-form-field>
</div> </div>
<div class="tb-form-row"> <div class="tb-form-row column-xs">
<mat-slide-toggle class="mat-slide fixed-title-width" formControlName="displayEntityName"> <mat-slide-toggle class="mat-slide fixed-title-width" formControlName="displayEntityName">
{{ 'widgets.table.display-entity-label' | translate }} {{ 'widgets.table.display-entity-label' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
@ -91,7 +91,7 @@
<mat-slide-toggle class="mat-slide" formControlName="displayPagination"> <mat-slide-toggle class="mat-slide" formControlName="displayPagination">
{{ 'widgets.table.display-pagination' | translate }} {{ 'widgets.table.display-pagination' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
<div class="tb-form-row space-between"> <div class="tb-form-row space-between column-xs">
<div translate>widgets.table.default-page-size</div> <div translate>widgets.table.default-page-size</div>
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> <mat-form-field appearance="outline" class="number" subscriptSizing="dynamic">
<input matInput formControlName="defaultPageSize" type="number" min="1" step="1" placeholder="{{ 'widget-config.set' | translate }}"> <input matInput formControlName="defaultPageSize" type="number" min="1" step="1" placeholder="{{ 'widget-config.set' | translate }}">
@ -101,8 +101,8 @@
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<div class="tb-form-panel-title" translate>widgets.table.rows</div> <div class="tb-form-panel-title" translate>widgets.table.rows</div>
<mat-expansion-panel class="tb-settings" [expanded]="entitiesTableWidgetSettingsForm.get('useRowStyleFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="entitiesTableWidgetSettingsForm.get('useRowStyleFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useRowStyleFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useRowStyleFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-row-style-function' | translate }} {{ 'widgets.table.use-row-style-function' | translate }}

8
ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/timeseries-table-key-settings.component.html

@ -50,8 +50,8 @@
</div> </div>
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableKeySettingsForm.get('useCellStyleFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableKeySettingsForm.get('useCellStyleFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useCellStyleFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useCellStyleFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-cell-style-function' | translate }} {{ 'widgets.table.use-cell-style-function' | translate }}
@ -74,8 +74,8 @@
</div> </div>
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableKeySettingsForm.get('useCellContentFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableKeySettingsForm.get('useCellContentFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useCellContentFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useCellContentFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-cell-content-function' | translate }} {{ 'widgets.table.use-cell-content-function' | translate }}

8
ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/timeseries-table-latest-key-settings.component.html

@ -59,8 +59,8 @@
</div> </div>
<div [fxShow]="timeseriesTableLatestKeySettingsForm.get('show').value" class="tb-form-panel tb-slide-toggle"> <div [fxShow]="timeseriesTableLatestKeySettingsForm.get('show').value" class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableLatestKeySettingsForm.get('useCellStyleFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableLatestKeySettingsForm.get('useCellStyleFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useCellStyleFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useCellStyleFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-cell-style-function' | translate }} {{ 'widgets.table.use-cell-style-function' | translate }}
@ -83,8 +83,8 @@
</div> </div>
<div [fxShow]="timeseriesTableLatestKeySettingsForm.get('show').value" class="tb-form-panel tb-slide-toggle"> <div [fxShow]="timeseriesTableLatestKeySettingsForm.get('show').value" class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableLatestKeySettingsForm.get('useCellContentFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableLatestKeySettingsForm.get('useCellContentFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useCellContentFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useCellContentFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-cell-content-function' | translate }} {{ 'widgets.table.use-cell-content-function' | translate }}

6
ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/timeseries-table-widget-settings.component.html

@ -59,7 +59,7 @@
<mat-slide-toggle class="mat-slide" formControlName="displayPagination"> <mat-slide-toggle class="mat-slide" formControlName="displayPagination">
{{ 'widgets.table.display-pagination' | translate }} {{ 'widgets.table.display-pagination' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
<div class="tb-form-row space-between"> <div class="tb-form-row space-between column-xs">
<div translate>widgets.table.default-page-size</div> <div translate>widgets.table.default-page-size</div>
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> <mat-form-field appearance="outline" class="number" subscriptSizing="dynamic">
<input matInput formControlName="defaultPageSize" type="number" min="1" step="1" placeholder="{{ 'widget-config.set' | translate }}"> <input matInput formControlName="defaultPageSize" type="number" min="1" step="1" placeholder="{{ 'widget-config.set' | translate }}">
@ -78,8 +78,8 @@
{{ 'widgets.table.hide-empty-lines' | translate }} {{ 'widgets.table.hide-empty-lines' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
<mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableWidgetSettingsForm.get('useRowStyleFunction').value"> <mat-expansion-panel class="tb-settings" [expanded]="timeseriesTableWidgetSettingsForm.get('useRowStyleFunction').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="useRowStyleFunction" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="useRowStyleFunction" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.table.use-row-style-function' | translate }} {{ 'widgets.table.use-row-style-function' | translate }}

8
ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/value-card-widget-settings.component.html

@ -44,8 +44,8 @@
<mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showIcon"> <mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showIcon">
{{ 'widgets.value-card.icon' | translate }} {{ 'widgets.value-card.icon' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<mat-form-field fxFlex appearance="outline" class="number" subscriptSizing="dynamic"> <mat-form-field appearance="outline" class="flex number" subscriptSizing="dynamic">
<input matInput type="number" min="0" formControlName="iconSize" placeholder="{{ 'widget-config.set' | translate }}"> <input matInput type="number" min="0" formControlName="iconSize" placeholder="{{ 'widget-config.set' | translate }}">
</mat-form-field> </mat-form-field>
<tb-css-unit-select fxFlex formControlName="iconSizeUnit"></tb-css-unit-select> <tb-css-unit-select fxFlex formControlName="iconSizeUnit"></tb-css-unit-select>
@ -67,11 +67,11 @@
</tb-color-settings> </tb-color-settings>
</div> </div>
</div> </div>
<div [fxShow]="dateEnabled" class="tb-form-row"> <div [fxShow]="dateEnabled" class="tb-form-row column-xs">
<mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showDate"> <mat-slide-toggle class="mat-slide fixed-title-width" formControlName="showDate">
{{ 'widgets.value-card.date' | translate }} {{ 'widgets.value-card.date' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxFlex.gt-xs fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-date-format-select fxFlex formControlName="dateFormat"></tb-date-format-select> <tb-date-format-select fxFlex formControlName="dateFormat"></tb-date-format-select>
<tb-font-settings formControlName="dateFont" <tb-font-settings formControlName="dateFont"
[previewText]="datePreviewFn"> [previewText]="datePreviewFn">

8
ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/flot-key-settings.component.html

@ -32,8 +32,8 @@
</div> </div>
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="flotKeySettingsFormGroup.get('showLines').value"> <mat-expansion-panel class="tb-settings" [expanded]="flotKeySettingsFormGroup.get('showLines').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="showLines" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="showLines" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.chart.show-line' | translate }} {{ 'widgets.chart.show-line' | translate }}
@ -65,8 +65,8 @@
</div> </div>
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<mat-expansion-panel class="tb-settings" [expanded]="flotKeySettingsFormGroup.get('showPoints').value"> <mat-expansion-panel class="tb-settings" [expanded]="flotKeySettingsFormGroup.get('showPoints').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="showPoints" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="showPoints" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.chart.show-points' | translate }} {{ 'widgets.chart.show-points' | translate }}

2
ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/flot-threshold.component.html

@ -17,7 +17,7 @@
--> -->
<div class="tb-flot-threshold"> <div class="tb-flot-threshold">
<mat-expansion-panel class="tb-settings tb-flot-threshold-settings" fxFlex [formGroup]="thresholdFormGroup" [(expanded)]="expanded"> <mat-expansion-panel class="tb-settings tb-flot-threshold-settings" fxFlex [formGroup]="thresholdFormGroup" [(expanded)]="expanded">
<mat-expansion-panel-header class="fill-width"> <mat-expansion-panel-header>
<div class="tb-threshold-header"> <div class="tb-threshold-header">
<div class="tb-threshold-text">{{ thresholdText() }}</div> <div class="tb-threshold-text">{{ thresholdText() }}</div>
<mat-divider vertical></mat-divider> <mat-divider vertical></mat-divider>

7
ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/flot-threshold.component.scss

@ -29,6 +29,9 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: stretch; align-items: stretch;
.mat-content {
overflow: hidden;
}
.tb-threshold-header { .tb-threshold-header {
flex: 1; flex: 1;
display: flex; display: flex;
@ -36,6 +39,7 @@
gap: 16px; gap: 16px;
align-items: center; align-items: center;
padding-left: 16px; padding-left: 16px;
overflow: hidden;
.mat-divider-vertical { .mat-divider-vertical {
height: 100%; height: 100%;
} }
@ -47,6 +51,9 @@
font-weight: 400; font-weight: 400;
line-height: 16px; line-height: 16px;
letter-spacing: 0.15px; letter-spacing: 0.15px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.mat-expansion-indicator { .mat-expansion-indicator {
margin-right: 22px; margin-right: 22px;

24
ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/flot-widget-settings.component.html

@ -77,8 +77,8 @@
<div *ngIf="chartType === 'graph' || chartType === 'bar'" class="tb-form-panel tb-slide-toggle"> <div *ngIf="chartType === 'graph' || chartType === 'bar'" class="tb-form-panel tb-slide-toggle">
<div class="tb-form-panel-title" translate>widget-config.legend</div> <div class="tb-form-panel-title" translate>widget-config.legend</div>
<mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('showLegend').value"> <mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('showLegend').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="showLegend" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="showLegend" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widget-config.legend' | translate }} {{ 'widget-config.legend' | translate }}
@ -119,8 +119,8 @@
<div class="tb-form-panel stroked tb-slide-toggle"> <div class="tb-form-panel stroked tb-slide-toggle">
<div class="tb-form-panel-title" translate>widgets.chart.ticks</div> <div class="tb-form-panel-title" translate>widgets.chart.ticks</div>
<mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('yaxis.showLabels').value"> <mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('yaxis.showLabels').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="showLabels" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="showLabels" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.chart.ticks' | translate }} {{ 'widgets.chart.ticks' | translate }}
@ -171,8 +171,8 @@
<div class="tb-form-panel stroked tb-slide-toggle"> <div class="tb-form-panel stroked tb-slide-toggle">
<div class="tb-form-panel-title" translate>widgets.chart.ticks</div> <div class="tb-form-panel-title" translate>widgets.chart.ticks</div>
<mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('xaxis.showLabels').value"> <mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('xaxis.showLabels').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="showLabels" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="showLabels" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.chart.ticks' | translate }} {{ 'widgets.chart.ticks' | translate }}
@ -234,8 +234,8 @@
<div class="tb-form-panel tb-slide-toggle"> <div class="tb-form-panel tb-slide-toggle">
<div class="tb-form-panel-title" translate>widgets.chart.tooltip</div> <div class="tb-form-panel-title" translate>widgets.chart.tooltip</div>
<mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('showTooltip').value"> <mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('showTooltip').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="showTooltip" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="showTooltip" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.chart.tooltip' | translate }} {{ 'widgets.chart.tooltip' | translate }}
@ -274,8 +274,8 @@
<div *ngIf="chartType === 'graph' || chartType === 'bar'" class="tb-form-panel tb-slide-toggle"> <div *ngIf="chartType === 'graph' || chartType === 'bar'" class="tb-form-panel tb-slide-toggle">
<div class="tb-form-panel-title" translate>widgets.chart.comparison-settings</div> <div class="tb-form-panel-title" translate>widgets.chart.comparison-settings</div>
<mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('comparisonEnabled').value"> <mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('comparisonEnabled').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="comparisonEnabled" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="comparisonEnabled" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.chart.enable-comparison' | translate }} {{ 'widgets.chart.enable-comparison' | translate }}
@ -350,8 +350,8 @@
<div *ngIf="chartType === 'graph' || chartType === 'bar'" class="tb-form-panel tb-slide-toggle"> <div *ngIf="chartType === 'graph' || chartType === 'bar'" class="tb-form-panel tb-slide-toggle">
<div class="tb-form-panel-title" translate>widgets.chart.custom-legend-settings</div> <div class="tb-form-panel-title" translate>widgets.chart.custom-legend-settings</div>
<mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('customLegendEnabled').value"> <mat-expansion-panel class="tb-settings" [expanded]="flotSettingsFormGroup.get('customLegendEnabled').value">
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> <mat-expansion-panel-header fxLayout="row wrap">
<mat-panel-title fxFlex="60"> <mat-panel-title>
<mat-slide-toggle class="mat-slide" formControlName="customLegendEnabled" (click)="$event.stopPropagation()" <mat-slide-toggle class="mat-slide" formControlName="customLegendEnabled" (click)="$event.stopPropagation()"
fxLayoutAlign="center"> fxLayoutAlign="center">
{{ 'widgets.chart.enable-custom-legend' | translate }} {{ 'widgets.chart.enable-custom-legend' | translate }}

2
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/background-settings-panel.component.html

@ -20,7 +20,7 @@
<div class="tb-form-panel"> <div class="tb-form-panel">
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="16px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="16px">
<div class="tb-form-panel-title" translate>widgets.background.background</div> <div class="tb-form-panel-title" translate>widgets.background.background</div>
<tb-toggle-select formControlName="type" fxFlex> <tb-toggle-select formControlName="type" fxFlex selectMediaBreakpoint="xs">
<tb-toggle-option *ngFor="let type of backgroundTypes" <tb-toggle-option *ngFor="let type of backgroundTypes"
[value]="type"> [value]="type">
{{ backgroundTypeTranslationsMap.get(type) | translate }} {{ backgroundTypeTranslationsMap.get(type) | translate }}

2
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/background-settings-panel.component.ts

@ -94,7 +94,7 @@ export class BackgroundSettingsPanelComponent extends PageComponent implements O
} }
applyColorSettings() { applyColorSettings() {
const backgroundSettings = this.backgroundSettingsFormGroup.value; const backgroundSettings = this.backgroundSettingsFormGroup.getRawValue();
this.backgroundSettingsApplied.emit(backgroundSettings); this.backgroundSettingsApplied.emit(backgroundSettings);
} }

2
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/image-cards-select.component.html

@ -17,7 +17,7 @@
--> -->
<div class="tb-image-cards-select tb-form-panel stroked no-padding"> <div class="tb-image-cards-select tb-form-panel stroked no-padding">
<mat-expansion-panel class="tb-settings" [expanded]="expanded" disabled> <mat-expansion-panel class="tb-settings" [expanded]="expanded" disabled>
<mat-expansion-panel-header class="fill-width" fxLayout="row wrap"> <mat-expansion-panel-header fxLayout="row wrap">
<div fxFlex class="tb-form-row no-border" [class.expanded]="expanded"> <div fxFlex class="tb-form-row no-border" [class.expanded]="expanded">
<div class="fixed-title-width">{{ label }}</div> <div class="fixed-title-width">{{ label }}</div>
<mat-form-field class="tb-image-cards-value-field" fxFlex appearance="outline" subscriptSizing="dynamic" (click)="toggleSelectPanel($event)"> <mat-form-field class="tb-image-cards-value-field" fxFlex appearance="outline" subscriptSizing="dynamic" (click)="toggleSelectPanel($event)">

6
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/value-source.component.html

@ -17,7 +17,7 @@
--> -->
<ng-container [formGroup]="valueSourceFormGroup"> <ng-container [formGroup]="valueSourceFormGroup">
<div style="display: flex;"> <div style="display: flex;">
<tb-toggle-select formControlName="valueSource" style="min-width: 300px;"> <tb-toggle-select formControlName="valueSource" style="width: 300px;" selectMediaBreakpoint="xs">
<tb-toggle-option [value]="'predefinedValue'"> <tb-toggle-option [value]="'predefinedValue'">
{{ 'widgets.value-source.predefined-value' | translate }} {{ 'widgets.value-source.predefined-value' | translate }}
</tb-toggle-option> </tb-toggle-option>
@ -32,7 +32,7 @@
<input matInput formControlName="value" type="number" placeholder="{{ 'widget-config.set' | translate }}"> <input matInput formControlName="value" type="number" placeholder="{{ 'widget-config.set' | translate }}">
</mat-form-field> </mat-form-field>
</div> </div>
<div [fxShow]="valueSourceFormGroup.get('valueSource').value === 'entityAttribute'" class="tb-form-row space-between"> <div [fxShow]="valueSourceFormGroup.get('valueSource').value === 'entityAttribute'" class="tb-form-row space-between column-xs">
<div translate>widgets.value-source.source-entity-alias</div> <div translate>widgets.value-source.source-entity-alias</div>
<mat-form-field class="medium-width" appearance="outline" subscriptSizing="dynamic"> <mat-form-field class="medium-width" appearance="outline" subscriptSizing="dynamic">
<input matInput type="text" placeholder="{{ 'widget-config.set' | translate }}" <input matInput type="text" placeholder="{{ 'widget-config.set' | translate }}"
@ -54,7 +54,7 @@
</mat-autocomplete> </mat-autocomplete>
</mat-form-field> </mat-form-field>
</div> </div>
<div [fxShow]="valueSourceFormGroup.get('valueSource').value === 'entityAttribute'" class="tb-form-row space-between"> <div [fxShow]="valueSourceFormGroup.get('valueSource').value === 'entityAttribute'" class="tb-form-row space-between column-xs">
<div translate>widgets.value-source.source-entity-attribute</div> <div translate>widgets.value-source.source-entity-attribute</div>
<mat-form-field class="medium-width" appearance="outline" subscriptSizing="dynamic"> <mat-form-field class="medium-width" appearance="outline" subscriptSizing="dynamic">
<input matInput type="text" placeholder="{{ 'widget-config.set' | translate }}" <input matInput type="text" placeholder="{{ 'widget-config.set' | translate }}"

66
ui-ngx/src/app/shared/components/image-input.component.html

@ -20,38 +20,14 @@
<ng-container #flow="flow" <ng-container #flow="flow"
[flowConfig]="{singleFile: true, allowDuplicateUploads: true}"> [flowConfig]="{singleFile: true, allowDuplicateUploads: true}">
<div class="tb-image-select-container"> <div class="tb-image-select-container">
<div class="image-container" *ngIf="showPreview"> <div class="image-container" *ngIf="showPreview && (safeImageUrl || disabled)" [class]="{'disabled': disabled}">
<div class="image-content-container" [ngClass]="{'no-padding': disabled}"> <div class="tb-image-preview-container">
<div class="tb-image-preview-container"> <div class="tb-image-preview-text" *ngIf="!safeImageUrl && disabled; else elseBlock">{{ 'dashboard.empty-image' | translate }}</div>
<div *ngIf="!safeImageUrl; else elseBlock">{{ (disabled ? 'dashboard.empty-image' : 'dashboard.no-image') | translate }}</div> <ng-template #elseBlock><img class="tb-image-preview" [src]="safeImageUrl" /></ng-template>
<ng-template #elseBlock><img class="tb-image-preview" [src]="safeImageUrl" /></ng-template>
</div>
<div *ngIf="showClearButton && !disabled" class="tb-image-clear-container">
<button mat-icon-button color="primary"
type="button"
(click)="clearImage()"
matTooltip="{{ 'action.remove' | translate }}"
matTooltipPosition="above">
<mat-icon>close</mat-icon>
</button>
</div>
</div>
</div>
<div *ngIf="!disabled" class="drop-area tb-flow-drop"
[ngClass]="{'float-left': !showPreview && showClearButton}"
flowDrop
[flow]="flow.flowJs">
<div class="upload-label">
<mat-icon>cloud_upload</mat-icon>
<span translate>image-input.drop-image-or</span>
<button type="button" mat-button color="primary" class="browse-file">
<label for="{{inputId}}">{{'file-input.browse-file' | translate}}</label>
</button>
<input class="file-input" flowButton type="file" [flow]="flow.flowJs" [flowAttributes]="{accept: 'image/*'}" id="{{inputId}}">
</div> </div>
</div> <button *ngIf="safeImageUrl && !disabled"
<div *ngIf="!showPreview && showClearButton && !disabled" class="tb-image-clear-container full-height"> mat-icon-button color="primary"
<button mat-icon-button color="primary" class="tb-mat-24"
type="button" type="button"
(click)="clearImage()" (click)="clearImage()"
matTooltip="{{ 'action.remove' | translate }}" matTooltip="{{ 'action.remove' | translate }}"
@ -59,7 +35,33 @@
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
</div> </div>
</div> <div *ngIf="!disabled" class="drop-area tb-flow-drop"
flowDrop
[flow]="flow.flowJs">
<div class="upload-label">
<mat-icon class="tb-mat-32">cloud_upload</mat-icon>
<div class="upload-text-area">
<span class="hide-xs" translate>image-input.drag-and-drop</span>
<div class="upload-button-area">
<span class="hide-xs" translate>image-input.or</span>
<button type="button" mat-button color="primary" class="browse-file">
<label for="{{inputId}}">{{'image-input.browse' | translate}}</label>
</button>
<input class="file-input" flowButton type="file" [flow]="flow.flowJs" [flowAttributes]="{accept: 'image/*'}" id="{{inputId}}">
</div>
</div>
</div>
</div>
<button *ngIf="!showPreview && safeImageUrl && !disabled"
mat-icon-button color="primary"
class="tb-mat-24"
type="button"
(click)="clearImage()"
matTooltip="{{ 'action.remove' | translate }}"
matTooltipPosition="above">
<mat-icon>close</mat-icon>
</button>
</div>
</ng-container> </ng-container>
<div class="tb-hint" *ngIf="maxSizeByte && !disabled" translate [translateParams]="{ size: maxSizeByte | fileSize}">dashboard.maximum-upload-file-size</div> <div class="tb-hint" *ngIf="maxSizeByte && !disabled" translate [translateParams]="{ size: maxSizeByte | fileSize}">dashboard.maximum-upload-file-size</div>
</div> </div>

118
ui-ngx/src/app/shared/components/image-input.component.scss

@ -15,9 +15,8 @@
*/ */
@import "../../../scss/constants"; @import "../../../scss/constants";
$containerHeight: 120px !default; $containerHeight: 96px !default;
$previewContainerWidth: 168px !default; $previewSize: 78px !default;
$previewSize: 96px !default;
:host { :host {
@ -31,30 +30,39 @@ $previewSize: 96px !default;
} }
.tb-image-select-container { .tb-image-select-container {
position: relative;
width: 100%; width: 100%;
height: $containerHeight; height: $containerHeight;
display: flex;
gap: 12px;
align-items: center;
} }
.image-container { .image-container {
position: relative; background: #F3F6FA;
float: left;
height: $containerHeight;
padding: 12px;
margin-right: 8px;
background: rgba(0, 0, 0, 0.03);
border-radius: 4px; border-radius: 4px;
border: 1px solid rgba(0, 0, 0, 0.05);
padding: 8px 12px 8px 8px;
display: flex;
align-items: center;
gap: 12px;
&.disabled {
padding: 8px;
}
} }
.image-content-container { .tb-image-preview-container {
background: #FFFFFF; width: $previewSize;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 4px;
padding-left: 8px;
height: $previewSize; height: $previewSize;
&.no-padding { border: 1px solid rgba(0, 0, 0, 0.12);
padding-left: 0px; background: #fff;
} display: flex;
align-items: center;
justify-content: center;
}
.tb-image-preview-text {
font-size: 14px;
text-align: center;
} }
.tb-image-preview { .tb-image-preview {
@ -64,57 +72,18 @@ $previewSize: 96px !default;
max-height: $previewSize - 2px; max-height: $previewSize - 2px;
} }
.tb-image-preview-container {
position: relative;
float: left;
width: $previewSize;
height: $previewSize;
margin-top: -1px;
margin-bottom: -1px;
border: 1px solid rgba(0, 0, 0, 0.54);
div {
width: 100%;
font-size: 18px;
text-align: center;
}
div,
.tb-image-preview {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.tb-image-clear-container {
position: relative;
float: right;
height: $previewSize;
display: flex;
align-items: center;
&.full-height {
height: $containerHeight;
}
}
.file-input { .file-input {
display: none; display: none;
} }
.tb-flow-drop { .tb-flow-drop {
position: relative; height: 100%;
height: $containerHeight; flex: 1;
overflow: hidden; overflow: hidden;
border: 2px dashed rgba(0, 0, 0, 0.2); border: 2px dashed rgba(0, 0, 0, 0.2);
border-radius: 4px; border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
&.float-left {
float: left;
}
.upload-label { .upload-label {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -123,11 +92,29 @@ $previewSize: 96px !default;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 16px; gap: 8px;
color: rgba(0, 0, 0, 0.54);
text-align: center;
.mat-icon { .mat-icon {
margin-right: 17px; color: rgba(0,0,0,0.12);
}
.upload-text-area {
display: flex;
flex-direction: column;
align-items: center;
font-size: 16px;
line-height: 24px;
color: rgba(0, 0, 0, 0.54);
text-align: center;
.hide-xs {
@media #{$mat-xs} {
display: none;
}
}
}
.upload-button-area {
display: flex;
justify-content: center;
align-items: flex-start;
gap: 6px;
} }
} }
} }
@ -138,13 +125,14 @@ $previewSize: 96px !default;
} }
:host ::ng-deep { :host ::ng-deep {
button.browse-file { button.mat-mdc-button.mat-mdc-button-base.browse-file {
padding: 0; padding: 0;
min-width: 0;
height: 24px;
font-size: 16px; font-size: 16px;
label { label {
display: block; display: block;
cursor: pointer; cursor: pointer;
padding: 0 16px;
} }
} }
} }

3
ui-ngx/src/app/shared/components/image-input.component.ts

@ -65,9 +65,6 @@ export class ImageInputComponent extends PageComponent implements AfterViewInit,
@Input() @Input()
disabled: boolean; disabled: boolean;
@Input()
showClearButton = true;
@Input() @Input()
showPreview = true; showPreview = true;

4
ui-ngx/src/app/shared/components/toggle-header.component.scss

@ -29,10 +29,12 @@
display: block; display: block;
} }
} }
.tb-toggle-container { .tb-toggle-container, .tb-toggle-header-select {
display: inline-grid; display: inline-grid;
grid-column: 2; grid-column: 2;
overflow: hidden; overflow: hidden;
}
.tb-toggle-container {
&.tb-disable-pagination { &.tb-disable-pagination {
overflow: visible; overflow: visible;
} }

37
ui-ngx/src/app/shared/components/toggle-header.component.ts

@ -16,7 +16,7 @@
import { import {
AfterContentChecked, AfterContentChecked,
AfterContentInit, AfterContentInit, AfterViewChecked,
AfterViewInit, AfterViewInit,
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
@ -117,7 +117,8 @@ export abstract class _ToggleBase extends PageComponent implements AfterContentI
templateUrl: './toggle-header.component.html', templateUrl: './toggle-header.component.html',
styleUrls: ['./toggle-header.component.scss'] styleUrls: ['./toggle-header.component.scss']
}) })
export class ToggleHeaderComponent extends _ToggleBase implements OnInit, AfterViewInit, AfterContentInit, AfterContentChecked, OnDestroy { export class ToggleHeaderComponent extends _ToggleBase implements OnInit, AfterViewInit, AfterContentInit,
AfterContentChecked, AfterViewChecked, OnDestroy {
@ViewChild('toggleGroup', {static: false}) @ViewChild('toggleGroup', {static: false})
toggleGroup: ElementRef<HTMLElement>; toggleGroup: ElementRef<HTMLElement>;
@ -130,6 +131,7 @@ export class ToggleHeaderComponent extends _ToggleBase implements OnInit, AfterV
@HostBinding('class.tb-toggle-header-pagination-controls-enabled') @HostBinding('class.tb-toggle-header-pagination-controls-enabled')
private showPaginationControls = false; private showPaginationControls = false;
private _showPaginationControlsChanged = false;
private toggleGroupResize$: ResizeObserver; private toggleGroupResize$: ResizeObserver;
@ -254,6 +256,14 @@ export class ToggleHeaderComponent extends _ToggleBase implements OnInit, AfterV
} }
} }
ngAfterViewChecked() {
if (this._showPaginationControlsChanged) {
this.scrollToToggleOptionValue();
this._showPaginationControlsChanged = false;
this.cd.markForCheck();
}
}
trackByHeaderOption(index: number, option: ToggleHeaderOption){ trackByHeaderOption(index: number, option: ToggleHeaderOption){
return option.value; return option.value;
} }
@ -301,10 +311,13 @@ export class ToggleHeaderComponent extends _ToggleBase implements OnInit, AfterV
private scrollToToggleOptionValue() { private scrollToToggleOptionValue() {
if (this.buttonToggleGroup && this.buttonToggleGroup.selected) { if (this.buttonToggleGroup && this.buttonToggleGroup.selected) {
const selectedToggleButton = this.buttonToggleGroup.selected as MatButtonToggle; const selectedToggleButton = this.buttonToggleGroup.selected as MatButtonToggle;
const index = this.options.findIndex(o => o.value === selectedToggleButton.value);
const isLast = index === this.options.length - 1;
const isFirst = index === 0;
const viewLength = this.toggleGroupContainer.nativeElement.offsetWidth; const viewLength = this.toggleGroupContainer.nativeElement.offsetWidth;
const {offsetLeft, offsetWidth} = (selectedToggleButton._buttonElement.nativeElement.offsetParent as HTMLElement); const {offsetLeft, offsetWidth} = (selectedToggleButton._buttonElement.nativeElement.offsetParent as HTMLElement);
const labelBeforePos = offsetLeft; // this.toggleGroup.nativeElement.offsetWidth - offsetLeft; const labelBeforePos = isFirst ? 0 : offsetLeft;
const labelAfterPos = labelBeforePos + offsetWidth; const labelAfterPos = isLast ? this.toggleGroup.nativeElement.scrollWidth : labelBeforePos + offsetWidth;
const beforeVisiblePos = this.scrollDistance; const beforeVisiblePos = this.scrollDistance;
const afterVisiblePos = this.scrollDistance + viewLength; const afterVisiblePos = this.scrollDistance + viewLength;
if (labelBeforePos < beforeVisiblePos) { if (labelBeforePos < beforeVisiblePos) {
@ -331,9 +344,7 @@ export class ToggleHeaderComponent extends _ToggleBase implements OnInit, AfterV
if (!isEnabled) { if (!isEnabled) {
this.scrollDistance = 0; this.scrollDistance = 0;
} else { } else {
setTimeout(() => { this._showPaginationControlsChanged = true;
this.scrollToToggleOptionValue();
}, 0);
} }
this.cd.markForCheck(); this.cd.markForCheck();
this.showPaginationControls = isEnabled; this.showPaginationControls = isEnabled;
@ -373,11 +384,13 @@ export class ToggleHeaderComponent extends _ToggleBase implements OnInit, AfterV
} }
private updateToggleHeaderScrollPosition() { private updateToggleHeaderScrollPosition() {
const scrollDistance = this.scrollDistance; if (this.toggleGroupContainer) {
const translateX = -scrollDistance; const scrollDistance = this.scrollDistance;
this.toggleGroup.nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`; const translateX = -scrollDistance;
if (this.platform.TRIDENT || this.platform.EDGE) { this.toggleGroup.nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;
this.toggleGroupContainer.nativeElement.scrollLeft = 0; if (this.platform.TRIDENT || this.platform.EDGE) {
this.toggleGroupContainer.nativeElement.scrollLeft = 0;
}
} }
} }
} }

2
ui-ngx/src/app/shared/components/unit-input.component.html

@ -15,7 +15,7 @@
limitations under the License. limitations under the License.
--> -->
<mat-form-field fxFlex appearance="outline" class="tb-inline-field tb-suffix-show-on-hover" subscriptSizing="dynamic"> <mat-form-field fxFlex appearance="outline" class="tb-inline-field tb-suffix-show-on-hover" subscriptSizing="dynamic" style="width: 100%;">
<input matInput #unitInput [formControl]="unitsFormControl" <input matInput #unitInput [formControl]="unitsFormControl"
placeholder="{{ 'widget-config.set' | translate }}" placeholder="{{ 'widget-config.set' | translate }}"
(focusin)="onFocus()" (focusin)="onFocus()"

1
ui-ngx/src/assets/locale/locale.constant-ca_ES.json

@ -2802,7 +2802,6 @@
"browse-files": "Navegar fitxers" "browse-files": "Navegar fitxers"
}, },
"image-input": { "image-input": {
"drop-image-or": "Arrossegar i deixar anar imatges o",
"drop-images-or": "Arrossegar i deixar anar imatges o", "drop-images-or": "Arrossegar i deixar anar imatges o",
"no-images": "No hi ha imatges seleccionades", "no-images": "No hi ha imatges seleccionades",
"images": "imatges" "images": "imatges"

4
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -2696,8 +2696,10 @@
"browse-files": "Browse files" "browse-files": "Browse files"
}, },
"image-input": { "image-input": {
"drop-image-or": "Drag and drop an image or",
"drop-images-or": "Drag and drop an images or", "drop-images-or": "Drag and drop an images or",
"drag-and-drop": "Drag & Drop",
"or": "or",
"browse": "Browse",
"no-images": "No images selected", "no-images": "No images selected",
"images": "images" "images": "images"
}, },

1
ui-ngx/src/assets/locale/locale.constant-es_ES.json

@ -2602,7 +2602,6 @@
"browse-files": "Navegar ficheros" "browse-files": "Navegar ficheros"
}, },
"image-input": { "image-input": {
"drop-image-or": "Arrastrar y soltar una imagen o",
"drop-images-or": "Arrastrar y soltar imagenes o", "drop-images-or": "Arrastrar y soltar imagenes o",
"no-images": "No hay imágenes seleccionadas", "no-images": "No hay imágenes seleccionadas",
"images": "imágenes" "images": "imágenes"

1
ui-ngx/src/assets/locale/locale.constant-zh_CN.json

@ -2459,7 +2459,6 @@
"browse-files": "浏览文件" "browse-files": "浏览文件"
}, },
"image-input": { "image-input": {
"drop-image-or": "拖拽图片或",
"drop-images-or": "拖拽图片或", "drop-images-or": "拖拽图片或",
"no-images": "没有图片", "no-images": "没有图片",
"images": "图片" "images": "图片"

1
ui-ngx/src/assets/locale/locale.constant-zh_TW.json

@ -2363,7 +2363,6 @@
"browse-files": "瀏覽文件" "browse-files": "瀏覽文件"
}, },
"image-input": { "image-input": {
"drop-image-or": "拖放圖像或",
"drop-images-or": "拖放圖像或", "drop-images-or": "拖放圖像或",
"no-images": "未選擇任何圖像", "no-images": "未選擇任何圖像",
"images": "圖像" "images": "圖像"

25
ui-ngx/src/form.scss

@ -22,6 +22,12 @@
align-items: stretch; align-items: stretch;
gap: 12px; gap: 12px;
padding: 12px 12px 12px 16px; padding: 12px 12px 12px 16px;
.mat-mdc-form-field, tb-unit-input {
width: auto;
&.medium-width {
width: auto;
}
}
} }
} }
@ -85,15 +91,6 @@
line-height: 24px; line-height: 24px;
letter-spacing: 0.25px; letter-spacing: 0.25px;
padding: 0; padding: 0;
.mat-content {
flex: 0;
white-space: nowrap;
}
&.fill-width {
.mat-content {
flex: 1;
}
}
&:hover { &:hover {
background: none; background: none;
} }
@ -182,22 +179,20 @@
margin-top: -7px; margin-top: -7px;
margin-bottom: -7px; margin-bottom: -7px;
} }
.mat-mdc-form-field { .mat-mdc-form-field, tb-unit-input {
width: 106px; width: 106px;
&.medium-width { &.medium-width {
width: 220px; width: 220px;
} }
@media #{$mat-xs} { &.flex {
flex: 1;
width: auto; width: auto;
&.medium-width {
width: auto;
}
} }
} }
.fixed-title-width { .fixed-title-width {
min-width: 200px; min-width: 200px;
@media #{$mat-xs} { @media #{$mat-xs} {
min-width: 0; min-width: fit-content;
} }
} }
.mat-slide:only-child { .mat-slide:only-child {

Loading…
Cancel
Save