-
Notifications
You must be signed in to change notification settings - Fork 42
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
1 parent
93060ae
commit 2320787
Showing
16 changed files
with
428 additions
and
4 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
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
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
95 changes: 95 additions & 0 deletions
95
application/client/src/app/ui/views/toolbar/search/nested/component.ts
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { | ||
Component, | ||
OnDestroy, | ||
ViewChild, | ||
Input, | ||
AfterContentInit, | ||
AfterViewInit, | ||
ChangeDetectorRef, | ||
ElementRef, | ||
ViewEncapsulation, | ||
} from '@angular/core'; | ||
import { MatAutocompleteTrigger } from '@angular/material/autocomplete'; | ||
import { Session } from '@service/session'; | ||
import { Ilc, IlcInterface } from '@env/decorators/component'; | ||
import { SearchInput } from '../input/input'; | ||
import { List } from '@env/storages/recent/list'; | ||
import { ChangesDetector } from '@ui/env/extentions/changes'; | ||
import { ISearchFinishEvent } from '@service/session/dependencies/search/state'; | ||
import { Notification } from '@ui/service/notifications'; | ||
import { IFilter } from '@platform/types/filter'; | ||
|
||
@Component({ | ||
selector: 'app-views-search-nested', | ||
templateUrl: './template.html', | ||
styleUrls: ['./styles.less'], | ||
encapsulation: ViewEncapsulation.None, | ||
}) | ||
@Ilc() | ||
export class ViewSearchNested | ||
extends ChangesDetector | ||
implements AfterViewInit, AfterContentInit, OnDestroy | ||
{ | ||
@Input() public session!: Session; | ||
|
||
@ViewChild('searchinput') searchInputRef!: ElementRef<HTMLInputElement>; | ||
@ViewChild(MatAutocompleteTrigger) recentPanelRef!: MatAutocompleteTrigger; | ||
|
||
public readonly input = new SearchInput(); | ||
public readonly recent: List; | ||
public readonly progress: boolean = false; | ||
|
||
constructor(chRef: ChangeDetectorRef) { | ||
super(chRef); | ||
this.recent = new List(this.input.control, 'RecentNestedFilters', 'recent_nested_filters'); | ||
} | ||
|
||
public ngOnDestroy(): void { | ||
this.session.search.state().nonActive = this.input.getNonActive(); | ||
this.input.destroy(); | ||
} | ||
|
||
public ngAfterContentInit(): void { | ||
const filter = this.session.search.state().getNested(); | ||
this.input.set().value(filter ? filter : ''); | ||
} | ||
|
||
public ngAfterViewInit(): void { | ||
this.input.bind(this.searchInputRef.nativeElement, this.recentPanelRef); | ||
this.input.actions.accept.subscribe(() => { | ||
if (this.input.value.trim() !== '') { | ||
const filter = this.input.asFilter(); | ||
this.recent.update(filter.filter); | ||
this.session.search.state().setNested(filter); | ||
this.session.search | ||
.searchNextNested() | ||
.then((pos: number | undefined) => { | ||
console.log(`>>>>>>>>>>>>>>>>>>>>> next: ${pos}`); | ||
}) | ||
.catch((err: Error) => { | ||
this.log().error(`Fail apply nested search: ${err.message}`); | ||
}); | ||
} else { | ||
this.drop(); | ||
} | ||
}); | ||
this.input.actions.drop.subscribe(() => { | ||
this.drop(); | ||
}); | ||
this.input.actions.edit.subscribe(() => { | ||
console.log('>>>>>>>>>>>>>>>> Edit'); | ||
// this.input.set().value(this.active.filter); | ||
// this.drop(); | ||
this.detectChanges(); | ||
}); | ||
this.input.actions.recent.subscribe(() => { | ||
this.detectChanges(); | ||
}); | ||
this.input.focus(); | ||
} | ||
|
||
public drop() { | ||
this.session.search.state().dropNested(); | ||
} | ||
} | ||
export interface ViewSearchNested extends IlcInterface {} |
82 changes: 82 additions & 0 deletions
82
application/client/src/app/ui/views/toolbar/search/nested/styles.less
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
@import '../../../../styles/variables.less'; | ||
|
||
app-views-search-nested { | ||
display: flex; | ||
position: relative; | ||
flex-direction: row; | ||
height: 32px; | ||
width: 250px; | ||
background: @scheme-color-5; | ||
overflow: hidden; | ||
justify-content: center; | ||
align-items: center; | ||
div.input { | ||
display: block; | ||
flex: auto; | ||
height: 24px; | ||
overflow: hidden; | ||
align-items: center; | ||
padding-left: 6px; | ||
} | ||
div.flags, | ||
div.extantions { | ||
display: flex; | ||
padding: 0px 8px 0 8px; | ||
& span { | ||
display: inline-block; | ||
height: 24px; | ||
width: 24px; | ||
color: @scheme-color-0; | ||
text-align: center; | ||
padding-top: 4px; | ||
box-sizing: border-box; | ||
&:hover{ | ||
background: @scheme-color-4; | ||
} | ||
&.active{ | ||
background: @scheme-color-active; | ||
} | ||
&.invalid { | ||
color: @scheme-color-error; | ||
} | ||
} | ||
} | ||
div.summary { | ||
position: relative; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
padding: 0 6px 0 0; | ||
margin-right: 12px; | ||
white-space: nowrap; | ||
& mat-spinner { | ||
margin-left: 6px; | ||
} | ||
& span.error { | ||
display: flex; | ||
align-items: center; | ||
padding-right: 6px; | ||
& span.message { | ||
color: @scheme-color-error; | ||
max-width: 150px; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
& mat-icon { | ||
color: @scheme-color-error; | ||
height: 16px; | ||
width: 16px; | ||
font-size: 16px; | ||
margin: 0 6px 0 1px; | ||
line-height: 16px; | ||
} | ||
} | ||
} | ||
& span.small-icon-button.occupied { | ||
font-size: 13px; | ||
line-height: 13px; | ||
padding-top: 6px; | ||
} | ||
|
||
} |
Oops, something went wrong.