Browse Source

UI: Angular 15 migration

pull/8204/head
Igor Kulikov 4 years ago
parent
commit
f99fa3c038
  1. 4
      application/src/main/data/json/system/widget_bundles/input_widgets.json
  2. 2
      ui-ngx/src/app/modules/home/components/alias/entity-alias-dialog.component.html
  3. 7
      ui-ngx/src/app/modules/home/components/alias/entity-alias-select.component.html
  4. 7
      ui-ngx/src/app/modules/home/components/alias/entity-aliases-dialog.component.html
  5. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-image-dialog.component.scss
  6. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html
  7. 14
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.scss
  8. 4
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.html
  9. 20
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.scss
  10. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/edit-widget.component.ts
  11. 13
      ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.scss
  12. 10
      ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html
  13. 46
      ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.scss
  14. 18
      ui-ngx/src/app/modules/home/components/dashboard-page/states/default-state-controller.component.scss
  15. 26
      ui-ngx/src/app/modules/home/components/dashboard-page/states/entity-state-controller.component.scss
  16. 10
      ui-ngx/src/app/modules/home/components/details-panel.component.ts
  17. 8
      ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html
  18. 7
      ui-ngx/src/app/modules/home/components/filter/filter-select.component.html
  19. 4
      ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.html
  20. 9
      ui-ngx/src/app/modules/home/components/profile/alarm/alarm-duration-predicate-value.component.html
  21. 6
      ui-ngx/src/app/modules/home/components/profile/alarm/alarm-dynamic-value.component.html
  22. 3
      ui-ngx/src/app/modules/home/components/profile/alarm/alarm-rule-condition-dialog.component.html
  23. 2
      ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html
  24. 4
      ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.ts
  25. 2
      ui-ngx/src/app/modules/home/components/profile/device-profile-autocomplete.component.html
  26. 4
      ui-ngx/src/app/modules/home/components/profile/device-profile-autocomplete.component.ts
  27. 6
      ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-attributes-key-list.component.html
  28. 49
      ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-attributes-key-list.component.scss
  29. 3
      ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-observe-attr-telemetry-resources.component.html
  30. 9
      ui-ngx/src/app/modules/home/components/profile/device/snmp/snmp-device-profile-mapping.component.html
  31. 32
      ui-ngx/src/app/modules/home/components/profile/device/snmp/snmp-device-profile-mapping.component.scss
  32. 5
      ui-ngx/src/app/modules/home/components/relation/relation-filters.component.html
  33. 26
      ui-ngx/src/app/modules/home/components/relation/relation-filters.component.scss
  34. 3
      ui-ngx/src/app/modules/home/components/vc/entity-versions-table.component.html
  35. 16
      ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-editor.component.html
  36. 8
      ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-editor.component.scss
  37. 9
      ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-resources-tabs.component.html
  38. 38
      ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-resources-tabs.component.scss
  39. 3
      ui-ngx/src/app/modules/home/components/widget/action/mobile-action-editor.component.ts
  40. 2
      ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html
  41. 5
      ui-ngx/src/app/modules/home/components/widget/data-key-config.component.html
  42. 143
      ui-ngx/src/app/modules/home/components/widget/data-keys.component.html
  43. 52
      ui-ngx/src/app/modules/home/components/widget/data-keys.component.scss
  44. 45
      ui-ngx/src/app/modules/home/components/widget/data-keys.component.ts
  45. 41
      ui-ngx/src/app/modules/home/components/widget/lib/navigation-card-widget.component.scss
  46. 55
      ui-ngx/src/app/modules/home/components/widget/lib/navigation-cards-widget.component.scss
  47. 30
      ui-ngx/src/app/modules/home/components/widget/widget-config.component.html
  48. 183
      ui-ngx/src/app/modules/home/components/widget/widget-config.component.scss
  49. 2
      ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts
  50. 1
      ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html
  51. 1
      ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.html
  52. 1
      ui-ngx/src/app/modules/home/pages/device/device-table-header.component.html
  53. 1
      ui-ngx/src/app/modules/home/pages/edge/edge-table-header.component.html
  54. 1
      ui-ngx/src/app/modules/home/pages/entity-view/entity-view-table-header.component.html
  55. 6
      ui-ngx/src/app/modules/home/pages/security/authentication-dialog/email-auth-dialog.component.html
  56. 3
      ui-ngx/src/app/modules/home/pages/security/authentication-dialog/sms-auth-dialog.component.html
  57. 3
      ui-ngx/src/app/modules/home/pages/security/authentication-dialog/totp-auth-dialog.component.html
  58. 2
      ui-ngx/src/app/modules/home/pages/security/security.component.html
  59. 7
      ui-ngx/src/app/modules/home/pages/security/security.component.ts
  60. 3
      ui-ngx/src/app/modules/home/pages/widget/widget-editor.component.html
  61. 5
      ui-ngx/src/app/modules/login/pages/login/two-factor-auth-login.component.html
  62. 10
      ui-ngx/src/app/modules/login/pages/login/two-factor-auth-login.component.scss
  63. 5
      ui-ngx/src/app/shared/components/dashboard-autocomplete.component.ts
  64. 3
      ui-ngx/src/app/shared/components/dialog/material-icons-dialog.component.html
  65. 12
      ui-ngx/src/app/shared/components/dialog/material-icons-dialog.component.scss
  66. 2
      ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.html
  67. 4
      ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.ts
  68. 2
      ui-ngx/src/app/shared/components/entity/entity-type-list.component.html
  69. 4
      ui-ngx/src/app/shared/components/entity/entity-type-list.component.ts
  70. 6
      ui-ngx/src/app/shared/components/kv-map.component.html
  71. 18
      ui-ngx/src/app/shared/components/kv-map.component.scss
  72. 6
      ui-ngx/src/app/shared/components/markdown-editor.component.html
  73. 36
      ui-ngx/src/app/shared/components/markdown-editor.component.scss
  74. 43
      ui-ngx/src/app/shared/components/mat-chip-draggable.directive.ts
  75. 11
      ui-ngx/src/app/shared/components/material-icon-select.component.scss
  76. 2
      ui-ngx/src/app/shared/components/relation/relation-type-autocomplete.component.html
  77. 4
      ui-ngx/src/app/shared/components/relation/relation-type-autocomplete.component.ts
  78. 2
      ui-ngx/src/app/shared/components/time/history-selector/history-selector.component.html
  79. 2
      ui-ngx/src/app/shared/components/vc/branch-autocomplete.component.html
  80. 4
      ui-ngx/src/app/shared/components/vc/branch-autocomplete.component.ts
  81. 3
      ui-ngx/src/app/shared/components/widgets-bundle-select.component.html
  82. 135
      ui-ngx/src/app/shared/components/widgets-bundle-select.component.scss
  83. 102
      ui-ngx/src/styles.scss
  84. 2
      ui-ngx/yarn.lock

4
application/src/main/data/json/system/widget_bundles/input_widgets.json

File diff suppressed because one or more lines are too long

2
ui-ngx/src/app/modules/home/components/alias/entity-alias-dialog.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<form [formGroup]="entityAliasFormGroup" (ngSubmit)="save()" style="min-width: 480px;">
<form [formGroup]="entityAliasFormGroup" (ngSubmit)="save()" style="width: 700px;">
<mat-toolbar color="primary">
<h2>{{ (isAdd ? 'alias.add' : 'alias.edit') | translate }}</h2>
<span fxFlex></span>

7
ui-ngx/src/app/modules/home/components/alias/entity-alias-select.component.html

@ -15,10 +15,9 @@
limitations under the License.
-->
<mat-form-field [floatLabel]="showLabel ? 'auto' : 'always'"
[hideRequiredMarker]="!showLabel" [formGroup]="selectEntityAliasFormGroup" class="mat-block">
<mat-label *ngIf="!showLabel"></mat-label>
<input matInput type="text" placeholder="{{ 'entity.entity-alias' | translate }}"
<mat-form-field [formGroup]="selectEntityAliasFormGroup" class="mat-block">
<mat-label *ngIf="showLabel">{{ 'entity.entity-alias' | translate }}</mat-label>
<input matInput type="text" placeholder="{{ !showLabel ? ('entity.entity-alias' | translate) : ''}}"
#entityAliasInput
formControlName="entityAlias"
(focusin)="onFocus()"

7
ui-ngx/src/app/modules/home/components/alias/entity-aliases-dialog.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<form [formGroup]="entityAliasesFormGroup" (ngSubmit)="save()" style="width: 700px;">
<form [formGroup]="entityAliasesFormGroup" (ngSubmit)="save()" style="width: 800px;">
<mat-toolbar color="primary">
<h2>{{ title | translate }}</h2>
<span fxFlex></span>
@ -32,7 +32,7 @@
<div class="tb-aliases-header" fxLayout="row" fxLayoutAlign="start center">
<span fxFlex="5"></span>
<div fxFlex="95" fxLayout="row" fxLayoutAlign="start center">
<span class="tb-header-label" translate fxFlex="150px">alias.name</span>
<span class="tb-header-label" translate fxFlex fxFlex.gt-sm="200px">alias.name</span>
<span class="tb-header-label" translate fxFlex style="padding-left: 10px;">alias.entity-filter</span>
<span class="tb-header-label" translate fxFlex="120px" style="padding-left: 10px;">alias.resolve-multiple</span>
<span style="min-width: 80px;"></span>
@ -45,8 +45,7 @@
*ngFor="let entityAliasControl of entityAliasesFormArray().controls; let $index = index">
<span fxFlex="5">{{$index + 1}}.</span>
<div class="mat-elevation-z4 tb-alias" fxFlex="95" fxLayout="row" fxLayoutAlign="start center">
<mat-form-field floatLabel="always" hideRequiredMarker class="mat-block" fxFlex="150px">
<mat-label></mat-label>
<mat-form-field class="mat-block" fxFlex fxFlex.gt-sm="200px" style="padding-top: 20px;">
<input matInput [formControl]="entityAliasControl.get('alias')" required placeholder="{{ 'entity.alias' | translate }}">
<mat-error *ngIf="entityAliasControl.get('alias').hasError('required')">
{{ 'entity.alias-required' | translate }}

2
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-image-dialog.component.scss

