diff --git a/package.json b/package.json index b758cf506..2469bcb43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netgrif/components-project", - "version": "7.0.0", + "version": "7.0.2", "description": "Netgrif Application Engine Frontend project. Project includes angular libraries as base for NAE applications.", "homepage": "https://components.netgrif.com", "license": "SEE LICENSE IN LICENSE", diff --git a/projects/netgrif-components-core/package.json b/projects/netgrif-components-core/package.json index e2e241993..3524daef0 100644 --- a/projects/netgrif-components-core/package.json +++ b/projects/netgrif-components-core/package.json @@ -1,6 +1,6 @@ { "name": "@netgrif/components-core", - "version": "7.0.0", + "version": "7.0.2", "description": "Netgrif Application engine frontend core Angular library", "homepage": "https://components.netgrif.com", "license": "SEE LICENSE IN LICENSE", diff --git a/projects/netgrif-components-core/src/lib/search/models/category/case/case-string-id.ts b/projects/netgrif-components-core/src/lib/search/models/category/case/case-string-id.ts index 7b1f6ef09..895ec157e 100644 --- a/projects/netgrif-components-core/src/lib/search/models/category/case/case-string-id.ts +++ b/projects/netgrif-components-core/src/lib/search/models/category/case/case-string-id.ts @@ -41,7 +41,7 @@ export class CaseStringId extends NoConfigurationCategory { protected get elasticKeywords(): Array { if (!!this._optionalDependencies) { const resolver = this._optionalDependencies.searchIndexResolver; - return [resolver.getCoreIndex(CaseSearch.STRING_ID, this.isSelectedOperator(Substring))]; + return [resolver.getCoreIndex(CaseSearch.STRING_ID, this.isSelectedOperator(Substring) || this.isSelectedOperator(Equals))]; } else { return this._elasticKeywords; } diff --git a/projects/netgrif-components-core/src/lib/search/models/category/case/case-visual-id.ts b/projects/netgrif-components-core/src/lib/search/models/category/case/case-visual-id.ts index d009b9fed..09efdca34 100644 --- a/projects/netgrif-components-core/src/lib/search/models/category/case/case-visual-id.ts +++ b/projects/netgrif-components-core/src/lib/search/models/category/case/case-visual-id.ts @@ -37,7 +37,7 @@ export class CaseVisualId extends NoConfigurationCategory { protected get elasticKeywords(): Array { if (!!this._optionalDependencies) { const resolver = this._optionalDependencies.searchIndexResolver; - return [resolver.getCoreIndex(CaseSearch.VISUAL_ID, this.isSelectedOperator(Substring))]; + return [resolver.getCoreIndex(CaseSearch.VISUAL_ID, this.isSelectedOperator(Substring) || this.isSelectedOperator(Equals))]; } else { return this._elasticKeywords; } diff --git a/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts b/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts index bc2feec17..a81e28193 100644 --- a/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts +++ b/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts @@ -33,6 +33,11 @@ export class TabView implements TabViewInterface { public selectedIndex: FormControl; private uniqueIdCounter = new IncrementingCounter(); + + private _switching = false; + + private _pendingTabUniqueId: string | undefined; + /** * @ignore * Holds a reference to an object that hides some public attributes and methods from tabs. @@ -274,17 +279,40 @@ export class TabView implements TabViewInterface { } public tabChange(event: MatTabChangeEvent) { - if (event.index !== this.selectedIndex.value) { + const pendingTabUniqueId = this.openedTabs[event.index]?.uniqueId; + if (pendingTabUniqueId === undefined) { + return; + } + this._pendingTabUniqueId = pendingTabUniqueId; + if (this._switching) { + return; // an update is already being processed; the pending value will be picked up after + } + this._processSwitch(); + } + + private _processSwitch() { + this._switching = true; + const uniqueId = this._pendingTabUniqueId; + const index = this.openedTabs.findIndex(tab => tab.uniqueId === uniqueId); + + if (index !== -1 && index !== this.selectedIndex.value) { let tab = this.openedTabs[this.selectedIndex.value]; if (tab) { tab.tabSelected$.next(false); } - tab = this.openedTabs[event.index]; + tab = this.openedTabs[index]; if (tab) { tab.tabSelected$.next(true); } - this.selectedIndex.setValue(event.index); + this.selectedIndex.setValue(index); } + + setTimeout(() => { + this._switching = false; + if (this._pendingTabUniqueId !== uniqueId) { + this._processSwitch(); + } + }, 150); } /** diff --git a/projects/netgrif-components/package.json b/projects/netgrif-components/package.json index 9cb7c2985..3e3c62c3f 100644 --- a/projects/netgrif-components/package.json +++ b/projects/netgrif-components/package.json @@ -1,6 +1,6 @@ { "name": "@netgrif/components", - "version": "7.0.0", + "version": "7.0.2", "description": "Netgrif Application Engine frontend Angular components", "homepage": "https://components.netgrif.com", "license": "SEE LICENSE IN LICENSE", @@ -29,7 +29,7 @@ "nae frontend" ], "peerDependencies": { - "@netgrif/components-core": "7.0.0", + "@netgrif/components-core": "7.0.2", "@angular-material-components/datetime-picker": "~16.0.0", "@angular-material-components/moment-adapter": "~16.0.0", "@angular/animations": "~17.1.0",