UI: Angular 15 migration

This commit is contained in:
Igor Kulikov 2023-02-28 15:14:36 +02:00
parent ed42bf76e0
commit 1b73595e59
14 changed files with 44 additions and 47 deletions

View File

@ -17,7 +17,7 @@
--> -->
<form [formGroup]="smppSmsProviderConfigurationFormGroup" style="padding-bottom: 16px;"> <form [formGroup]="smppSmsProviderConfigurationFormGroup" style="padding-bottom: 16px;">
<div fxLayout="row wrap" fxLayoutGap="6px"> <div fxLayout="row wrap" fxLayoutGap="6px">
<mat-form-field fxFlex.lt-sm="100" fxFlex.gt-sm="15" class="mat-block"> <mat-form-field fxFlex.lt-sm="100" fxFlex.gt-xs="25" class="mat-block">
<mat-label translate>admin.smpp-provider.smpp-version</mat-label> <mat-label translate>admin.smpp-provider.smpp-version</mat-label>
<mat-select formControlName="protocolVersion"> <mat-select formControlName="protocolVersion">
<mat-option *ngFor="let smppVersion of smppVersions" [value]="smppVersion.value"> <mat-option *ngFor="let smppVersion of smppVersions" [value]="smppVersion.value">
@ -32,7 +32,7 @@
{{'admin.smpp-provider.smpp-host-required' | translate}} {{'admin.smpp-provider.smpp-host-required' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex.lt-sm="100" fxFlex.gt-sm="30" class="mat-block"> <mat-form-field fxFlex.lt-sm="100" fxFlex.gt-xs="25" class="mat-block">
<mat-label translate>admin.smpp-provider.smpp-port</mat-label> <mat-label translate>admin.smpp-provider.smpp-port</mat-label>
<input required matInput type="number" formControlName="port"> <input required matInput type="number" formControlName="port">
<mat-error *ngIf="smppSmsProviderConfigurationFormGroup.get('port').hasError('required')"> <mat-error *ngIf="smppSmsProviderConfigurationFormGroup.get('port').hasError('required')">

View File

@ -16,7 +16,7 @@
--> -->
<form [formGroup]="twilioSmsProviderConfigurationFormGroup" style="padding-bottom: 16px;"> <form [formGroup]="twilioSmsProviderConfigurationFormGroup" style="padding-bottom: 16px;">
<mat-form-field class="mat-block"> <mat-form-field class="mat-block" subscriptSizing="dynamic">
<mat-label translate>admin.number-from</mat-label> <mat-label translate>admin.number-from</mat-label>
<input type="tel" required [pattern]="phoneNumberPatternTwilio" matInput formControlName="numberFrom"> <input type="tel" required [pattern]="phoneNumberPatternTwilio" matInput formControlName="numberFrom">
<mat-error *ngIf="twilioSmsProviderConfigurationFormGroup.get('numberFrom').hasError('required')"> <mat-error *ngIf="twilioSmsProviderConfigurationFormGroup.get('numberFrom').hasError('required')">

View File

@ -17,7 +17,8 @@
:host { :host {
.dialog-container { .dialog-container {
min-width: 650px !important; min-width: 750px !important;
max-width: 750px !important;
@media #{$mat-lt-md} { @media #{$mat-lt-md} {
min-width: 100% !important; min-width: 100% !important;

View File

@ -14,6 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
:host { :host {
display: block;
margin-bottom: 16px;
tb-json-object-edit.tb-rule-node-configuration-json { tb-json-object-edit.tb-rule-node-configuration-json {
display: block; display: block;
height: 300px; height: 300px;

View File

@ -60,6 +60,7 @@
<label translate>rulenode.metadata</label> <label translate>rulenode.metadata</label>
</div> </div>
<tb-key-val-map <tb-key-val-map
subscriptSizing="dynamic"
formControlName="metadata" formControlName="metadata"
titleText="rulenode.metadata"> titleText="rulenode.metadata">
</tb-key-val-map> </tb-key-val-map>

View File

@ -64,7 +64,7 @@
div.tb-editor-area-title-panel { div.tb-editor-area-title-panel {
position: absolute; position: absolute;
top: 13px; top: 8px;
right: 40px; right: 40px;
z-index: 5; z-index: 5;
font-size: .8rem; font-size: .8rem;

View File

@ -16,17 +16,15 @@
--> -->
<section fxLayout="column" class="tb-kv-map" [formGroup]="kvListFormGroup"> <section fxLayout="column" class="tb-kv-map" [formGroup]="kvListFormGroup">
<label translate class="tb-title no-padding">{{ titleText }}</label> <label translate class="tb-title">{{ titleText }}</label>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px" style="max-height: 40px;" <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"
formArrayName="keyVals" formArrayName="keyVals"
*ngFor="let keyValControl of keyValsFormArray().controls; let $index = index"> *ngFor="let keyValControl of keyValsFormArray().controls; let $index = index">
<mat-form-field fxFlex class="mat-block" <mat-form-field fxFlex class="mat-block" subscriptSizing="{{ subscriptSizing }}">
style="max-height: 40px;">
<input [formControl]="keyValControl.get('key')" matInput required <input [formControl]="keyValControl.get('key')" matInput required
placeholder="{{ (keyPlaceholderText ? keyPlaceholderText : 'key-val.key') | translate }}"/> placeholder="{{ (keyPlaceholderText ? keyPlaceholderText : 'key-val.key') | translate }}"/>
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex class="mat-block" <mat-form-field fxFlex class="mat-block" subscriptSizing="{{ subscriptSizing }}">
style="max-height: 40px;">
<input [formControl]="keyValControl.get('value')" matInput required <input [formControl]="keyValControl.get('value')" matInput required
placeholder="{{ (valuePlaceholderText ? valuePlaceholderText : 'key-val.value') | translate }}"/> placeholder="{{ (valuePlaceholderText ? valuePlaceholderText : 'key-val.value') | translate }}"/>
</mat-form-field> </mat-form-field>

View File

@ -31,6 +31,7 @@ import { PageComponent } from '@shared/components/page.component';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state'; import { AppState } from '@core/core.state';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { SubscriptSizing } from '@angular/material/form-field';
@Component({ @Component({
selector: 'tb-key-val-map', selector: 'tb-key-val-map',
@ -61,6 +62,9 @@ export class KeyValMapComponent extends PageComponent implements ControlValueAcc
@Input() noDataText: string; @Input() noDataText: string;
@Input()
subscriptSizing: SubscriptSizing = 'fixed';
kvListFormGroup: UntypedFormGroup; kvListFormGroup: UntypedFormGroup;
private propagateChange = null; private propagateChange = null;

View File

@ -16,10 +16,11 @@
--> -->
<mat-form-field [formGroup]="relationTypeFormGroup" class="mat-block" subscriptSizing="{{ subscriptSizing }}"> <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> <mat-label *ngIf="required">{{ 'relation.relation-type' | translate }}</mat-label>
<input matInput type="text" <input matInput type="text"
#relationTypeInput #relationTypeInput
formControlName="relationType" formControlName="relationType"
[placeholder]="!required ? ('relation.any-relation-type' | translate) : ''"
(focusin)="onFocus()" (focusin)="onFocus()"
[required]="required" [required]="required"
[matAutocomplete]="relationTypeAutocomplete"> [matAutocomplete]="relationTypeAutocomplete">

View File

@ -13,37 +13,19 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*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.
*/
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle-group.tb-script-lang-toggle-group { .mat-button-toggle-group.tb-script-lang-toggle-group {
/*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-appearance-standard { &.mat-button-toggle-group-appearance-standard {
border: none; border: none;
border-radius: 18px; border-radius: 18px;
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle+.mat-button-toggle { .mat-button-toggle+.mat-button-toggle {
border-left: none; border-left: none;
} }
} }
/*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 { .mat-button-toggle {
background: rgba(0, 0, 0, 0.06); background: rgba(0, 0, 0, 0.06);
height: 36px; height: 36px;
align-items: center; align-items: center;
display: flex; display: flex;
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle-ripple { .mat-button-toggle-ripple {
top: 2px; top: 2px;
left: 2px; left: 2px;
@ -52,19 +34,13 @@
border-radius: 16px; border-radius: 16px;
} }
} }
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle-button { .mat-button-toggle-button {
color: #959595; color: #959595;
} }
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle-focus-overlay { .mat-button-toggle-focus-overlay {
border-radius: 16px; border-radius: 16px;
margin: 2px; margin: 2px;
} }
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle-checked .mat-button-toggle-button { .mat-button-toggle-checked .mat-button-toggle-button {
background-color: #305680; background-color: #305680;
color: #fff; color: #fff;
@ -72,15 +48,11 @@
margin-left: 2px; margin-left: 2px;
margin-right: 2px; margin-right: 2px;
} }
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle-appearance-standard .mat-button-toggle-label-content { .mat-button-toggle-appearance-standard .mat-button-toggle-label-content {
line-height: 32px; line-height: 32px;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
} }
/*TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.
*/
.mat-button-toggle-checked.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay { .mat-button-toggle-checked.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay {
opacity: .01; opacity: .01;
} }

View File

@ -24,7 +24,7 @@ import { FlowInjectionToken, NgxFlowModule } from '@flowjs/ngx-flow';
import { NgxFlowchartModule } from 'ngx-flowchart'; import { NgxFlowchartModule } from 'ngx-flowchart';
import Flow from '@flowjs/flow.js'; import Flow from '@flowjs/flow.js';
import { MatAutocompleteModule } from '@angular/material/autocomplete'; import { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatButtonToggleModule } from '@angular/material/button-toggle';
import { MatCardModule } from '@angular/material/card'; import { MatCardModule } from '@angular/material/card';
@ -198,7 +198,16 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService)
TbPopoverService, TbPopoverService,
{ {
provide: MAT_SELECT_CONFIG, provide: MAT_SELECT_CONFIG,
useValue: { overlayPanelClass: 'tb-select-overlay' } useValue: {
overlayPanelClass: 'tb-select-overlay',
hideSingleSelectionIndicator: true
}
},
{
provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,
useValue: {
hideSingleSelectionIndicator: true
}
} }
], ],
declarations: [ declarations: [

View File

@ -37,6 +37,10 @@
display: block; display: block;
margin: auto; margin: auto;
} }
.mat-mdc-button-touch-target {
width: #{$size}px;
height: #{$size}px;
}
} }
@mixin tb-checkered-bg() { @mixin tb-checkered-bg() {

View File

@ -264,10 +264,11 @@ div {
} }
.tb-hint { .tb-hint {
padding-bottom: 15px; padding: 0 16px 16px;
font-size: 12px; font-size: var(--mdc-typography-caption-font-size, 12px);
line-height: 14px; line-height: var(--mdc-typography-caption-line-height, 20px);
color: #808080; font-weight: var(--mdc-typography-caption-font-weight, 400);
letter-spacing: var(--mdc-typography-caption-letter-spacing, 0.0333333333em);
} }
.mat-caption { .mat-caption {
@ -1491,4 +1492,8 @@ mat-label {
} }
} }
} }
.mat-expansion-panel {
color: inherit;
}
} }