Fx flex replacements. Switch to tailwind.css.

This commit is contained in:
Igor Kulikov 2024-10-10 17:28:50 +03:00
parent b48e276f44
commit 1ed0a2c6b5
4 changed files with 26 additions and 26 deletions

View File

@ -17,26 +17,26 @@
--> -->
<mat-card appearance="outlined" class="settings-card"> <mat-card appearance="outlined" class="settings-card">
<mat-toolbar class="details-toolbar"> <mat-toolbar class="details-toolbar">
<div class="mat-toolbar-tools" fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div class="mat-toolbar-tools flex flex-row justify-start items-center gap-2">
<button mat-icon-button <button mat-icon-button
matTooltip="{{ 'action.back' | translate }}" matTooltip="{{ 'action.back' | translate }}"
matTooltipPosition="above" matTooltipPosition="above"
(click)="goBack()"> (click)="goBack()">
<mat-icon>arrow_back</mat-icon> <mat-icon>arrow_back</mat-icon>
</button> </button>
<div class="tb-details-title-header" fxLayout="column" fxLayoutAlign="center start"> <div class="tb-details-title-header flex flex-col justify-center items-start">
<div class="tb-details-title tb-ellipsis">{{ headerTitle }}</div> <div class="tb-details-title tb-ellipsis">{{ headerTitle }}</div>
<div class="tb-details-subtitle tb-ellipsis">{{ headerSubtitle }}</div> <div class="tb-details-subtitle tb-ellipsis">{{ headerSubtitle }}</div>
</div> </div>
<div class="tb-help" [tb-help]="helpLinkId()"></div> <div class="tb-help" [tb-help]="helpLinkId()"></div>
<span fxFlex></span> <span class="flex-1"></span>
<section *ngIf="!isReadOnly" fxLayout="row" class="tb-header-button" fxLayoutGap="8px"> <section *ngIf="!isReadOnly" class="tb-header-button flex flex-row gap-2">
<button [disabled]="(isLoading$ | async) || detailsForm.invalid || !detailsForm.dirty" <button [disabled]="(isLoading$ | async) || detailsForm.invalid || !detailsForm.dirty"
mat-fab mat-fab
matTooltip="{{ 'action.apply-changes' | translate }}" matTooltip="{{ 'action.apply-changes' | translate }}"
matTooltipPosition="above" matTooltipPosition="above"
color="accent" class="tb-btn-header" color="accent" class="tb-btn-header"
[ngClass]="{'tb-hide': !isEdit}" [class.tb-hide]="!isEdit"
(click)="onApplyDetails()"> (click)="onApplyDetails()">
<mat-icon class="material-icons">done</mat-icon> <mat-icon class="material-icons">done</mat-icon>
</button> </button>
@ -51,8 +51,8 @@
</section> </section>
</div> </div>
</mat-toolbar> </mat-toolbar>
<mat-card-content fxFlex="100"> <mat-card-content class="flex-[1_1_100%]">
<mat-tab-group mat-stretch-tabs="false" class="tb-absolute-fill" [ngClass]="{'tb-headless': hideDetailsTabs()}" [(selectedIndex)]="selectedTab" fxFill> <mat-tab-group mat-stretch-tabs="false" class="tb-absolute-fill w-full h-full" [class.tb-headless]="hideDetailsTabs()" [(selectedIndex)]="selectedTab">
<mat-tab label="{{ 'details.details' | translate }}"> <mat-tab label="{{ 'details.details' | translate }}">
<tb-anchor #entityDetailsForm></tb-anchor> <tb-anchor #entityDetailsForm></tb-anchor>
</mat-tab> </mat-tab>

View File

