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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion projects/netgrif-components-core/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class CaseStringId extends NoConfigurationCategory<string> {
protected get elasticKeywords(): Array<string> {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class CaseVisualId extends NoConfigurationCategory<string> {
protected get elasticKeywords(): Array<string> {
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;
}
Expand Down
34 changes: 31 additions & 3 deletions projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export class TabView implements TabViewInterface {
public selectedIndex: FormControl<number>;

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.
Expand Down Expand Up @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions projects/netgrif-components/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading