-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
173 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 34 additions & 37 deletions
71
src/app/elements/connect/connect-dialog/advanced-option/advanced-option.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,45 @@ | ||
<div class="advanced-option" *ngIf="isShowAdvancedOption"> | ||
<div class="advanced-option"> | ||
<mat-accordion> | ||
<mat-expansion-panel> | ||
<mat-expansion-panel [disabled]="!isShowAdvancedOption"> | ||
<mat-expansion-panel-header style="height: 32px;"> | ||
<mat-panel-title> | ||
{{ 'Advanced option' | translate }} | ||
</mat-panel-title> | ||
</mat-expansion-panel-header> | ||
|
||
<ng-container *ngFor="let item of advancedOptions"> | ||
<mat-checkbox | ||
#checkbox | ||
*ngIf="item.type == 'checkbox'" | ||
[hidden]="!item.hidden()" | ||
[name]="item.field" | ||
[(ngModel)]="item.value" | ||
(ngModelChange)="optionChange($event)" | ||
> | ||
{{ item.label | translate }} | ||
</mat-checkbox> | ||
|
||
<div | ||
*ngIf="item.type == 'radio'" | ||
[hidden]="!item.hidden()" | ||
> | ||
<label id="radio-label"> | ||
{{item.label + ':'}} | ||
</label> | ||
<mat-radio-group | ||
aria-labelledby="example-radio-group-label" | ||
class="example-radio-group" | ||
(ngModelChange)="optionChange($event)" | ||
[(ngModel)]="item.value" | ||
> | ||
<mat-radio-button | ||
*ngFor="let i of item.options" | ||
[value]="i" | ||
class="example-radio-button" | ||
<div *ngIf="isShowAdvancedOption" class="options-container"> | ||
<ng-container *ngFor="let item of advancedOptions"> | ||
<div *ngIf="item.type === 'checkbox'" class="option-item"> | ||
<mat-checkbox | ||
(ngModelChange)="optionChange($event)" | ||
[(ngModel)]="item.value" | ||
[name]="item.field" | ||
> | ||
{{i}} | ||
</mat-radio-button> | ||
</mat-radio-group> | ||
</div> | ||
</ng-container> | ||
|
||
{{ item.label | translate }} | ||
</mat-checkbox> | ||
</div> | ||
<ng-container *ngIf="item.type === 'select'"> | ||
<mat-form-field class="option-item"> | ||
<mat-label>{{ item.label | translate }}</mat-label> | ||
<mat-select [(ngModel)]="item.value" [name]="item.field"> | ||
<mat-option *ngFor="let option of item.options" [value]="option.value"> | ||
{{ option.label | translate }} | ||
</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</ng-container> | ||
<ng-container *ngIf="item.type === 'radio'"> | ||
<div class="option-item"> | ||
<mat-radio-group [(ngModel)]="item.value" [name]="item.field"> | ||
<mat-label style="margin-right: 10px">{{ item.label | translate }}</mat-label> | ||
<mat-radio-button *ngFor="let option of item.options" [value]="option.value"> | ||
{{ option.label | translate }} | ||
</mat-radio-button> | ||
</mat-radio-group> | ||
</div> | ||
</ng-container> | ||
</ng-container> | ||
</div> | ||
</mat-expansion-panel> | ||
</mat-accordion> | ||
</div> |
56 changes: 47 additions & 9 deletions
56
src/app/elements/connect/connect-dialog/advanced-option/advanced-option.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,78 @@ | ||
.advanced-option { | ||
margin-top: 1.25em; | ||
} | ||
|
||
.mat-expansion-panel-header { | ||
height: 32px!important; | ||
padding: 0; | ||
padding-right: 4px; | ||
height: 32px !important; | ||
padding: 0 4px 0 0; | ||
} | ||
|
||
.mat-expansion-panel-header-title { | ||
color: rgba(0, 0, 0, 0.54); | ||
font-size: 13px; | ||
} | ||
|
||
.mat-expansion-panel:not([class*=mat-elevation-z]) { | ||
box-shadow: none; | ||
} | ||
|
||
.mat-expansion-panel { | ||
border-bottom: 1px solid rgba(0, 0, 0, 0.42); | ||
border-bottom: 1px solid rgb(0, 0, 0, 12%); | ||
|
||
&::ng-deep .mat-expansion-panel-body { | ||
padding: 0 0 14px!important; | ||
padding: 0 0 0 !important; | ||
} | ||
} | ||
|
||
.mat-expansion-panel.mat-expanded { | ||
border-bottom: none; | ||
|
||
&::ng-deep .mat-expansion-panel-content { | ||
padding: 10px 5px 0 5px; | ||
border: solid 1px rgb(0, 0, 0, 12%); | ||
} | ||
} | ||
|
||
.mat-accordion .mat-expansion-panel:last-of-type { | ||
border-bottom-right-radius: 0; | ||
border-bottom-left-radius: 0; | ||
} | ||
|
||
.example-radio-group { | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: 4px; | ||
} | ||
|
||
.example-radio-button { | ||
margin: 2px; | ||
} | ||
.ng-star-inserted { | ||
margin-top: 5px; | ||
|
||
|
||
.option-item.mat-form-field { | ||
margin-top: 10px; | ||
} | ||
|
||
.option-item { | ||
flex: 0 0 49%; | ||
box-sizing: border-box; | ||
} | ||
|
||
.option-item:first-child { | ||
margin-left: 0; | ||
} | ||
|
||
.mat-checkbox-layout { | ||
margin-left: 12px !important; | ||
} | ||
|
||
.options-container { | ||
display: flex; | ||
flex-wrap: wrap; | ||
align-items: baseline; /* 添加这一行 */ | ||
} | ||
.mat-checkbox-layout { | ||
margin-left: 12px!important; | ||
|
||
.options-container > ng-container { | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.