@ -15,7 +15,7 @@
limitations under the License. limitations under the License.
--> -->
<tb-details-panel fxFlex <tb-details-panel class="flex-1"
[headerTitle]="entitiesTableConfig.entityTitle(entity)" [headerTitle]="entitiesTableConfig.entityTitle(entity)"
headerSubtitle="{{ translations.details | translate }}" headerSubtitle="{{ translations.details | translate }}"
[isReadOnly]="entitiesTableConfig.detailsReadonly(entity)" [isReadOnly]="entitiesTableConfig.detailsReadonly(entity)"
@ -27,7 +27,7 @@
<div class="details-buttons"> <div class="details-buttons">
<div [tb-help]="helpLinkId()"></div> <div [tb-help]="helpLinkId()"></div>
</div> </div>
<mat-tab-group mat-stretch-tabs="false" class="tb-absolute-fill" [ngClass]="{'tb-headless': hideDetailsTabs()}" fxFlex [(selectedIndex)]="selectedTab"> <mat-tab-group mat-stretch-tabs="false" class="tb-absolute-fill flex-1" [class.tb-headless]="hideDetailsTabs()" [(selectedIndex)]="selectedTab">
<mat-tab label="{{ 'details.details' | translate }}"> <mat-tab label="{{ 'details.details' | translate }}">
<tb-anchor #entityDetailsForm></tb-anchor> <tb-anchor #entityDetailsForm></tb-anchor>
</mat-tab> </mat-tab>

View File

@ -15,10 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<div fxLayout="column" class="tb-entity-filter-view"> <div class="tb-entity-filter-view flex flex-col">
<div *ngIf="!filter || !filter.type; else filterView" class="entity-filter-empty" translate>alias.no-entity-filter-specified</div> <div *ngIf="!filter || !filter.type; else filterView" class="entity-filter-empty" translate>alias.no-entity-filter-specified</div>
<ng-template #filterView> <ng-template #filterView>
<div fxLayout="column"> <div class="flex flex-col">
<div class="entity-filter-value">{{ filterDisplayValue }}</div> <div class="entity-filter-value">{{ filterDisplayValue }}</div>
</div> </div>
</ng-template> </ng-template>

View File

