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
Expand Up @@ -50,6 +50,7 @@ import {NzSelectModule} from 'ng-zorro-antd/select';
import {NzDropDownModule} from "ng-zorro-antd/dropdown";
import {IndexingFormComponent} from './components/indexing-form/indexing-form.component';
import {NzLayoutModule} from "ng-zorro-antd/layout";
import {NzAutocompleteModule} from "ng-zorro-antd/auto-complete";

@NgModule({
declarations: [
Expand Down Expand Up @@ -91,6 +92,7 @@ import {NzLayoutModule} from "ng-zorro-antd/layout";
NzSelectModule,
NzDropDownModule,
NzLayoutModule,
NzAutocompleteModule,
],
providers: [
NzMessageService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,41 @@
[nzXs]="20"
>
<div class="input-group-container">
<nz-input-group [nzSuffix]="suffixIconSearch"
nzTrigger="click"
nz-dropdown
[nzDropdownMenu]="config.outputName ? menu : null">
<nz-input-group [nzSuffix]="suffixIconSearch">
<input
*ngIf="config.type === 'text'"
*ngIf="config.type === 'text' && !config.outputName"
nz-input
[formControl]="controls[i]"
(keyup)="onChange(config)"
(keyup.enter)="onAddClick()"
/>
<nz-select nzAllowClear nzShowSearch nzBorderless
nzSize="small"
*ngIf="config.type === 'text' && config.outputName"
[(ngModel)]="controls[i].value"
(ngModelChange)="updateValue($event, controls[i], config)"
(nzOnSearch)="selectSearch($event)">
<!--When user types anything, it's always shown as the first option-->
<nz-option nzValue="{{selectSearchValue}}" nzLabel="{{selectSearchValue}}"
*ngIf="selectSearchValue"
(click)="updateValue(selectSearchValue, controls[i], config)"></nz-option>
<!--Current select value so that it's shown even if no such value is in the list-->
<nz-option nzValue="{{controls[i].value}}" nzLabel="{{controls[i].value}}"
*ngIf="controls[i].value"></nz-option>
<nz-option-group nzLabel="Column mappings">
<nz-option nzValue="{{item}}" nzLabel="{{item}}"
*ngFor="let item of mappingColumns; let j = index;"
#columnMapping
(click)="updateValue(columnMapping.nzValue, controls[i], config)"></nz-option>
</nz-option-group>
<nz-option-group nzLabel="Ignore fields"
*ngIf="mappingColumns.length > 0 && ignoreColumns.length > 0">
<nz-option nzValue="{{item}}" nzLabel="{{item}}"
*ngFor="let item of ignoreColumns; let j = index;"
#ignore_value
(click)="updateValue(ignore_value.nzValue, controls[i], config)"></nz-option>
</nz-option-group>
</nz-select>
<textarea
*ngIf="config.type === 'textarea'"
nz-input
Expand Down Expand Up @@ -67,20 +91,5 @@
<i *ngIf="i === 0" nz-icon nzType="info-circle" nzTheme="outline" nzTooltipTitle="{{ config.description }}"
nzTooltipPlacement="right" nz-tooltip></i>
</ng-template>
<nz-dropdown-menu
#menu="nzDropdownMenu">
<ul nz-menu>
<li nz-menu-item
*ngFor="let item of mappingColumns; let j = index;"
#columnMapping
(click)="updateValue(columnMapping.innerHTML, controls[i], config)">{{item}}</li>
<li nz-menu-divider
*ngIf="mappingColumns.length > 0 && ignoreColumns.length > 0"></li>
<li nz-menu-item nzDanger
*ngFor="let item of ignoreColumns; let j = index;"
#ignore_value
(click)="updateValue(ignore_value.innerHTML, controls[i], config)">{{item}}</li>
</ul>
</nz-dropdown-menu>
</nz-form-control>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class MultiInputComponent implements OnInit, OnChanges {
controls = [];
ignoreColumns: string[] = [];
mappingColumns: string[] = [];
selectSearchValue = "";

constructor() { }

Expand Down Expand Up @@ -105,4 +106,8 @@ export class MultiInputComponent implements OnInit, OnChanges {
});
this.changeValue.emit(value);
}

selectSearch($event: string) {
this.selectSearchValue=$event;
}
}