fix: added stealFocus directive
This commit is contained in:
parent
85909cfc1e
commit
9a79f37bf1
|
@ -4,20 +4,23 @@ import { NgVarDirective } from './ng-var.directive'
|
|||
import { DragNdropDirective } from './drag-ndrop.directive'
|
||||
import { FileDropDirective } from './file-drop.directive'
|
||||
import { FileSelectDirective } from './file-select.directive'
|
||||
import { StealFocusDirective } from './steal-focus.directive'
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
NgVarDirective,
|
||||
DragNdropDirective,
|
||||
FileDropDirective,
|
||||
FileSelectDirective
|
||||
FileSelectDirective,
|
||||
StealFocusDirective
|
||||
],
|
||||
imports: [CommonModule],
|
||||
exports: [
|
||||
NgVarDirective,
|
||||
DragNdropDirective,
|
||||
FileDropDirective,
|
||||
FileSelectDirective
|
||||
FileSelectDirective,
|
||||
StealFocusDirective
|
||||
]
|
||||
})
|
||||
export class DirectivesModule {}
|
||||
|
|
18
client/src/app/directives/steal-focus.directive.ts
Normal file
18
client/src/app/directives/steal-focus.directive.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Directive, HostListener } from '@angular/core';
|
||||
|
||||
@Directive({
|
||||
selector: '[appStealFocus]'
|
||||
})
|
||||
export class StealFocusDirective {
|
||||
|
||||
constructor() { }
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
@HostListener('click', ['$event']) onClick(event: any){
|
||||
event.target.focus()
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
<clr-tree-node *ngIf="groups" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchLibTreeInput
|
||||
placeholder="Filter by Groups"
|
||||
|
|
|
@ -147,15 +147,6 @@ export class GroupComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
public groupListOnFilter() {
|
||||
this.helperService.libraryOnFilter(
|
||||
this.groups,
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<clr-tree-node *ngIf="treeNodeLibraries?.length! > 0" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
clrInput
|
||||
appStealFocus
|
||||
#searchLibTreeInput
|
||||
placeholder="Libraries"
|
||||
name="input"
|
||||
|
@ -47,7 +47,7 @@
|
|||
<clr-tree-node *ngIf="library['tables']" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchTreeInput
|
||||
placeholder="Tables"
|
||||
|
|
|
@ -45,15 +45,6 @@ export class HomeComponent implements AfterContentInit {
|
|||
private sasService: SasService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
public collapseLibraryItems(libraries: any, libraryToSkip: any) {
|
||||
libraries.forEach((library: any) => {
|
||||
if (library.LIBRARYID !== libraryToSkip.LIBRARYID) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<clr-tree-node *ngIf="libraryList" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchLibTreeInput
|
||||
placeholder="Libraries"
|
||||
|
@ -43,7 +43,7 @@
|
|||
<clr-tree-node *ngIf="library['tables']" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchTreeInput
|
||||
placeholder="Tables"
|
||||
|
@ -87,7 +87,7 @@
|
|||
<clr-tree-node *ngIf="libTable['columns']" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchTreeInput
|
||||
placeholder="Columns"
|
||||
|
|
|
@ -71,15 +71,6 @@ export class LineageComponent {
|
|||
public helperService: HelperService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
public showTableSelect() {
|
||||
this.tableFlag = !this.tableFlag
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<clr-tree-node *ngIf="metaDataList" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchLibTreeInput
|
||||
placeholder="search SAS Types"
|
||||
|
|
|
@ -150,15 +150,6 @@ export class MetadataComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
public treeNodeClicked(event: any, item: any, tree: any) {
|
||||
if (event.target.title === 'Collapse') {
|
||||
this.collapseTreeItems(tree, item)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<clr-tree-node *ngIf="roles" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchLibTreeInput
|
||||
placeholder="Filter by Roles"
|
||||
|
|
|
@ -106,15 +106,6 @@ export class RoleComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
public roleListOnFilter() {
|
||||
this.helperService.libraryOnFilter(this.roles, this.roleSearch, 'ROLENAME')
|
||||
globals.usernav.roleSearch = this.roleSearch
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<clr-tree-node *ngIf="libraryList" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchLibTreeInput
|
||||
placeholder="Libraries"
|
||||
|
@ -46,7 +46,7 @@
|
|||
<clr-tree-node *ngIf="library['tables']" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchTreeInput
|
||||
placeholder="Tables"
|
||||
|
@ -116,7 +116,7 @@
|
|||
<clr-tree-node *ngIf="libTable['columns']" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchTreeInput
|
||||
placeholder="Columns"
|
||||
|
|
|
@ -66,15 +66,6 @@ export class DcTreeComponent implements OnInit, AfterViewInit, OnChanges {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
treeOnFilter(array: any, arrToFilter: string) {
|
||||
this.helperService.treeOnFilter(array, arrToFilter)
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<clr-tree-node *ngIf="users" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchLibTreeInput
|
||||
placeholder="Filter by Users"
|
||||
|
|
|
@ -184,15 +184,6 @@ export class UserComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
public userListOnFilter() {
|
||||
this.helperService.libraryOnFilter(this.users, this.userSearch, 'NAME')
|
||||
globals.usernav.userSearch = this.userSearch
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<clr-tree-node *ngIf="libraries" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchLibTreeInput
|
||||
[(ngModel)]="librariesSearch"
|
||||
|
@ -51,7 +51,7 @@
|
|||
<clr-tree-node *ngIf="library['tables']" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchTreeInput
|
||||
[id]="'search_' + library.LIBRARYREF"
|
||||
|
|
|
@ -215,15 +215,6 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
|
|||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
/**
|
||||
* Open viewboxes modal
|
||||
*/
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<clr-tree-node *ngIf="endpointLinks.length > 0" class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchLinksTreeInput
|
||||
placeholder="Search links"
|
||||
|
|
|
@ -53,15 +53,6 @@ export class ViyaApiExplorerComponent implements OnInit {
|
|||
this.collections = this.sasViyaService.getAllCollections()
|
||||
}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
linksListOnFilter() {
|
||||
this.helperService.libraryOnFilter(
|
||||
this.endpointLinks,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<clr-tree-node class="search-node">
|
||||
<div class="tree-search-wrapper">
|
||||
<input
|
||||
(click)="stealFocusFix($event)"
|
||||
appStealFocus
|
||||
clrInput
|
||||
#searchXLMapTreeInput
|
||||
placeholder="Filter by Id"
|
||||
|
|
|
@ -143,15 +143,6 @@ export class XLMapComponent implements AfterContentInit, AfterViewInit, OnInit {
|
|||
private sasService: SasService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* For some reason newest version of Clarity v17.0.1 is stealing focus when
|
||||
* clicking on the input inside of the clr-tree-view
|
||||
* This is workaround
|
||||
*/
|
||||
public stealFocusFix(event: any) {
|
||||
event.target.focus()
|
||||
}
|
||||
|
||||
public afterGetColHeader(column: number, th: any) {
|
||||
// Dark mode
|
||||
th.classList.add('darkTH')
|
||||
|
|
Loading…
Reference in New Issue
Block a user