Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<input
nz-input
[readOnly]="isFileSelectionEnabled"
required
[formControl]="formControl"
[formlyAttributes]="field"
(click)="isFileSelectionEnabled && onClickOpenFileSelectionModal()" />
<div class="input-autocomplete-container">
<input
*ngIf="selectedFilePath"
nz-input
[readOnly]="isFileSelectionEnabled"
required
[formControl]="formControl"
[formlyAttributes]="field" />
<button
nz-button
class="file-select-button"
nzSize="small"
(click)="isFileSelectionEnabled && onClickOpenFileSelectionModal()">
{{ selectedFilePath ? 'Reselect File' : 'Select File' }}
</button>
</div>
<div
class="alert alert-danger"
role="alert"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
mat-form-field {
width: 100%;
}
.input-autocomplete-container {
display: flex;
align-items: center;
width: 100%;

input {
flex: 1;
margin-right: 10px;
}

button {
white-space: nowrap;
}

.file-select-button {
border: 2px solid #1890ff;
color: #1890ff;

&:hover {
background-color: #e6f7ff;
border-color: #1890ff;
}

&:focus {
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ export class InputAutoCompleteComponent extends FieldType<FieldTypeConfig> {
get isFileSelectionEnabled(): boolean {
return environment.userSystemEnabled;
}

get selectedFilePath(): string | null {
return this.formControl.value;
}
}