@ -18,7 +18,7 @@ $previewSize: 300px !default;
:host {
mat-form-field.rect-field {
max-width: 60px;
max-width: 80px;
}
.tb-image-preview {

2
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html

@ -157,7 +157,7 @@
<section *ngIf="!widgetEditMode" class="tb-dashboard-title"
[ngStyle]="{'color': dashboard.configuration.settings.titleColor}">
<h3 [fxShow]="!isEdit && displayTitle()">{{ translatedDashboardTitle }}</h3>
<mat-form-field [fxShow]="isEdit" class="mat-block">
<mat-form-field [fxShow]="isEdit" class="mat-block tb-appearance-transparent">
<mat-label translate [ngStyle]="{'color': dashboard.configuration.settings.titleColor}">dashboard.title</mat-label>
<input matInput class="tb-dashboard-title"
[ngStyle]="{'color': dashboard.configuration.settings.titleColor}"

14
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.scss

@ -35,11 +35,15 @@ div.tb-dashboard-page {
position: relative;
padding-left: 20px;
max-height: 60px;
mat-form-field {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
width: 100%;
.mat-mdc-form-field.mat-form-field-appearance-fill.tb-appearance-transparent {
.mat-mdc-text-field-wrapper {
.mat-mdc-form-field-infix {
width: 100%;
padding-top: 20px;
.mat-mdc-floating-label {
top: 24px;
}
}
}
}
input.tb-dashboard-title {

4
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.html

@ -19,7 +19,7 @@
<div *ngIf="widgetsBundle; else bundles">
<div *ngIf="(widgets$ | async)?.length; else loadingWidgets" fxFlexFill fxLayoutGap="12px grid" fxLayout="row wrap">
<div *ngFor="let widget of widgets$ | async" class="mat-card-container">
<mat-card appearance="outlined" fxFlexFill fxLayout="row" fxLayoutGap="16px" (click)="onWidgetClicked($event, widget)">
<mat-card appearance="raised" fxFlexFill fxLayout="row" fxLayoutGap="16px" (click)="onWidgetClicked($event, widget)">
<div class="preview-container" fxFlex="45">
<img class="preview" [src]="getPreviewImage(widget.image)" alt="{{ widget.title }}">
</div>
@ -52,7 +52,7 @@
<ng-template #bundles>
<div *ngIf="(widgetsBundles$ | async)?.length; else loadingWidgetBundles" fxFlexFill fxLayoutGap="12px grid" fxLayout="row wrap">
<div *ngFor="let widgetsBundle of widgetsBundles$ | async" class="mat-card-container">
<mat-card appearance="outlined" fxFlexFill fxLayout="row" fxLayoutGap="16px" (click)="selectBundle($event, widgetsBundle)">
<mat-card appearance="raised" fxFlexFill fxLayout="row" fxLayoutGap="16px" (click)="selectBundle($event, widgetsBundle)">
<div class="preview-container" fxFlex="45">
<img class="preview" [src]=getPreviewImage(widgetsBundle.image) alt="{{ widgetsBundle.title }}">
</div>

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

@ -24,10 +24,6 @@
.widget-select {
padding: 12px 0 12px 12px;
background-color: #cfd8dc;
/*TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version.
*/
.mat-card-container {
flex: 0 0 100%;
max-width: 100%;
@ -41,6 +37,7 @@
.mat-mdc-card {
cursor: pointer;
transition: box-shadow 0.2s;
padding: 16px;
.preview-container {
text-align: center;
@ -55,19 +52,28 @@
.mat-mdc-card-title {
font-size: 20px;
line-height: normal;
margin-bottom: 8px;
}
.mat-mdc-card-subtitle {
margin-bottom: 16px;
margin-top: -4px;
line-height: normal;
font-weight: normal;
}
.mat-mdc-card-content {
font-size: 14px;
line-height: 18px;
color: #666;
margin-bottom: 16px;
padding: 0;
}
}
}
@media #{$mat-gt-xs} {
/*TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version.
*/
.mat-card-container {
flex: 0 0 50%;
max-width: 50%;
@ -75,8 +81,6 @@
}
@media screen and (min-width: 2000px) {
/*TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version.
*/
.mat-card-container {
flex: 0 0 33.333333%;
max-width: 33.333333%;

2
ui-ngx/src/app/modules/home/components/dashboard-page/edit-widget.component.ts

@ -14,7 +14,7 @@
/// limitations under the License.
///
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
import { PageComponent } from '@shared/components/page.component';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';

13
ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.scss

@ -15,17 +15,14 @@
*/
:host {
button.tb-add-new-widget {
height: auto;
padding-right: 12px;
font-size: 20px;
border-style: dashed;
border-width: 2px;
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
::ng-deep .mat-button-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
}

10
ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html

@ -145,9 +145,8 @@
max="{{ layoutPercentageSize.MAX }}"
style="width: 100%;"
color="accent"
formControlName="sliderPercentage"
thumbLabel
[displayWith]="formatSliderTooltipLabel.bind(this)"><input matSliderThumb />
discrete
[displayWith]="formatSliderTooltipLabel.bind(this)"><input matSliderThumb formControlName="sliderPercentage"/>
</mat-slider>
<mat-slider *ngIf="layoutsFormGroup.get('type').value !== layoutWidthType.PERCENTAGE"
step="1"
@ -155,9 +154,8 @@
max="{{ layoutFixedSize.MAX }}"
style="width: 100%;"
color="accent"
formControlName="sliderFixed"
thumbLabel
[displayWith]="formatSliderTooltipLabel.bind(this)"><input matSliderThumb />
discrete
[displayWith]="formatSliderTooltipLabel.bind(this)"><input matSliderThumb formControlName="sliderFixed"/>
</mat-slider>
<div fxLayout="row" fxLayoutAlign="space-between center" class="tb-hint tb-hint-group" style="width: 100%;">
<label>

46
ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.scss

@ -124,63 +124,17 @@ $tb-warn: mat.get-color-from-palette(map-get($tb-theme, warn), text);
}
:host ::ng-deep {
/*TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version.
*/
.mat-slider-wrapper {
/*TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version.
*/
.mat-slider-thumb-container {
/*TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version.
*/
.mat-slider-thumb-label {
width: 35px;
height: 35px;
}
}
}
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle-group {
width: 100%;
min-width: 354px;
border: 2px solid rgba(0, 0, 0, 0.06);
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle-checked {
background: rgba(0, 0, 0, 0.06);
}
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle {
border: none !important;
}
}
/* Make mat-slider tooltip always visible */
/*TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version.
*/
.mat-slider-thumb-label {
transform: rotate(45deg) !important;
border-radius: 50% 50% 0 !important;
}
/*TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version.
*/
.mat-slider-thumb {
transform: scale(0) !important;
}
/*TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version.
*/
.mat-slider-thumb-label-text {
opacity: 1 !important;
}
}
::ng-deep {

18
ui-ngx/src/app/modules/home/components/dashboard-page/states/default-state-controller.component.scss

@ -15,23 +15,15 @@
*/
:host {
width: min-content; //for Safari
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
mat-select.default-state-controller {
margin: 0;
}
}
:host ::ng-deep {
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
mat-select.default-state-controller {
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-select-value {
.mat-mdc-select.default-state-controller {
.mat-mdc-select-value {
max-width: 200px;
}
.mat-mdc-select-arrow {
width: 24px;
}
}
}

26
ui-ngx/src/app/modules/home/components/dashboard-page/states/entity-state-controller.component.scss

@ -33,34 +33,20 @@
white-space: nowrap;
outline: none;
}
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
mat-select {
margin: 0;
}
}
}
:host ::ng-deep {
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
mat-select {
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-select-value {
.mat-mdc-select {
.mat-mdc-select-value {
max-width: 200px;
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-select-value-text {
.mat-mdc-select-value-text {
font-size: 18px;
font-weight: 700;
}
}
.mat-mdc-select-arrow {
width: 24px;
}
}
}

10
ui-ngx/src/app/modules/home/components/details-panel.component.ts

@ -14,7 +14,15 @@
/// limitations under the License.
///
import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
EventEmitter,
Input,
OnDestroy,
Output
} from '@angular/core';
import { PageComponent } from '@shared/components/page.component';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';

8
ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html

@ -144,8 +144,8 @@
formControlName="rootEntity">
</tb-entity-select>
</div>
<div fxFlex fxLayout="row" *ngIf="filterFormGroup.get('rootStateEntity').value">
<mat-form-field floatLabel="always" class="mat-block" style="margin-top: 14px; padding-right: 8px;">
<div fxFlex fxLayout="column" fxLayout.gt-sm="row" *ngIf="filterFormGroup.get('rootStateEntity').value">
<mat-form-field floatLabel="always" class="mat-block" style="margin-top: 24px; padding-right: 8px;">
<mat-label translate>alias.state-entity-parameter-name</mat-label>
<input matInput formControlName="stateEntityParamName"
placeholder="{{ 'alias.default-entity-parameter-name' | translate }}">
@ -211,8 +211,8 @@
formControlName="rootEntity">
</tb-entity-select>
</div>
<div fxFlex fxLayout="row" *ngIf="filterFormGroup.get('rootStateEntity').value">
<mat-form-field floatLabel="always" class="mat-block" style="margin-top: 14px; padding-right: 8px;">
<div fxFlex fxLayout="column" fxLayout.gt-sm="row" *ngIf="filterFormGroup.get('rootStateEntity').value">
<mat-form-field floatLabel="always" class="mat-block" style="margin-top: 24px; padding-right: 8px;">
<mat-label translate>alias.state-entity-parameter-name</mat-label>
<input matInput formControlName="stateEntityParamName"
placeholder="{{ 'alias.default-entity-parameter-name' | translate }}">

7
ui-ngx/src/app/modules/home/components/filter/filter-select.component.html

@ -15,10 +15,9 @@
limitations under the License.
-->
<mat-form-field [floatLabel]="showLabel ? 'auto' : 'always'"
[hideRequiredMarker]="!showLabel" [formGroup]="selectFilterFormGroup" class="mat-block">
<mat-label *ngIf="!showLabel"></mat-label>
<input matInput type="text" placeholder="{{ 'filter.filter' | translate }}"
<mat-form-field [formGroup]="selectFilterFormGroup" class="mat-block">
<mat-label *ngIf="showLabel">{{ 'filter.filter' | translate }}</mat-label>
<input matInput type="text" placeholder="{{ !showLabel ? ('filter.filter' | translate) : ''}}"
#filterInput
formControlName="filter"
(focusin)="onFocus()"

4
ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.html

@ -46,9 +46,7 @@
<ng-container matColumnDef="key">
<mat-header-cell *matHeaderCellDef class="mat-column-key"> {{ 'import.column-key' | translate }} </mat-header-cell>
<mat-cell *matCellDef="let column">
<mat-form-field floatLabel="always" hideRequiredMarker
*ngIf="isColumnTypeDiffers(column.type)">
<mat-label></mat-label>
<mat-form-field *ngIf="isColumnTypeDiffers(column.type)">
<input matInput [required]="isColumnTypeDiffers(column.type)"
[(ngModel)]="column.key" (ngModelChange)="columnsUpdated()"
placeholder="{{ 'import.column-value' | translate }}"/>

9
ui-ngx/src/app/modules/home/components/profile/alarm/alarm-duration-predicate-value.component.html

@ -17,8 +17,7 @@
-->
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px" [formGroup]="alarmDurationPredicateValueFormGroup">
<div fxFlex fxLayout="column" [fxShow]="!dynamicMode">
<mat-form-field floatLabel="always" hideRequiredMarker class="mat-block">
<mat-label></mat-label>
<mat-form-field class="mat-block">
<input required type="number" matInput
step="1" min="1" max="2147483647"
formControlName="defaultValue"
@ -40,8 +39,7 @@
<div fxFlex fxLayout="column" [fxShow]="dynamicMode">
<div formGroupName="dynamicValue" fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<div fxFlex="40" fxLayout="column">
<mat-form-field floatLabel="always" hideRequiredMarker class="mat-block">
<mat-label></mat-label>
<mat-form-field class="mat-block">
<mat-select formControlName="sourceType" placeholder="{{'filter.dynamic-source-type' | translate}}">
<mat-option [value]="null">
{{'filter.no-dynamic-value' | translate}}
@ -53,8 +51,7 @@
</mat-form-field>
</div>
<div fxFlex fxLayout="column">
<mat-form-field floatLabel="always" hideRequiredMarker class="mat-block source-attribute">
<mat-label></mat-label>
<mat-form-field class="mat-block source-attribute">
<input matInput formControlName="sourceAttribute" placeholder="{{'filter.source-attribute' | translate}}">
</mat-form-field>
</div>

6
ui-ngx/src/app/modules/home/components/profile/alarm/alarm-dynamic-value.component.html

@ -30,8 +30,7 @@
<div fxFlex fxLayout="column">
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<div fxFlex="40" fxLayout="column">
<mat-form-field floatLabel="always" hideRequiredMarker class="mat-block">
<mat-label></mat-label>
<mat-form-field class="mat-block">
<mat-select formControlName="sourceType" placeholder="{{'filter.dynamic-source-type' | translate}}">
<mat-option [value]="null">
{{'filter.no-dynamic-value' | translate}}
@ -43,8 +42,7 @@
</mat-form-field>
</div>
<div fxFlex fxLayout="column">
<mat-form-field floatLabel="always" hideRequiredMarker class="mat-block source-attribute">
<mat-label></mat-label>
<mat-form-field class="mat-block source-attribute">
<input matInput formControlName="sourceAttribute" placeholder="{{'filter.source-attribute' | translate}}">
</mat-form-field>
</div>

3
ui-ngx/src/app/modules/home/components/profile/alarm/alarm-rule-condition-dialog.component.html

@ -56,8 +56,7 @@
>
</tb-alarm-duration-predicate-value>
<div fxFlex="23" *ngIf="conditionFormGroup.get('spec.type').value == AlarmConditionType.DURATION">
<mat-form-field class="mat-block" hideRequiredMarker floatLabel="always">
<mat-label></mat-label>
<mat-form-field class="mat-block">
<mat-select formControlName="unit" required
placeholder="{{ 'device-profile.condition-duration-time-unit' | translate }}">
<mat-option *ngFor="let timeUnit of timeUnits" [value]="timeUnit">

2
ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<mat-form-field [formGroup]="selectAssetProfileFormGroup" class="mat-block">
<mat-form-field [formGroup]="selectAssetProfileFormGroup" class="mat-block" subscriptSizing="{{ subscriptSizing }}">
<mat-label>{{ 'asset-profile.asset-profile' | translate }}</mat-label>
<input matInput type="text"
#assetProfileInput

4
ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.ts

@ -45,6 +45,7 @@ import { AssetProfileId } from '@shared/models/id/asset-profile-id';
import { AssetProfile, AssetProfileInfo } from '@shared/models/asset.models';
import { AssetProfileService } from '@core/http/asset-profile.service';
import { AssetProfileDialogComponent, AssetProfileDialogData } from './asset-profile-dialog.component';
import { SubscriptSizing } from '@angular/material/form-field';
@Component({
selector: 'tb-asset-profile-autocomplete',
@ -62,6 +63,9 @@ export class AssetProfileAutocompleteComponent implements ControlValueAccessor,
modelValue: AssetProfileId | null;
@Input()
subscriptSizing: SubscriptSizing = 'fixed';
@Input()
selectDefaultProfile = false;

2
ui-ngx/src/app/modules/home/components/profile/device-profile-autocomplete.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<mat-form-field [formGroup]="selectDeviceProfileFormGroup" class="mat-block">
<mat-form-field [formGroup]="selectDeviceProfileFormGroup" class="mat-block" subscriptSizing="{{ subscriptSizing }}">
<mat-label>{{ 'device-profile.device-profile' | translate }}</mat-label>
<input matInput type="text"
#deviceProfileInput

4
ui-ngx/src/app/modules/home/components/profile/device-profile-autocomplete.component.ts

@ -48,6 +48,7 @@ import { MatAutocomplete } from '@angular/material/autocomplete';
import { AddDeviceProfileDialogComponent, AddDeviceProfileDialogData } from './add-device-profile-dialog.component';
import { emptyPageData } from '@shared/models/page/page-data';
import { getEntityDetailsPageURL } from '@core/utils';
import { SubscriptSizing } from '@angular/material/form-field';
@Component({
selector: 'tb-device-profile-autocomplete',
@ -65,6 +66,9 @@ export class DeviceProfileAutocompleteComponent implements ControlValueAccessor,
modelValue: DeviceProfileId | null;
@Input()
subscriptSizing: SubscriptSizing = 'fixed';
@Input()
selectDefaultProfile = false;

6
ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-attributes-key-list.component.html

@ -25,8 +25,7 @@
*ngFor="let nameValueControl of attributesValueFormArray().controls; let $index = index"
[formGroup]="nameValueControl">
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<mat-form-field fxFlex="40" floatLabel="always" hideRequiredMarker>
<mat-label></mat-label>
<mat-form-field fxFlex="40">
<mat-select formControlName="name" required>
<mat-option *ngFor="let attributeName of attributeNames" [value]="attributeName"
[disabled]="isDisabledAttributeName(attributeName, $index)">
@ -37,8 +36,7 @@
{{ 'device-profile.lwm2m.attribute-name-required' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="60" floatLabel="always" hideRequiredMarker>
<mat-label></mat-label>
<mat-form-field fxFlex="60">
<input formControlName="value" matInput required type="number"
placeholder="{{ 'key-val.value' | translate }}">
<mat-error fxLayout="row" *ngIf="nameValueControl.get('value').hasError('required')">

49
ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-attributes-key-list.component.scss

@ -26,60 +26,15 @@
}
.map-list{
height: 45px;
height: 80px;
}
}
}
:host ::ng-deep {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-wrapper {
padding-bottom: 0;
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
border-top: 0;
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-underline {
bottom: 0;
}
.button-icon{
.button-icon {
font-size: 20px;
width: 20px;
height: 20px;
}
.map-list {
mat-form-field {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-wrapper {
padding-bottom: 0;
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
border-top-width: 0.2em;
width: auto;
min-width: auto;
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-underline {
bottom: 0;
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-subscript-wrapper{
margin-top: 1.8em;
}
}
}
}
}

3
ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-observe-attr-telemetry-resources.component.html

@ -55,8 +55,7 @@
matTooltipPosition="above">
</mat-checkbox>
</div>
<mat-form-field fxFlex="33" hideRequiredMarker>
<mat-label></mat-label>
<mat-form-field fxFlex="33">
<input matInput type="text" formControlName="keyName" required>
<mat-error *ngIf="resourceLwM2M.get('keyName').hasError('required') ||
resourceLwM2M.get('keyName').hasError('pattern')">

9
ui-ngx/src/app/modules/home/components/profile/device/snmp/snmp-device-profile-mapping.component.html

@ -29,8 +29,7 @@
last as isLast;" fxLayout="row" fxLayoutAlign="start center"
fxLayoutGap="8px" [formGroup]="mappingConfig" class="mapping-list">
<div fxFlex fxLayout="row" fxLayoutGap="8px" fxLayoutAlign="start">
<mat-form-field fxFlex="26" floatLabel="always" hideRequiredMarker>
<mat-label></mat-label>
<mat-form-field fxFlex="26">
<mat-select formControlName="dataType" required>
<mat-option *ngFor="let dataType of dataTypes" [value]="dataType">
{{ dataTypesTranslationMap.get(dataType) | translate }}
@ -40,15 +39,13 @@
{{ 'device-profile.snmp.data-type-required' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field floatLabel="always" hideRequiredMarker fxFlex="37">
<mat-label></mat-label>
<mat-form-field fxFlex="37">
<input matInput formControlName="key" required/>
<mat-error *ngIf="mappingConfig.get('key').hasError('required')">
{{ 'device-profile.snmp.data-key-required' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field floatLabel="always" hideRequiredMarker fxFlex="37">
<mat-label></mat-label>
<mat-form-field fxFlex="37">
<input matInput formControlName="oid" required/>
<mat-error *ngIf="mappingConfig.get('oid').hasError('required')">
{{ 'device-profile.snmp.oid-required' | translate }}

32
ui-ngx/src/app/modules/home/components/profile/device/snmp/snmp-device-profile-mapping.component.scss

@ -19,41 +19,9 @@
}
.mapping-list {
padding-bottom: 8px;
height: 46px;
}
.required-text {
margin: 14px 0;
}
}
:host ::ng-deep {
.mapping-list {
mat-form-field {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-wrapper {
padding-bottom: 0;
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
border-top-width: 0.2em;
width: auto;
min-width: auto;
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-underline {
bottom: 0;
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-subscript-wrapper{
margin-top: 1.8em;
}
}
}
}
}

5
ui-ngx/src/app/modules/home/components/relation/relation-filters.component.html

@ -28,18 +28,19 @@
<div class="row" fxFlex fxLayout="row"
fxLayoutAlign="start center" formArrayName="relationFilters"
*ngFor="let relationFilterControl of relationFiltersFormArray().controls; let $index = index">
<div class="mat-elevation-z1" fxFlex fxLayout="row" fxLayoutAlign="start center">
<div class="mat-elevation-z1" fxFlex fxLayout="row" fxLayoutAlign="start center" style="padding: 8px 0;">
<tb-relation-type-autocomplete
class="cell" style="width: 200px; min-width: 200px;"
subscriptSizing="dynamic"
[formControl]="relationFilterControl.get('relationType')">
</tb-relation-type-autocomplete>
<tb-entity-type-list class="cell" fxFlex
subscriptSizing="dynamic"
[allowedEntityTypes]="allowedEntityTypes"
[formControl]="relationFilterControl.get('entityTypes')">
</tb-entity-type-list>
<button mat-icon-button color="primary"
type="button"
style="width: 40px; min-width: 40px;"
(click)="removeFilter($index)"
[disabled]="isLoading$ | async"
matTooltip="{{ 'relation.remove-relation-filter' | translate }}"

26
ui-ngx/src/app/modules/home/components/relation/relation-filters.component.scss

@ -20,11 +20,9 @@
.container{
width: 100%;
overflow: auto;
}
.header {
width: max-content;
padding: 0 5px 5px;
.cell {
@ -38,8 +36,9 @@
}
.body {
width: max-content;
padding: 0 5px 20px;
max-height: 300px;
overflow: auto;
.row {
padding-top: 5px;
@ -56,24 +55,3 @@
}
}
}
:host ::ng-deep {
.tb-relation-filters {
.cell {
.mat-mdc-form-field {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
border-top: none;
}
&.mat-form-field-appearance-standard {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-flex {
padding-top: 0;
}
}
}
}
}
}

3
ui-ngx/src/app/modules/home/components/vc/entity-versions-table.component.html

@ -23,6 +23,7 @@
<span class="tb-entity-table-title">{{(singleEntityMode ? 'version-control.entity-versions' : 'version-control.versions') | translate}}</span>
<tb-branch-autocomplete
#branchAutocompleteComponent
subscriptSizing="dynamic"
[selectionMode]="true"
[selectDefaultBranch]="false"
[disabled]="isLoading$ | async"
@ -31,7 +32,7 @@
</tb-branch-autocomplete>
</div>
<span fxFlex></span>
<div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center end">
<div fxLayout="row" fxLayoutAlign="center center" fxLayout.xs="column" fxLayoutAlign.xs="center end">
<button *ngIf="singleEntityMode" mat-stroked-button color="primary"
#createVersionButton
[disabled]="(isLoading$ | async) || (isReadOnly | async)"

16
ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-editor.component.html

@ -17,12 +17,20 @@
-->
<div class="tb-custom-action-pretty mat-elevation-z1" tb-fullscreen [fullscreen]="fullscreen">
<div fxLayout="row" fxLayoutAlign="end center" class="tb-action-expand-button" [ngClass]="{'tb-fullscreen-editor': fullscreen}">
<button mat-button fxHide.lt-md
<button *ngIf="!fullscreen"
mat-icon-button fxHide.lt-md
matTooltip="{{ 'widget.toggle-fullscreen' | translate }}"
matTooltipPosition="above"
(click)="fullscreen = !fullscreen">
<mat-icon>{{ fullscreen ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon>
<span *ngIf="fullscreen" translate>widget.toggle-fullscreen</span>
(click)="fullscreen = true">
<mat-icon>fullscreen</mat-icon>
</button>
<button *ngIf="fullscreen"
mat-button
matTooltip="{{ 'widget.toggle-fullscreen' | translate }}"
matTooltipPosition="above"
(click)="fullscreen = false">
<mat-icon>fullscreen_exit</mat-icon>
<span translate>widget.toggle-fullscreen</span>
</button>
</div>
<div class="tb-custom-action-editor" [ngClass]="{'tb-fullscreen-editor': fullscreen}">

8
ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-editor.component.scss

@ -81,20 +81,20 @@
&.tb-fullscreen-editor {
position: relative;
right: 0;
.mat-mdc-button {
/* .mat-mdc-button {
.mat-icon {
margin-right: 5px;
}
}
} */
}
.mat-mdc-button {
/* .mat-mdc-button {
min-width: 36px;
padding: 0;
.mat-icon {
margin-right: 0;
}
}
} */
}
.tb-custom-action-editor {

9
ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-resources-tabs.component.html

@ -19,11 +19,10 @@
<mat-tab label="{{ 'widget.resources' | translate }}" style="width: 100%; height: 100%;">
<div class="tb-custom-action-editor-container" style="background-color: #fff;">
<div class="mat-padding">
<div fxFlex fxLayout="row" style="max-height: 40px;"
<div fxFlex fxLayout="row"
fxLayoutAlign="start center"
*ngFor="let resource of action.customResources; let i = index" >
<mat-form-field fxFlex class="mat-block resource-field" floatLabel="never"
style="margin: 10px 0 0; max-height: 40px;">
*ngFor="let resource of action.customResources; let i = index" style="padding-top: 10px;">
<mat-form-field fxFlex class="mat-block" subscriptSizing="dynamic">
<input required matInput [(ngModel)]="resource.url"
(ngModelChange)="notifyActionUpdated()"
placeholder="{{ 'widget.resource-url' | translate }}"/>
@ -37,7 +36,7 @@
<mat-icon>close</mat-icon>
</button>
</div>
<div style="margin-top: 6px;">
<div style="margin-top: 18px;">
<button mat-button mat-raised-button color="primary"
[disabled]="isLoading$ | async"
type="button"

38
ui-ngx/src/app/modules/home/components/widget/action/custom-action-pretty-resources-tabs.component.scss

@ -14,38 +14,6 @@
* limitations under the License.
*/
.tb-custom-action-editor-container {
mat-form-field.resource-field {
max-height: 40px;
margin: 10px 0 0;
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-wrapper {
padding-bottom: 0;
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-flex {
max-height: 40px;
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
border: 0;
}
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-underline {
bottom: 0;
}
}
}
.html-panel,
.css-panel {
width: 100%;
@ -72,7 +40,7 @@
}
}
button.mat-mdc-button, button.mat-mdc-icon-button, button.mat-icon-button.tb-mat-32 {
button.mat-mdc-button-base, button.mat-icon-button-base.tb-mat-32 {
align-items: center;
vertical-align: middle;
min-width: 32px;
@ -87,6 +55,10 @@
margin-right: 4px;
}
}
button.mat-mdc-button-base:not(.mat-mdc-icon-button) {
height: 23px;
}
}
}

3
ui-ngx/src/app/modules/home/components/widget/action/mobile-action-editor.component.ts

@ -158,6 +158,7 @@ export class MobileActionEditorComponent implements ControlValueAccessor, OnInit
}
this.mobileActionTypeFormGroup = this.fb.group({});
if (type) {
let processLaunchResultFunction;
switch (type) {
case WidgetMobileActionType.takePictureFromGallery:
case WidgetMobileActionType.takePhoto:
@ -177,7 +178,7 @@ export class MobileActionEditorComponent implements ControlValueAccessor, OnInit
case WidgetMobileActionType.mapDirection:
case WidgetMobileActionType.mapLocation:
let getLocationFunction = action?.getLocationFunction;
let processLaunchResultFunction = action?.processLaunchResultFunction;
processLaunchResultFunction = action?.processLaunchResultFunction;
if (changed) {
const defaultGetLocationFunction = getDefaultGetLocationFunction();
if (defaultGetLocationFunction !== getLocationFunction) {

2
ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<form [formGroup]="widgetActionFormGroup" (ngSubmit)="save()" style="width: 800px;">
<form [formGroup]="widgetActionFormGroup" (ngSubmit)="save()" style="width: 900px;">
<mat-toolbar color="primary">
<h2>{{ (isAdd ? 'widget-config.add-action' : 'widget-config.edit-action' ) | translate }}</h2>
<span fxFlex></span>

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

@ -81,9 +81,8 @@
<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">
<mat-panel-title fxLayout="column">
<mat-slide-toggle formControlName="comparisonEnabled" (click)="$event.stopPropagation()"
fxLayoutAlign="center">
<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>

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

@ -15,7 +15,7 @@
limitations under the License.
-->
<mat-form-field [formGroup]="keysListFormGroup" class="mat-block">
<mat-form-field [formGroup]="keysListFormGroup" class="mat-block tb-chip-list">
<mat-chip-grid #chipList formControlName="keys" tb-chip-draggable (chipDrop)="onChipDrop($event)">
<mat-chip-row class="tb-datakey-chip"
*ngFor="let key of keys; let $index = index"
@ -30,34 +30,28 @@
</div>
<div class="tb-chip-labels">
<div class="tb-chip-label">
<span *ngIf="datasourceType === datasourceTypes.entity">
<span *ngIf="key.type === dataKeyTypes.alarm"
matTooltip="{{'datakey.alarm' | translate }}"
matTooltipPosition="above">
<mat-icon class="tb-mat-20">notifications</mat-icon>
</span>
<span *ngIf="key.type === dataKeyTypes.attribute"
matTooltip="{{'datakey.attributes' | translate }}"
matTooltipPosition="above">
<mat-icon class="tb-mat-20"
svgIcon="mdi:alpha-a-circle-outline"></mat-icon>
</span>
<span *ngIf="key.type === dataKeyTypes.entityField"
matTooltip="{{'datakey.entity-field' | translate }}"
matTooltipPosition="above">
<mat-icon class="tb-mat-20"
svgIcon="mdi:alpha-e-circle-outline"></mat-icon>
</span>
<span *ngIf="key.type === dataKeyTypes.timeseries"
matTooltip="{{'datakey.timeseries' | translate }}"
matTooltipPosition="above">
<mat-icon class="tb-mat-20">timeline</mat-icon>
</span>
</span>
<ng-container *ngIf="datasourceType === datasourceTypes.entity">
<mat-icon class="tb-mat-20 tb-datakey-icon" *ngIf="key.type === dataKeyTypes.alarm"
matTooltip="{{'datakey.alarm' | translate }}"
matTooltipPosition="above">notifications</mat-icon>
<mat-icon class="tb-mat-20 tb-datakey-icon" *ngIf="key.type === dataKeyTypes.attribute"
matTooltip="{{'datakey.attributes' | translate }}"
matTooltipPosition="above" svgIcon="mdi:alpha-a-circle-outline"></mat-icon>
<mat-icon class="tb-mat-20 tb-datakey-icon" *ngIf="key.type === dataKeyTypes.entityField"
matTooltip="{{'datakey.entity-field' | translate }}"
matTooltipPosition="above" svgIcon="mdi:alpha-e-circle-outline"></mat-icon>
<mat-icon class="tb-mat-20 tb-datakey-icon" *ngIf="key.type === dataKeyTypes.timeseries"
matTooltip="{{'datakey.timeseries' | translate }}"
matTooltipPosition="above">timeline</mat-icon>
</ng-container>
{{key.label}}
</div>
<div class="tb-chip-separator">: </div>
<div class="tb-chip-label" [innerHTML]="displayDataKeyNameFn(key)"></div>
<div class="tb-chip-label">
<strong>
<ng-container *ngTemplateOutlet="keyName; context:{key: key}"></ng-container>
</strong>
</div>
</div>
<button *ngIf="!disabled"
type="button"
@ -76,6 +70,7 @@
#origin="matAutocompleteOrigin"
[matAutocompleteConnectedTo]="origin"
(focusin)="onFocus()"
(drop)="$event.preventDefault();"
[matAutocomplete]="keyAutocomplete"
[matAutocompleteDisabled]="isEntityCountDatasource"
[matChipInputFor]="chipList"
@ -84,33 +79,24 @@
</mat-chip-grid>
<mat-autocomplete #keyAutocomplete="matAutocomplete"
class="tb-autocomplete"
panelWidth="fit-content"
[displayWith]="displayKeyFn">
<mat-option *ngFor="let key of filteredKeys | async" [value]="key">
<span style="white-space: nowrap;">
<span *ngIf="datasourceType === datasourceTypes.entity">
<span *ngIf="key.type === dataKeyTypes.alarm"
matTooltip="{{'datakey.alarm' | translate }}"
matTooltipPosition="above">
<mat-icon class="tb-mat-16">notifications</mat-icon>
</span>
<span *ngIf="key.type === dataKeyTypes.attribute"
matTooltip="{{'datakey.attributes' | translate }}"
matTooltipPosition="above">
<mat-icon class="tb-mat-16"
svgIcon="mdi:alpha-a-circle-outline"></mat-icon>
</span>
<span *ngIf="key.type === dataKeyTypes.entityField"
matTooltip="{{'datakey.entity-field' | translate }}"
matTooltipPosition="above">
<mat-icon class="tb-mat-16"
svgIcon="mdi:alpha-e-circle-outline"></mat-icon>
</span>
<span *ngIf="key.type === dataKeyTypes.timeseries"
matTooltip="{{'datakey.timeseries' | translate }}"
matTooltipPosition="above">
<mat-icon class="tb-mat-16">timeline</mat-icon>
</span>
</span>
<ng-container *ngIf="datasourceType === datasourceTypes.entity">
<mat-icon class="tb-datakey-icon" *ngIf="key.type === dataKeyTypes.alarm"
matTooltip="{{'datakey.alarm' | translate }}"
matTooltipPosition="above">notifications</mat-icon>
<mat-icon class="tb-datakey-icon" *ngIf="key.type === dataKeyTypes.attribute"
matTooltip="{{'datakey.attributes' | translate }}"
matTooltipPosition="above" svgIcon="mdi:alpha-a-circle-outline"></mat-icon>
<mat-icon class="tb-datakey-icon" *ngIf="key.type === dataKeyTypes.entityField"
matTooltip="{{'datakey.entity-field' | translate }}"
matTooltipPosition="above" svgIcon="mdi:alpha-e-circle-outline"></mat-icon>
<mat-icon class="tb-datakey-icon" *ngIf="key.type === dataKeyTypes.timeseries"
matTooltip="{{'datakey.timeseries' | translate }}"
matTooltipPosition="above">timeline</mat-icon>
</ng-container>
<span [innerHTML]="key.name | highlight:searchText"></span>
</span>
</mat-option>
@ -129,31 +115,22 @@
</span>
<ng-template #createEntityKey>
<span>{{'entity.create-new-key' | translate }} </span>
<span *ngIf="widgetType === widgetTypes.alarm"
matTooltip="{{'datakey.alarm' | translate }}"
matTooltipPosition="above">
<mat-icon (click)="createKey(searchText, dataKeyTypes.alarm)"
class="tb-mat-16">notifications</mat-icon>
</span>
<span *ngIf="widgetType === widgetTypes.latest || widgetType === widgetTypes.alarm"
matTooltip="{{'datakey.attributes' | translate }}"
matTooltipPosition="above">
<mat-icon (click)="createKey(searchText, dataKeyTypes.attribute)"
class="tb-mat-16"
svgIcon="mdi:alpha-a-circle-outline"></mat-icon>
</span>
<span *ngIf="widgetType === widgetTypes.latest || widgetType === widgetTypes.alarm"
matTooltip="{{'datakey.entity-field' | translate }}"
matTooltipPosition="above">
<mat-icon (click)="createKey(searchText, dataKeyTypes.entityField)"
class="tb-mat-16"
svgIcon="mdi:alpha-e-circle-outline"></mat-icon>
</span>
<span matTooltip="{{'datakey.timeseries' | translate }}"
matTooltipPosition="above">
<mat-icon (click)="createKey(searchText, dataKeyTypes.timeseries)"
class="tb-mat-16">timeline</mat-icon>
</span>
<mat-icon class="tb-datakey-icon new-key" *ngIf="widgetType === widgetTypes.alarm"
matTooltip="{{'datakey.alarm' | translate }}"
matTooltipPosition="above"
(click)="createKey(searchText, dataKeyTypes.alarm)">notifications</mat-icon>
<mat-icon class="tb-datakey-icon new-key" *ngIf="widgetType === widgetTypes.latest || widgetType === widgetTypes.alarm"
matTooltip="{{'datakey.attributes' | translate }}"
matTooltipPosition="above" svgIcon="mdi:alpha-a-circle-outline"
(click)="createKey(searchText, dataKeyTypes.attribute)"></mat-icon>
<mat-icon class="tb-datakey-icon new-key" *ngIf="widgetType === widgetTypes.latest || widgetType === widgetTypes.alarm"
matTooltip="{{'datakey.entity-field' | translate }}"
matTooltipPosition="above" svgIcon="mdi:alpha-e-circle-outline"
(click)="createKey(searchText, dataKeyTypes.entityField)"></mat-icon>
<mat-icon class="tb-datakey-icon new-key"
matTooltip="{{'datakey.timeseries' | translate }}"
matTooltipPosition="above"
(click)="createKey(searchText, dataKeyTypes.timeseries)">timeline</mat-icon>
</ng-template>
</ng-template>
</div>
@ -166,3 +143,19 @@
<div class="mat-caption" style="color: rgba(0,0,0,0.57);" *ngIf="maxDataKeys !== null && maxDataKeys > -1">
{{ maxDataKeysText() }}
</div>
<ng-template #keyName let-key="key">
<ng-container *ngIf="dataKeyHasPostprocessing(key); else keyName">
<span>f(</span><ng-container *ngTemplateOutlet="keyNameTemplate; context:{key: key}"></ng-container><span>)</span>
</ng-container>
<ng-template #keyName>
<ng-container *ngTemplateOutlet="keyNameTemplate; context:{key: key}"></ng-container>
</ng-template>
</ng-template>
<ng-template #keyNameTemplate let-key="key">
<ng-container *ngIf="dataKeyHasAggregation(key); else keyName;">
<span class="tb-agg-func">{{ key.aggregationType }}</span><span>({{ key.name }})</span>
</ng-container>
<ng-template #keyName>
<span>{{key.name}}</span>
</ng-template>
</ng-template>

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

@ -15,6 +15,7 @@
*/
.mat-mdc-chip.mat-mdc-standard-chip.tb-datakey-chip {
overflow: hidden;
line-height: 20px;
.tb-attribute-chip {
max-width: 100%;
@ -27,55 +28,72 @@
mat-icon {
pointer-events: none;
margin-right: 4px;
margin-left: 4px;
vertical-align: bottom;
}
}
.tb-chip-labels {
display: flex;
flex-direction: row;
align-items: flex-end;
align-items: center;
min-width: 0;
.tb-chip-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
mat-icon {
margin-right: 4px;
margin-left: 4px;
vertical-align: middle;
}
}
.tb-chip-separator {
white-space: pre;
}
}
/*TODO(mdc-migration): The following rule targets internal classes of chips that may no longer apply for the MDC version.
*/
.mat-chip-remove.mat-icon {
.mat-mdc-chip-remove.mat-icon {
width: 24px;
height: 24px;
font-size: 24px;
margin-left: 0;
margin-right: 4px;
color: inherit;
opacity: inherit;
padding-left: 0;
}
}
}
:host ::ng-deep {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-flex {
padding-top: 0;
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
border-top: 0;
}
.tb-datakey-icon {
vertical-align: middle;
&.new-key {
margin-left: 8px;
margin-right: 8px;
}
}
::ng-deep {
.mat-icon.tb-datakey-icon > svg {
vertical-align: initial;
}
}
:host ::ng-deep {
.tb-chip-label {
.tb-agg-func {
font-style: italic;
color: #0c959c;
}
}
.tb-datakey-chip {
.mat-mdc-chip-action {
overflow: hidden;
.mat-mdc-chip-action-label {
overflow: hidden;
}
}
}
}

45
ui-ngx/src/app/modules/home/components/widget/data-keys.component.ts

@ -29,12 +29,12 @@ import {
} from '@angular/core';
import {
ControlValueAccessor,
UntypedFormBuilder,
UntypedFormControl,
UntypedFormGroup,
FormGroupDirective,
NG_VALUE_ACCESSOR,
NgForm,
UntypedFormBuilder,
UntypedFormControl,
UntypedFormGroup,
Validators
} from '@angular/forms';
import { Observable, of } from 'rxjs';
@ -43,7 +43,7 @@ import { Store } from '@ngrx/store';
import { AppState } from '@app/core/core.state';
import { TranslateService } from '@ngx-translate/core';
import { MatAutocomplete } from '@angular/material/autocomplete';
import { MatChipInputEvent, MatChipGrid } from '@angular/material/chips';
import { MatChipGrid, MatChipInputEvent } from '@angular/material/chips';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { DataKeyType } from '@shared/models/telemetry/telemetry.models';
import { DataKey, DatasourceType, JsonSettingsSchema, Widget, widgetType } from '@shared/models/widget.models';
@ -62,7 +62,6 @@ import {
import { deepClone } from '@core/utils';
import { MatChipDropEvent } from '@app/shared/components/mat-chip-draggable.directive';
import { Dashboard } from '@shared/models/dashboard.models';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { AggregationType } from '@shared/models/time/time.models';
@Component({
@ -175,7 +174,6 @@ export class DataKeysComponent implements ControlValueAccessor, OnInit, AfterVie
private dialogs: DialogService,
private dialog: MatDialog,
private fb: UntypedFormBuilder,
private sanitizer: DomSanitizer,
public truncate: TruncatePipe) {
}
@ -450,34 +448,13 @@ export class DataKeysComponent implements ControlValueAccessor, OnInit, AfterVie
return key ? key.name : undefined;
}
displayDataKeyNameFn(key: DataKey): SafeHtml {
let keyName = key.name;
if (this.widgetType === widgetType.latest && key.type === DataKeyType.timeseries
&& key.aggregationType && key.aggregationType !== AggregationType.NONE) {
let aggFuncName: string;
switch (key.aggregationType) {
case AggregationType.MIN:
aggFuncName = 'MIN';
break;
case AggregationType.MAX:
aggFuncName = 'MAX';
break;
case AggregationType.AVG:
aggFuncName = 'AVG';
break;
case AggregationType.SUM:
aggFuncName = 'SUM';
break;
case AggregationType.COUNT:
aggFuncName = 'COUNT';
break;
}
keyName = `<span class="tb-agg-func">${aggFuncName}</span>(${keyName})`;
}
if (this.datasourceType !== DatasourceType.function && key.postFuncBody) {
keyName = `f(${keyName})`;
}
return this.sanitizer.bypassSecurityTrustHtml(`<strong>${keyName}</strong>`);
dataKeyHasAggregation(key: DataKey): boolean {
return this.widgetType === widgetType.latest && key.type === DataKeyType.timeseries
&& key.aggregationType && key.aggregationType !== AggregationType.NONE;
}
dataKeyHasPostprocessing(key: DataKey): boolean {
return this.datasourceType !== DatasourceType.function && !!key.postFuncBody;
}
private fetchKeys(searchText?: string): Observable<Array<DataKey>> {

41
ui-ngx/src/app/modules/home/components/widget/lib/navigation-card-widget.component.scss

@ -21,35 +21,30 @@
:host ::ng-deep {
.tb-nav-button {
width: 100%;
height: 100%;
height: 100% !important;
&:hover {
border-bottom: none;
}
&:focus {
border-bottom: none;
}
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-wrapper {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
mat-icon {
margin: auto;
}
span {
height: 18px;
min-height: 36px;
max-height: 36px;
padding: 0 0 20px 0;
margin: auto;
font-size: 18px;
font-weight: 400;
line-height: 18px;
white-space: normal;
}
display: flex;
flex-direction: column;
align-items: center;
mat-icon {
margin: auto !important;
}
span.mdc-button__label {
height: 18px;
min-height: 36px;
max-height: 36px;
padding: 0 0 20px 0;
margin: auto;
font-size: 18px;
font-weight: 400;
line-height: 18px;
white-space: normal;
text-align: center;
}
&.mat-mdc-raised-button.mat-primary {
.mat-ripple-element {

55
ui-ngx/src/app/modules/home/components/widget/lib/navigation-cards-widget.component.scss

@ -28,25 +28,17 @@
font-size: 24px;
}
}
/*TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version.
*/
mat-card {
.mat-mdc-card {
padding: 0;
margin: 8px;
/*TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version.
*/
mat-card-title {
.mat-mdc-card-title {
margin: 0;
padding: 24px 16px 16px;
}
mat-card-title+mat-card-content {
.mat-mdc-card-title+.mat-mdc-card-content {
padding-top: 0;
}
/*TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version.
*/
mat-card-content {
.mat-mdc-card-content {
padding: 16px;
}
}
@ -60,28 +52,23 @@
&:focus {
border-bottom: none;
}
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-wrapper {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
mat-icon {
margin: auto;
}
span {
height: 18px;
min-height: 36px;
max-height: 36px;
padding: 0 0 20px 0;
margin: auto;
font-size: 18px;
font-weight: 400;
line-height: 18px;
white-space: normal;
}
display: flex;
flex-direction: column;
align-items: center;
mat-icon {
margin: auto;
}
span.mdc-button__label {
height: 18px;
min-height: 36px;
max-height: 36px;
padding: 0 0 20px 0;
margin: auto;
font-size: 18px;
font-weight: 400;
line-height: 18px;
white-space: normal;
text-align: center;
}
&.mat-mdc-raised-button.mat-primary {
.mat-ripple-element {

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

@ -15,7 +15,7 @@
limitations under the License.
-->
<mat-tab-group class="tb-widget-config tb-absolute-fill" [(selectedIndex)]="selectedTab">
<mat-tab-group mat-stretch-tabs="false" class="tb-widget-config tb-absolute-fill" [(selectedIndex)]="selectedTab">
<mat-tab label="{{ 'widget-config.data' | translate }}" *ngIf="widgetType !== widgetTypes.static">
<div [formGroup]="dataSettings" class="mat-content mat-padding" fxLayout="column" fxLayoutGap="8px">
<div *ngIf="displayTimewindowConfig()" fxFlex="100"
@ -111,10 +111,10 @@
</div>
<ng-template #datasourcesTemplate>
<div fxFlex fxLayout="row" fxLayoutAlign="start center">
<span style="width: 60px;"></span>
<span style="width: 68px;"></span>
<div fxFlex fxLayout="row" fxLayoutAlign="start center"
style="padding: 0 0 0 10px; margin: 5px;">
<span translate style="min-width: 120px;">widget-config.datasource-type</span>
<span translate style="min-width: 160px;">widget-config.datasource-type</span>
<span fxHide fxShow.gt-sm translate fxFlex
style="padding-left: 10px;">widget-config.datasource-parameters</span>
<span style="min-width: 40px;"></span>
@ -131,7 +131,7 @@
class="tb-datasource-list-item tb-draggable" cdkDrag
[cdkDragDisabled]="disabled">
<div fxFlex fxLayout="row" fxLayoutAlign="start center">
<div style="width: 60px;">
<div fxLayout="row" fxLayoutAlign="start center" style="width: 68px;">
<button *ngIf="!disabled" mat-icon-button color="primary"
class="handle"
style="min-width: 40px; margin: 0"
@ -146,11 +146,7 @@
<div fxFlex
fxLayout="row"
fxLayoutAlign="start center">
<section fxFlex
fxLayout="column"
fxLayoutAlign="center"
fxLayout.gt-sm="row"
fxLayoutAlign.gt-sm="start center">
<section class="tb-datasource-section">
<mat-form-field class="tb-datasource-type">
<mat-select [formControl]="datasourceControl.get('type')">
<mat-option *ngFor="let datasourceType of datasourceTypes" [value]="datasourceType">
@ -160,7 +156,7 @@
</mat-form-field>
<section fxLayout="column" class="tb-datasource" [ngSwitch]="datasourceControl.get('type').value">
<ng-template [ngSwitchCase]="datasourceType.function">
<mat-form-field class="tb-datasource-name" style="min-width: 200px;">
<mat-form-field fxFlex>
<mat-label translate>datasource.label</mat-label>
<input matInput
[formControl]="datasourceControl.get('name')">
@ -182,9 +178,7 @@
[callbacks]="widgetConfigCallbacks">
</tb-filter-select>
<mat-form-field *ngIf="datasourceControl.get('type').value === datasourceType.entityCount"
floatLabel="always"
class="tb-datasource-name no-border-top" style="min-width: 200px;">
<mat-label></mat-label>
fxFlex>
<input matInput
placeholder="{{ 'datasource.label' | translate }}"
[formControl]="datasourceControl.get('name')">
@ -279,11 +273,7 @@
</mat-panel-title>
</mat-expansion-panel-header>
<div [formGroup]="alarmSourceSettings" style="padding: 0 5px;">
<section fxFlex
fxLayout="column"
fxLayoutAlign="center"
fxLayout.gt-sm="row"
fxLayoutAlign.gt-sm="start center">
<section class="tb-datasource-section">
<mat-form-field class="tb-datasource-type">
<mat-select formControlName="type">
<mat-option *ngFor="let datasourceType of datasourceTypes" [value]="datasourceType">
@ -488,7 +478,7 @@
<legend class="group-title" translate>widget-config.mobile-mode-settings</legend>
<mat-expansion-panel class="tb-settings">
<mat-expansion-panel-header>
<mat-panel-title fxLayout.xs="column" fxLayout="row" fxLayoutGap="8px">
<mat-panel-title fxLayout.xs="column" fxLayoutAlign.xs="center start" fxLayout="row" fxLayoutGap="8px" fxFlex="70">
<mat-slide-toggle formControlName="mobileHide" (click)="$event.stopPropagation()" fxLayoutAlign="center">
{{ 'widget-config.mobile-hide' | translate }}
</mat-slide-toggle>
@ -496,7 +486,7 @@
{{ 'widget-config.desktop-hide' | translate }}
</mat-slide-toggle>
</mat-panel-title>
<mat-panel-description fxLayoutAlign="end center" fxHide.xs translate>
<mat-panel-description fxLayoutAlign="end center" fxHide.xs translate fxFlex="30">
widget-config.advanced-settings
</mat-panel-description>
</mat-expansion-panel-header>

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

@ -15,9 +15,65 @@
*/
@import '../../../../../scss/constants';
.tb-datasource-list-item.tb-draggable {
&.cdk-drag-preview {
background: #fff;
.tb-widget-config {
.tb-panel-hint {
font-size: 12px;
color: #808080;
}
}
.tb-datasource-list-item {
&.mat-mdc-list-item {
height: auto;
min-height: 68px;
display: block;
padding: 0;
}
&.tb-draggable {
&.cdk-drag-preview {
background: #fff;
}
}
}
.tb-datasource-params {
position: relative;
padding: 0 0 0 10px;
margin: 5px;
tb-error.tb-datasource-error {
position: absolute;
bottom: 4px;
left: 8px;
}
.tb-datasource-section {
display: flex;
flex-direction: column;
align-items: stretch;
flex: 1;
padding-top: 20px;
@media #{$mat-gt-sm} {
flex-direction: row;
align-items: center;
justify-content: flex-start;
}
}
.tb-datasource-type {
min-width: 160px;
@media #{$mat-gt-sm} {
max-width: 160px;
}
}
.tb-datasource {
@media #{$mat-gt-sm} {
padding-left: 8px;
width: 208px;
max-width: 208px;
}
}
.tb-data-keys {
@media #{$mat-gt-sm} {
padding-left: 8px;
}
}
}
@ -36,44 +92,6 @@
min-height: 68px;
padding-left: 0;
}
.mat-mdc-list-item {
height: auto;
min-height: 68px;
display: block;
}
}
.tb-datasource-type {
min-width: 120px;
@media #{$mat-gt-sm} {
max-width: 120px;
}
}
.tb-datasource {
@media #{$mat-gt-sm} {
padding-left: 8px;
}
}
.tb-datasource-name {
@media #{$mat-gt-sm} {
width: 200px;
max-width: 200px;
}
}
.tb-datasource-params {
position: relative;
padding: 0 0 0 10px;
margin: 5px;
tb-error.tb-datasource-error {
position: absolute;
bottom: 4px;
left: 8px;
}
}
.tb-data-keys {
@media #{$mat-gt-sm} {
padding-left: 8px;
}
}
.fields-group {
padding: 0 16px 8px;
@ -109,20 +127,6 @@
right: 0;
bottom: 0;
}
.tb-panel-hint {
font-size: 12px;
color: #808080;
}
//.mat-tab-body.mat-tab-body-active {
// .mat-tab-body-content > div {
// height: 100%;
// }
//}
/*TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version.
*/
.mat-checkbox-label {
white-space: normal;
}
.mat-expansion-panel {
&.tb-settings {
box-shadow: none;
@ -149,16 +153,6 @@
.tb-json-object-panel, .tb-css-content-panel {
margin: 0 0 8px;
}
/*TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version.
*/
.mat-checkbox-layout {
margin: 5px 0;
}
/*TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version.
*/
.mat-checkbox-inner-container {
margin-right: 12px;
}
}
&.tb-datasources {
&.mat-expanded {
@ -167,65 +161,11 @@
.mat-expansion-panel-body{
padding: 0 12px 16px;
}
.mat-mdc-list-base .mat-mdc-list-item {
/*TODO(mdc-migration): The following rule targets internal classes of list that may no longer apply for the MDC version.
*/
.mat-list-item-content {
padding: 0;
}
}
}
.mat-expansion-panel-content {
font: inherit;
}
}
.tb-datasource-type {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
width: 100%;
}
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-select-value {
min-width: 92px;
}
}
.tb-datasource {
tb-entity-alias-select {
.mat-mdc-form-field {
margin-top: 20px;
}
@media #{$mat-gt-sm} {
.mat-mdc-form-field {
width: 200px;
max-width: 200px;
}
}
}
tb-filter-select {
@media #{$mat-gt-sm} {
.mat-mdc-form-field {
width: 200px;
max-width: 200px;
}
}
}
.tb-datasource-name.no-border-top {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
border-top: 0;
}
}
}
.tb-data-keys {
@media #{$mat-gt-sm} {
.mat-mdc-input-element {
min-height: 32px;
}
}
}
.mat-slide {
margin: 8px 0;
}
@ -235,10 +175,5 @@
margin-bottom: 8px;
}
}
/*TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version.
*/
.mat-slide-toggle-content {
white-space: normal;
}
}
}

2
ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts

@ -14,7 +14,7 @@
/// limitations under the License.
///
import { Component, forwardRef, Input, OnInit } from '@angular/core';
import { ChangeDetectionStrategy, Component, forwardRef, Input, OnInit } from '@angular/core';
import { PageComponent } from '@shared/components/page.component';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';

1
ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html

@ -103,7 +103,6 @@
</tb-copy-button>
</mat-form-field>
<mat-form-field fxFlex *ngIf="domainInfo.get('scheme').value === 'MIXED'" class="mat-block">
<mat-label></mat-label>
<input matInput [value]="redirectURIMixed(domainInfo)" readonly>
<tb-copy-button
matSuffix

1
ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.html

@ -16,6 +16,7 @@
-->
<tb-asset-profile-autocomplete
subscriptSizing="dynamic"
[ngModel]="entitiesTableConfig.componentsData.assetProfileId"
(ngModelChange)="assetProfileChanged($event)"
[displayAllOnEmpty]="true"

1
ui-ngx/src/app/modules/home/pages/device/device-table-header.component.html

@ -16,6 +16,7 @@
-->
<tb-device-profile-autocomplete
subscriptSizing="dynamic"
[ngModel]="entitiesTableConfig.componentsData.deviceProfileId"
(ngModelChange)="deviceProfileChanged($event)"
[displayAllOnEmpty]="true"

1
ui-ngx/src/app/modules/home/pages/edge/edge-table-header.component.html

@ -16,6 +16,7 @@
-->
<tb-entity-subtype-select
subscriptSizing="dynamic"
[showLabel]="true"
[entityType]="entityType.EDGE"
[ngModel]="entitiesTableConfig.componentsData.edgeType"

1
ui-ngx/src/app/modules/home/pages/entity-view/entity-view-table-header.component.html

@ -16,6 +16,7 @@
-->
<tb-entity-subtype-select
subscriptSizing="dynamic"
[showLabel]="true"
[entityType]="entityType.ENTITY_VIEW"
[ngModel]="entitiesTableConfig.componentsData.entityViewType"

6
ui-ngx/src/app/modules/home/pages/security/authentication-dialog/email-auth-dialog.component.html

@ -37,8 +37,7 @@
<form [formGroup]="emailConfigForm" (ngSubmit)="nextStep()">
<p class="mat-body step-description input" translate>security.2fa.dialog.email-step-description</p>
<div fxLayout="row" fxLayoutAlign="space-between center" fxLayoutGap="8px">
<mat-form-field fxFlex class="mat-block input-container" hideRequiredMarker floatLabel="always">
<mat-label></mat-label>
<mat-form-field fxFlex class="mat-block input-container">
<input matInput formControlName="email"
type="email" required
placeholder="{{ 'security.2fa.dialog.email-step-label' | translate }}" />
@ -65,8 +64,7 @@
{{ 'security.2fa.dialog.verification-step-description' | translate : {address: emailConfigForm.get('email').value} }}
</p>
<div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="space-between center" fxLayoutAlign.xs="start end">
<mat-form-field fxFlex class="mat-block code-container full-width-xs" hideRequiredMarker floatLabel="always">
<mat-label></mat-label>
<mat-form-field fxFlex class="mat-block code-container full-width-xs">
<input matInput formControlName="verificationCode"
maxlength="6" type="text" required
inputmode="numeric" pattern="[0-9]*"

3
ui-ngx/src/app/modules/home/pages/security/authentication-dialog/sms-auth-dialog.component.html

@ -58,8 +58,7 @@
{{ 'security.2fa.dialog.verification-step-description' | translate : {address: smsConfigForm.get('phone').value} }}
</p>
<div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="space-between center" fxLayoutAlign.xs="start end">
<mat-form-field fxFlex class="mat-block code-container full-width-xs" floatLabel="always" hideRequiredMarker>
<mat-label></mat-label>
<mat-form-field fxFlex class="mat-block code-container full-width-xs">
<input matInput formControlName="verificationCode"
maxlength="6" type="text" required
inputmode="numeric" pattern="[0-9]*"

3
ui-ngx/src/app/modules/home/pages/security/authentication-dialog/totp-auth-dialog.component.html

@ -53,8 +53,7 @@
<p class="mat-body qr-code-description" translate>security.2fa.dialog.scan-qr-code</p>
<canvas fxFlex #canvas [ngStyle]="{display: totpAuthURL ? 'block' : 'none'}"></canvas>
<p class="mat-body qr-code-description" style="margin-top: 30px;" translate>security.2fa.dialog.enter-verification-code</p>
<mat-form-field fxFlex class="mat-block code-container" floatLabel="always" hideRequiredMarker>
<mat-label></mat-label>
<mat-form-field fxFlex class="mat-block code-container">
<input matInput formControlName="verificationCode"
maxlength="6" type="text" required
inputmode="numeric" pattern="[0-9]*"

2
ui-ngx/src/app/modules/home/pages/security/security.component.html

@ -150,7 +150,7 @@
</div>
<mat-checkbox [value]="provider"
[checked]="useByDefault === provider"
(click)="changeDefaultProvider($event, provider)"
(change)="changeDefaultProvider($event, provider)"
[disabled]="(isLoading$ | async)"
*ngIf="twoFactorAuth.get(provider).value && provider !== twoFactorAuthProviderType.BACKUP_CODE && !activeSingleProvider">
<span class="checkbox-label" translate>security.2fa.main-2fa-method</span>

7
ui-ngx/src/app/modules/home/pages/security/security.component.ts

@ -51,6 +51,7 @@ import { Observable, of, Subject } from 'rxjs';
import { isDefinedAndNotNull, isEqual } from '@core/utils';
import { AuthService } from '@core/auth/auth.service';
import { UserPasswordPolicy } from '@shared/models/settings.models';
import { MatCheckboxChange } from '@angular/material/checkbox';
@Component({
selector: 'tb-security',
@ -290,14 +291,14 @@ export class SecurityComponent extends PageComponent implements OnInit, OnDestro
});
}
changeDefaultProvider(event: MouseEvent, provider: TwoFactorAuthProviderType) {
event.stopPropagation();
event.preventDefault();
changeDefaultProvider(event: MatCheckboxChange, provider: TwoFactorAuthProviderType) {
if (this.useByDefault !== provider) {
this.twoFactorAuth.disable({emitEvent: false});
this.twoFaService.updateTwoFaAccountConfig(provider, true)
.pipe(tap(() => this.twoFactorAuth.enable({emitEvent: false})))
.subscribe(data => this.processTwoFactorAuthConfig(data));
} else {
event.source.checked = true;
}
}

3
ui-ngx/src/app/modules/home/pages/widget/widget-editor.component.html

@ -19,8 +19,7 @@
<div fxFlex fxLayout="column" tb-fullscreen [fullscreen]="fullscreen" tb-hotkeys [hotkeys]="hotKeys" [cheatSheet]="cheatSheetComponent">
<tb-hotkeys-cheatsheet #cheatSheetComponent></tb-hotkeys-cheatsheet>
<mat-toolbar class="mat-elevation-z1 tb-edit-toolbar mat-hue-3" fxLayoutGap="16px" fxLayoutGap.lt-xl="8px">
<mat-form-field floatLabel="always" hideRequiredMarker class="tb-widget-title tb-appearance-transparent">
<mat-label></mat-label>
<mat-form-field class="tb-widget-title tb-appearance-transparent">
<input [disabled]="isReadOnly" matInput required maxlength="255"
[(ngModel)]="widget.widgetName" (ngModelChange)="isDirty = true"
placeholder="{{ 'widget.title' | translate }}"/>

5
ui-ngx/src/app/modules/login/pages/login/two-factor-auth-login.component.html

@ -31,7 +31,7 @@
<p class="mat-body" translate>login.select-way-to-verify</p>
<ng-container *ngFor="let provider of allowProviders">
<button type="button" mat-stroked-button class="provider" (click)="selectProvider(provider)">
<mat-icon class="icon" svgIcon="{{ providersData.get(provider).icon }}"></mat-icon>
<mat-icon class="tb-mat-18" svgIcon="{{ providersData.get(provider).icon }}"></mat-icon>
{{ providersData.get(provider).name | translate }}
</button>
</ng-container>
@ -41,8 +41,7 @@
<div tb-toast fxLayout="column">
<p class="mat-body">{{ providerDescription }}</p>
<div fxLayout="row" class="code-block" fxLayoutGap="8px">
<mat-form-field class="mat-block" fxFlex floatLabel="always" hideRequiredMarker>
<mat-label></mat-label>
<mat-form-field class="mat-block tb-appearance-transparent" fxFlex>
<input matInput formControlName="verificationCode"
required [maxlength]="maxLengthInput" type="text"
[attr.inputmode]="inputMode" [pattern]="pattern"

10
ui-ngx/src/app/modules/login/pages/login/two-factor-auth-login.component.scss

@ -75,17 +75,9 @@
button.provider {
text-align: start;
font-weight: 400;
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
&:not(.mat-button-disabled) {
&:not([disabled][disabled]) {
border-color: rgba(255, 255, 255, .8);
}
.icon {
height: 18px;
width: 18px;
vertical-align: sub;
}
}
.mat-form-field-invalid .mat-mdc-form-field-hint {

5
ui-ngx/src/app/shared/components/dashboard-autocomplete.component.ts

@ -135,7 +135,10 @@ export class DashboardAutocompleteComponent implements ControlValueAccessor, OnI
selectFirstDashboardIfNeeded(): void {
if (this.selectFirstDashboard && !this.modelValue) {
this.getDashboards(new PageLink(1)).subscribe(
this.getDashboards(new PageLink(1, 0, null, {
property: 'title',
direction: Direction.ASC
})).subscribe(
(data) => {
if (data.data.length) {
const dashboard = data.data[0];

3
ui-ngx/src/app/shared/components/dialog/material-icons-dialog.component.html

@ -43,7 +43,6 @@
<ng-container #iconButtons>
<button *ngIf="icon === selectedIcon"
class="tb-select-icon-button"
mat-icon-button
mat-raised-button
color="primary"
(click)="selectIcon(icon)"
@ -54,7 +53,7 @@
</button>
<button *ngIf="icon !== selectedIcon"
class="tb-select-icon-button"
mat-icon-button
mat-button
(click)="selectIcon(icon)"
matTooltip="{{ icon }}"
matTooltipPosition="above"

12
ui-ngx/src/app/shared/components/dialog/material-icons-dialog.component.scss

@ -26,14 +26,24 @@
:host ::ng-deep {
.tb-material-icons-dialog {
button.mat-mdc-icon-button.tb-select-icon-button {
button.mat-mdc-button-base.tb-select-icon-button {
width: 56px;
min-width: 56px;
height: 56px;
padding: 16px;
margin: 10px;
border: solid 1px #ffa500;
border-radius: 0;
line-height: 0;
display: inline-block;
vertical-align: baseline;
.mat-icon {
width: 24px;
margin: 0;
height: 24px;
vertical-align: initial;
font-size: 24px;
}
}
}
}

2
ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<mat-form-field [formGroup]="subTypeFormGroup" class="mat-block">
<mat-form-field [formGroup]="subTypeFormGroup" class="mat-block" subscriptSizing="{{ subscriptSizing }}">
<mat-label *ngIf="showLabel">{{ entitySubtypeTitle | translate }}</mat-label>
<mat-select [fxShow]="subTypesLoaded" class="tb-entity-subtype-select" formControlName="subType">
<mat-option *ngFor="let subType of subTypesOptions | async" [value]="subType">

4
ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.ts

@ -27,6 +27,7 @@ import { BroadcastService } from '@app/core/services/broadcast.service';
import { AssetService } from '@core/http/asset.service';
import { EdgeService } from '@core/http/edge.service';
import { EntityViewService } from '@core/http/entity-view.service';
import { SubscriptSizing } from '@angular/material/form-field';
@Component({
selector: 'tb-entity-subtype-select',
@ -44,6 +45,9 @@ export class EntitySubTypeSelectComponent implements ControlValueAccessor, OnIni
modelValue: string | null = '';
@Input()
subscriptSizing: SubscriptSizing = 'fixed';
@Input()
entityType: EntityType;

2
ui-ngx/src/app/shared/components/entity/entity-type-list.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<mat-form-field [formGroup]="entityTypeListFormGroup" class="mat-block">
<mat-form-field [formGroup]="entityTypeListFormGroup" class="mat-block" subscriptSizing="{{ subscriptSizing }}">
<mat-chip-grid #chipList formControlName="entityTypeList">
<mat-chip-row
*ngFor="let entityType of entityTypeList"

4
ui-ngx/src/app/shared/components/entity/entity-type-list.component.ts

@ -26,6 +26,7 @@ import { EntityService } from '@core/http/entity.service';
import { MatAutocomplete } from '@angular/material/autocomplete';
import { MatChipGrid } from '@angular/material/chips';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { SubscriptSizing } from '@angular/material/form-field';
interface EntityTypeInfo {
name: string;
@ -66,6 +67,9 @@ export class EntityTypeListComponent implements ControlValueAccessor, OnInit, Af
@Input()
disabled: boolean;
@Input()
subscriptSizing: SubscriptSizing = 'fixed';
@Input()
allowedEntityTypes: Array<EntityType | AliasEntityType>;

6
ui-ngx/src/app/shared/components/kv-map.component.html

@ -20,15 +20,13 @@
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px" style="max-height: 40px;"
formArrayName="keyVals"
*ngFor="let keyValControl of keyValsFormArray().controls; let $index = index">
<mat-form-field fxFlex floatLabel="always" hideRequiredMarker class="mat-block"
<mat-form-field fxFlex class="mat-block"
style="max-height: 40px;">
<mat-label></mat-label>
<input [formControl]="keyValControl.get('key')" matInput required
placeholder="{{ (keyPlaceholderText ? keyPlaceholderText : 'key-val.key') | translate }}"/>
</mat-form-field>
<mat-form-field fxFlex floatLabel="always" hideRequiredMarker class="mat-block"
<mat-form-field fxFlex class="mat-block"
style="max-height: 40px;">
<mat-label></mat-label>
<input [formControl]="keyValControl.get('value')" matInput required
placeholder="{{ (valuePlaceholderText ? valuePlaceholderText : 'key-val.value') | translate }}"/>
</mat-form-field>

18
ui-ngx/src/app/shared/components/kv-map.component.scss

@ -26,21 +26,3 @@
}
}
}
:host ::ng-deep {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-wrapper {
padding-bottom: 0;
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
border-top: 0;
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-underline {
bottom: 0;
}
}

6
ui-ngx/src/app/shared/components/markdown-editor.component.html

@ -17,15 +17,13 @@
-->
<div class="markdown-content" [ngClass]="{'tb-edit-mode': !readonly}"
tb-fullscreen [fullscreen]="fullscreen" (fullscreenChanged)="onFullscreen()">
<div fxLayout="row" fxLayoutAlign="start center" style="height: 40px;">
<div fxLayout="row" fxLayoutAlign="start center" style="height: 40px;" class="markdown-editor-toolbar">
<label class="tb-title no-padding" [ngClass]="{'tb-error': !disabled && required && !markdownValue, 'tb-required': !disabled && required}">{{ label }}</label>
<span fxFlex></span>
<button [fxShow]="!editorMode"
class="panel-button"
type="button"
mat-button (click)="toggleEditMode()">{{ 'markdown.edit' | translate }}</button>
<button [fxShow]="editorMode"
class="panel-button"
type="button"
mat-button (click)="toggleEditMode()">{{ 'markdown.preview' | translate }}</button>
<div *ngIf = "helpId" [tb-help-popup]="helpId"></div>
@ -34,7 +32,7 @@
matTooltipPosition="above"
style="border-radius: 50%"
(click)="fullscreen = !fullscreen">
<button type='button' mat-icon-button class="tb-mat-32 panel-button">
<button type='button' mat-icon-button class="tb-mat-32">
<mat-icon class="material-icons">{{ fullscreen ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon>
</button>
</div>

36
ui-ngx/src/app/shared/components/markdown-editor.component.scss

@ -58,15 +58,31 @@
overflow: auto;
height: 100%;
}
button.panel-button {
background: rgba(220, 220, 220, .35);
align-items: center;
vertical-align: middle;
min-width: 32px;
min-height: 15px;
padding: 4px;
font-size: .8rem;
line-height: 15px;
color: #7b7b7b;
.markdown-editor-toolbar {
& > * {
&:not(:last-child) {
margin-right: 4px;
}
}
button.mat-mdc-button-base, button.mat-mdc-button-base.tb-mat-32 {
background: rgba(220, 220, 220, .35);
align-items: center;
vertical-align: middle;
min-width: 32px;
min-height: 15px;
padding: 4px;
font-size: .8rem;
line-height: 15px;
&:not(.tb-help-popup-button) {
color: #7b7b7b;
}
}
button.mat-mdc-button-base:not(.mat-mdc-icon-button) {
height: 23px;
}
.tb-help-popup-button-loading {
background: #f3f3f3;
}
}
}

43
ui-ngx/src/app/shared/components/mat-chip-draggable.directive.ts

@ -81,7 +81,7 @@ const droppingClassName = 'dropping';
const droppingBeforeClassName = 'dropping-before';
const droppingAfterClassName = 'dropping-after';
let globalDraggingChipListId = null;
let globalDraggingChipList: MatChipGrid = null;
class DraggableChip {
@ -104,6 +104,7 @@ class DraggableChip {
private chipsList: MatChipGrid,
private chipListElement: HTMLElement,
private chipDrop: EventEmitter<MatChipDropEvent>) {
chip._mousedown = () => {};
this.chipElement = chip._elementRef.nativeElement;
this.chipElement.setAttribute('draggable', 'true');
this.handle = this.chipElement.getElementsByClassName('tb-chip-drag-handle')[0] as HTMLElement;
@ -126,7 +127,7 @@ class DraggableChip {
} else {
event.stopPropagation();
this.dragging = true;
globalDraggingChipListId = this.chipListElement.id;
globalDraggingChipList = this.chipsList;
this.chipListElement.classList.add(draggingClassName);
this.chipElement.classList.add(draggingClassName);
event = (event as any).originalEvent || event;
@ -164,7 +165,7 @@ class DraggableChip {
private onDragEnd(event: Event | any) {
event.stopPropagation();
this.dragging = false;
globalDraggingChipListId = null;
globalDraggingChipList = null;
this.chipListElement.classList.remove(draggingClassName);
this.chipElement.classList.remove(draggingClassName);
}
@ -174,7 +175,7 @@ class DraggableChip {
return;
}
event.preventDefault();
if (globalDraggingChipListId !== this.chipListElement.id) {
if (globalDraggingChipList !== this.chipsList) {
return;
}
const bounds = this.chipElement.getBoundingClientRect();
@ -210,7 +211,7 @@ class DraggableChip {
private onDrop(event: Event | any) {
this.counter = 0;
event.preventDefault();
if (globalDraggingChipListId !== this.chipListElement.id) {
if (globalDraggingChipList !== this.chipsList) {
return;
}
event = (event as any).originalEvent || event;
@ -233,21 +234,23 @@ class DraggableChip {
if (this.dropTimeout) {
clearTimeout(this.dropTimeout);
}
this.dropTimeout = setTimeout(() => {
this.dropPosition = null;
this.chipElement.classList.remove(droppingClassName);
this.chipElement.classList.remove(droppingAfterClassName);
this.chipElement.classList.remove(droppingBeforeClassName);
this.chipElement.removeEventListener('drop', this.dropHandler);
const dropEvent: MatChipDropEvent = {
from: droppedItemIndex,
to: newIndex
};
this.chipDrop.emit(dropEvent);
}, 1000 / 16);
if (droppedItemIndex !== newIndex) {
this.dropTimeout = setTimeout(() => {
this.dropPosition = null;
this.chipElement.classList.remove(droppingClassName);
this.chipElement.classList.remove(droppingAfterClassName);
this.chipElement.classList.remove(droppingBeforeClassName);
this.chipElement.removeEventListener('drop', this.dropHandler);
const dropEvent: MatChipDropEvent = {
from: droppedItemIndex,
to: newIndex
};
this.chipDrop.emit(dropEvent);
}, 1000 / 16);
}
}
private index(): number {

11
ui-ngx/src/app/shared/components/material-icon-select.component.scss

@ -16,16 +16,9 @@
:host {
.mat-icon.icon-value {
padding: 4px;
margin: 8px 4px 4px;
margin: 12px 4px 4px;
cursor: pointer;
border: solid 1px rgba(0, 0, 0, .27);
}
}
:host ::ng-deep {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix{
width: 146px;
box-sizing: initial;
}
}

2
ui-ngx/src/app/shared/components/relation/relation-type-autocomplete.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<mat-form-field [formGroup]="relationTypeFormGroup" class="mat-block">
<mat-form-field [formGroup]="relationTypeFormGroup" class="mat-block" subscriptSizing="{{ subscriptSizing }}">
<mat-label>{{ required ? ('relation.relation-type' | translate) : ( !modelValue ? ('relation.any-relation-type' | translate) : ' ') }}</mat-label>
<input matInput type="text"
#relationTypeInput

4
ui-ngx/src/app/shared/components/relation/relation-type-autocomplete.component.ts

@ -24,6 +24,7 @@ import { TranslateService } from '@ngx-translate/core';
import { BroadcastService } from '@app/core/services/broadcast.service';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { RelationTypes } from '@app/shared/models/relation.models';
import { SubscriptSizing } from '@angular/material/form-field';
@Component({
selector: 'tb-relation-type-autocomplete',
@ -53,6 +54,9 @@ export class RelationTypeAutocompleteComponent implements ControlValueAccessor,
@Input()
disabled: boolean;
@Input()
subscriptSizing: SubscriptSizing = 'fixed';
@ViewChild('relationTypeInput', {static: true}) relationTypeInput: ElementRef;
filteredRelationTypes: Observable<Array<string>>;

2
ui-ngx/src/app/shared/components/time/history-selector/history-selector.component.html

@ -24,7 +24,7 @@
<mat-icon class="material-icons" [ngStyle]="{'color': settings.buttonColor}">skip_previous</mat-icon>
</button>
<div fxLayout="column" fxFlex="100">
<mat-slider [(ngModel)]="index" [min]="minTimeIndex" [max]="maxTimeIndex" #ngSlider><input matSliderThumb (input)="changeIndex({source: ngSliderThumb, parent: ngSlider, value: ngSliderThumb.value}.value)" #ngSliderThumb="matSliderThumb" />
<mat-slider [min]="minTimeIndex" [max]="maxTimeIndex" #ngSlider><input matSliderThumb [(ngModel)]="index" (input)="changeIndex({source: ngSliderThumb, parent: ngSlider, value: ngSliderThumb.value}.value)" #ngSliderThumb="matSliderThumb" />
</mat-slider>
<div class="panel-timer">
<span *ngIf="this.currentTime">{{ this.currentTime | date:'medium'}}</span>

2
ui-ngx/src/app/shared/components/vc/branch-autocomplete.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<mat-form-field [formGroup]="branchFormGroup" class="mat-block" [floatLabel]="(selectionMode || emptyPlaceholder) ? 'always' : 'auto'">
<mat-form-field [formGroup]="branchFormGroup" class="mat-block" [floatLabel]="(selectionMode || emptyPlaceholder) ? 'always' : 'auto'" subscriptSizing="{{ subscriptSizing }}">
<mat-label>{{ 'version-control.branch' | translate }}</mat-label>
<input matInput type="text" placeholder="{{emptyPlaceholder || ((loading ? 'common.loading' : 'version-control.select-branch') | translate)}}"
#branchInput

4
ui-ngx/src/app/shared/components/vc/branch-autocomplete.component.ts

@ -35,6 +35,7 @@ import { BranchInfo } from '@shared/models/vc.models';
import { EntitiesVersionControlService } from '@core/http/entities-version-control.service';
import { isNotEmptyStr } from '@core/utils';
import { MatAutocomplete, MatAutocompleteTrigger } from '@angular/material/autocomplete';
import { SubscriptSizing } from '@angular/material/form-field';
@Component({
selector: 'tb-branch-autocomplete',
@ -53,6 +54,9 @@ export class BranchAutocompleteComponent implements ControlValueAccessor, OnInit
modelValue: string | null;
@Input()
subscriptSizing: SubscriptSizing = 'fixed';
private requiredValue: boolean;
get required(): boolean {

3
ui-ngx/src/app/shared/components/widgets-bundle-select.component.html

@ -15,8 +15,7 @@
limitations under the License.
-->
<mat-form-field floatLabel="always" hideRequiredMarker class="mat-block">
<mat-label></mat-label>
<mat-form-field class="mat-block">
<mat-select [required]="required"
[disabled]="disabled"
[(ngModel)]="widgetsBundle"

135
ui-ngx/src/app/shared/components/widgets-bundle-select.component.scss

@ -15,138 +15,67 @@
*/
@import '../../../scss/constants';
tb-widgets-bundle-select {
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
mat-select {
margin: 0;
}
.tb-bundle-item {
height: 26px;
line-height: 26px;
}
}
.tb-widgets-bundle-select {
.tb-bundle-item {
height: 48px;
line-height: 48px;
.mdc-list-item__primary-text {
width: 100%;
}
}
tb-widgets-bundle-select,
.tb-widgets-bundle-select {
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-select-value-text {
display: block;
width: 100%;
tb-widgets-bundle-select {
.mat-mdc-select-arrow {
width: 18px;
}
}
tb-widgets-bundle-select, .tb-widgets-bundle-select {
.tb-bundle-item {
display: inline-block;
width: 100%;
span {
display: inline-block;
vertical-align: middle;
}
.tb-bundle-system {
float: right;
font-size: .8rem;
opacity: .8;
}
}
/*TODO(mdc-migration): The following rule targets internal classes of option that may no longer apply for the MDC version.
*/
mat-option {
height: auto !important;
white-space: normal !important;
}
}
mat-toolbar {
tb-widgets-bundle-select {
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-wrapper {
padding-bottom: 0 !important;
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-infix {
.mat-mdc-text-field-wrapper {
border-radius: 0;
.mat-mdc-form-field-infix {
background: rgba(255, 255, 255, .2);
padding: 5px 20px !important;
border: none;
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
mat-select {
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-select-value-text {
font-size: 1.2rem;
color: #fff;
span:first-child::after {
color: #fff;
min-height: 44.5px;
.mat-mdc-select {
.mat-mdc-select-trigger {
height: 34.5px;
.mat-mdc-select-value {
vertical-align: middle;
min-height: 30px;
height: 30px;
padding: 2px 2px 1px;
.mat-mdc-select-value-text {
font-size: 1.2rem;
color: #fff;
}
}
}
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-select-value {
vertical-align: middle;
min-height: 30px;
height: 30px;
padding: 2px 2px 1px;
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-select-placeholder {
color: #fff;
opacity: .8;
line-height: 26px;
}
.mat-mdc-select-arrow {
width: 18px;
}
}
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-mdc-select.mat-select-invalid {
/*TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.
*/
.mat-select-arrow {
color: #fff !important;
}
}
@media #{$mat-xs} {
width: auto;
}
}
/*TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.
*/
.mat-form-field-underline {
.mdc-line-ripple {
display: none;
}
}
.mat-mdc-form-field-subscript-wrapper {
display: none;
}
.mat-mdc-form-field.mat-focused.mat-primary .mat-mdc-select-arrow-wrapper .mat-mdc-select-arrow {
color: #fff;
}
}
}

102
ui-ngx/src/styles.scss

@ -1414,57 +1414,56 @@ mat-label {
.tb-primary-background {
background-color: $primary;
}
/*TODO(mdc-migration): The following rule targets internal classes of chips that may no longer apply for the MDC version.
*/
.mat-chip-list.dragging {
.mat-mdc-chip {
&.mat-mdc-standard-chip {
&::after {
transition: none;
}
&.dragging {
/*TODO(mdc-migration): The following rule targets internal classes of chips that may no longer apply for the MDC version.
*/
.mat-chip-ripple {
display: none !important;
}
}
&.dropping {
//border: dashed 2px;
//opacity: .5;
//.md-chip-content {
// margin: -2px;
//}
}
.mat-mdc-chip.mat-mdc-standard-chip {
&.dragging {
.mat-mdc-chip-ripple {
display: none !important;
}
}
}
.mat-mdc-chip-set, .mat-mdc-chip-grid {
&.dragging {
.mat-mdc-chip {
&.mat-mdc-standard-chip {
&.dropping {
//border: dashed 2px;
//opacity: .5;
&.dropping-before {
&::after {
position: absolute;
top: 0;
right: 50%;
bottom: 0;
left: 0;
content: "";
background-color: #fff;
border: dashed 2px;
border-radius: 16px;
opacity: .7;
//.md-chip-content {
// margin: -2px;
//}
}
}
&.dropping-after {
&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 50%;
content: "";
background-color: #fff;
border: dashed 2px;
border-radius: 16px;
opacity: .7;
&.dropping-before {
&::after {
position: absolute;
top: 0;
right: 50%;
bottom: 0;
left: 0;
content: "";
background-color: #fff;
border: dashed 2px;
border-radius: 16px;
opacity: .7;
}
}
&.dropping-after {
&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 50%;
content: "";
background-color: #fff;
border: dashed 2px;
border-radius: 16px;
opacity: .7;
}
}
}
}
@ -1532,7 +1531,7 @@ mat-label {
.mat-mdc-form-field-infix {
padding-top: 8px;
padding-bottom: 8px;
.mat-mdc-chip-grid {
.mat-mdc-chip-grid, .mat-mdc-chip-set {
min-height: 40px;
}
}
@ -1540,4 +1539,11 @@ mat-label {
}
}
@media #{$mat-lt-md} {
.mat-mdc-form-field {
.mat-mdc-form-field-infix {
width: auto;
}
}
}
}

2
ui-ngx/yarn.lock

@ -7966,7 +7966,7 @@ ngx-drag-drop@^15.0.1:
"ngx-flowchart@https://github.com/thingsboard/ngx-flowchart.git#release/2.0.0":
version "2.0.0"
resolved "https://github.com/thingsboard/ngx-flowchart.git#aaa216a0e9099b6e1cc1af98f8698a449bab456f"
resolved "https://github.com/thingsboard/ngx-flowchart.git#354c6e86ef488ef974b2797336065fc4918b6dbb"
dependencies:
tslib "^2.3.0"

Loading…
Cancel
Save