@ -15,7 +15,7 @@
limitations under the License. limitations under the License.
--> -->
<div fxLayout="column" [formGroup]="entityFilterFormGroup" class="tb-entity-filter"> <div [formGroup]="entityFilterFormGroup" class="tb-entity-filter flex flex-col">
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>alias.filter-type</mat-label> <mat-label translate>alias.filter-type</mat-label>
<mat-select required formControlName="type"> <mat-select required formControlName="type">
@ -27,7 +27,7 @@
{{ 'alias.filter-type-required' | translate }} {{ 'alias.filter-type-required' | translate }}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<section fxLayout="column" [formGroup]="filterFormGroup" [ngSwitch]="entityFilterFormGroup.get('type').value"> <section class="flex flex-col" [formGroup]="filterFormGroup" [ngSwitch]="entityFilterFormGroup.get('type').value">
<ng-template [ngSwitchCase]="aliasFilterType.singleEntity"> <ng-template [ngSwitchCase]="aliasFilterType.singleEntity">
<tb-entity-select required <tb-entity-select required
useAliasEntityTypes="true" useAliasEntityTypes="true"
@ -78,9 +78,9 @@
<input matInput formControlName="stateEntityParamName" <input matInput formControlName="stateEntityParamName"
placeholder="{{ 'alias.default-entity-parameter-name' | translate }}"> placeholder="{{ 'alias.default-entity-parameter-name' | translate }}">
</mat-form-field> </mat-form-field>
<div fxLayout="column"> <div class="flex flex-col">
<label class="tb-small">{{ 'alias.default-state-entity' | translate }}</label> <label class="tb-small">{{ 'alias.default-state-entity' | translate }}</label>
<tb-entity-select fxFlex <tb-entity-select class="flex-1"
useAliasEntityTypes="true" useAliasEntityTypes="true"
formControlName="defaultStateEntity"> formControlName="defaultStateEntity">
</tb-entity-select> </tb-entity-select>
@ -192,42 +192,42 @@
entityFilterFormGroup.get('type').value === aliasFilterType.entityViewSearchQuery ? entityFilterFormGroup.get('type').value === aliasFilterType.entityViewSearchQuery ?
entityFilterFormGroup.get('type').value : ''"> entityFilterFormGroup.get('type').value : ''">
<label class="tb-small">{{ 'alias.root-entity' | translate }}</label> <label class="tb-small">{{ 'alias.root-entity' | translate }}</label>
<section class="tb-root-state-entity-switch" fxLayout="row" fxLayoutAlign="start center" style="padding-left: 0;"> <section class="tb-root-state-entity-switch flex flex-row justify-start items-center" style="padding-left: 0;">
<mat-slide-toggle class="root-state-entity-switch" <mat-slide-toggle class="root-state-entity-switch"
formControlName="rootStateEntity"> formControlName="rootStateEntity">
</mat-slide-toggle> </mat-slide-toggle>
<label class="tb-small root-state-entity-label" translate>alias.root-state-entity</label> <label class="tb-small root-state-entity-label" translate>alias.root-state-entity</label>
</section> </section>
<div fxFlex fxLayout="row" *ngIf="!filterFormGroup.get('rootStateEntity').value"> <div class="flex-1 flex flex-row" *ngIf="!filterFormGroup.get('rootStateEntity').value">
<tb-entity-select fxFlex <tb-entity-select class="flex-1"
required required
useAliasEntityTypes="true" useAliasEntityTypes="true"
formControlName="rootEntity"> formControlName="rootEntity">
</tb-entity-select> </tb-entity-select>
</div> </div>
<div fxFlex fxLayout="column" fxLayout.gt-sm="row" *ngIf="filterFormGroup.get('rootStateEntity').value"> <div class="flex-1 flex flex-col gt-sm:flex-row" *ngIf="filterFormGroup.get('rootStateEntity').value">
<mat-form-field floatLabel="always" class="mat-block" style="margin-top: 24px; padding-right: 8px;"> <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> <mat-label translate>alias.state-entity-parameter-name</mat-label>
<input matInput formControlName="stateEntityParamName" <input matInput formControlName="stateEntityParamName"
placeholder="{{ 'alias.default-entity-parameter-name' | translate }}"> placeholder="{{ 'alias.default-entity-parameter-name' | translate }}">
</mat-form-field> </mat-form-field>
<div fxFlex fxLayout="column"> <div class="flex-1 flex flex-col">
<label class="tb-small">{{ 'alias.default-state-entity' | translate }}</label> <label class="tb-small">{{ 'alias.default-state-entity' | translate }}</label>
<tb-entity-select fxFlex <tb-entity-select class="flex-1"
useAliasEntityTypes="true" useAliasEntityTypes="true"
formControlName="defaultStateEntity"> formControlName="defaultStateEntity">
</tb-entity-select> </tb-entity-select>
</div> </div>
</div> </div>
<div fxFlex fxLayout="row"> <div class="flex-1 flex flex-row">
<section class="tb-root-state-entity-switch" fxLayout="row" fxLayoutAlign="start center" style="padding-left: 0;"> <section class="tb-root-state-entity-switch flex flex-row justify-start items-center" style="padding-left: 0;">
<mat-slide-toggle class="root-state-entity-switch" <mat-slide-toggle class="root-state-entity-switch"
formControlName="fetchLastLevelOnly"> formControlName="fetchLastLevelOnly">
</mat-slide-toggle> </mat-slide-toggle>
<label class="tb-small root-state-entity-label" translate>alias.last-level-relation</label> <label class="tb-small root-state-entity-label" translate>alias.last-level-relation</label>
</section> </section>
</div> </div>
<div fxFlex fxLayoutGap="8px" fxLayout="row" fxLayout.xs="column"> <div class="flex-1 flex flex-row xs:flex-col gap-2">
<mat-form-field class="mat-block" style="min-width: 100px;"> <mat-form-field class="mat-block" style="min-width: 100px;">
<mat-label translate>relation.direction</mat-label> <mat-label translate>relation.direction</mat-label>
<mat-select required formControlName="direction"> <mat-select required formControlName="direction">
@ -236,7 +236,7 @@
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex floatLabel="always" class="mat-block"> <mat-form-field floatLabel="always" class="mat-block flex-1">
<mat-label translate>alias.max-relation-level</mat-label> <mat-label translate>alias.max-relation-level</mat-label>
<input matInput <input matInput
type="number" type="number"
@ -248,7 +248,7 @@
</div> </div>
<div class="mat-caption" style="color: rgba(0,0,0,0.57);" translate>relation.relation-type</div> <div class="mat-caption" style="color: rgba(0,0,0,0.57);" translate>relation.relation-type</div>
<tb-relation-type-autocomplete <tb-relation-type-autocomplete
fxFlex class="flex-1"
formControlName="relationType"> formControlName="relationType">
</tb-relation-type-autocomplete> </tb-relation-type-autocomplete>
</ng-template> </ng-template>