Skip to content
Closed
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
8 changes: 4 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": ["zone.js"],
"polyfills": [],
"tsConfig": "src/tsconfig.app.json",
"aot": false,
"assets": [
Expand Down Expand Up @@ -380,7 +380,7 @@
"outputPath": "dist/dashboards-demo",
"index": "projects/dashboards-demo/src/index.html",
"main": "projects/dashboards-demo/src/main.ts",
"polyfills": ["zone.js"],
"polyfills": [],
"tsConfig": "projects/dashboards-demo/tsconfig.app.json",
"aot": true,
"assets": [
Expand Down Expand Up @@ -495,7 +495,7 @@
"outputPath": "dist/dashboards-demo-webcomponents",
"index": "projects/dashboards-demo/webcomponents/src/index.html",
"main": "projects/dashboards-demo/webcomponents/src/main.ts",
"polyfills": ["zone.js"],
"polyfills": [],
"tsConfig": "projects/dashboards-demo/webcomponents/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [],
Expand Down Expand Up @@ -572,7 +572,7 @@
"outputPath": "dist/dashboards-demo/mfe",
"index": "projects/dashboards-demo/mfe/src/index.html",
"main": "projects/dashboards-demo/mfe/src/main.ts",
"polyfills": ["zone.js"],
"polyfills": [],
"tsConfig": "projects/dashboards-demo/mfe/tsconfig.app.json",
"aot": true,
"assets": [
Expand Down
10 changes: 1 addition & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@
"ol-ext": "4.0.36",
"ol-mapbox-style": "13.1.1",
"rxjs": "7.8.2",
"tslib": "2.8.1",
"zone.js": "0.15.1"
"tslib": "2.8.1"
},
"devDependencies": {
"@angular-builders/custom-esbuild": "20.0.0",
Expand Down
8 changes: 7 additions & 1 deletion projects/dashboards-demo/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
* SPDX-License-Identifier: MIT
*/
import { HttpBackend, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import {
ApplicationConfig,
importProvidersFrom,
provideZonelessChangeDetection
} from '@angular/core';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideRouter, withHashLocation } from '@angular/router';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
Expand All @@ -27,6 +31,8 @@ const config: Config = {

export const appConfig: ApplicationConfig = {
providers: [
// eslint-disable-next-line @angular-eslint/no-developer-preview
provideZonelessChangeDetection(),
provideRouter(routes, withHashLocation()),
{ provide: SI_WIDGET_STORE, useClass: AppWidgetStorage },
{ provide: SI_DASHBOARD_CONFIGURATION, useValue: config },
Expand Down
5 changes: 5 additions & 0 deletions projects/element-ng/about/si-about.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { NgTemplateOutlet } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
computed,
inject,
Expand Down Expand Up @@ -104,6 +105,7 @@ export class SiAboutComponent implements OnInit {

protected readonly licenseApi = signal<ApiInfo[]>([]);
protected readonly icons = addIcons({ elementDocument });
private cdRef = inject(ChangeDetectorRef);

ngOnInit(): void {
const licenseInfo = this.licenseInfo();
Expand All @@ -115,6 +117,7 @@ export class SiAboutComponent implements OnInit {
this.licenseApi.set([...data]);
this.toggleLoadLicenseApi(this.licenseApi()[0]);
}
this.cdRef.markForCheck();
});
}
}
Expand All @@ -125,6 +128,7 @@ export class SiAboutComponent implements OnInit {
this.http.get<ApiInfo[]>(apiInfo.href, { responseType: 'json' }).subscribe(files => {
apiInfo.files = files;
this.licenseApi.set([...licenseApi]);
this.cdRef.markForCheck();
});
}
apiInfo.isOpen = !apiInfo.isOpen;
Expand All @@ -138,6 +142,7 @@ export class SiAboutComponent implements OnInit {
this.http.get(apiInfo.href, { responseType: 'text' }).subscribe((content: string) => {
apiInfo.content = content;
this.licenseApi.set([...licenseApi]);
this.cdRef.markForCheck();
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import { CdkMonitorFocus, FocusOrigin } from '@angular/cdk/a11y';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
computed,
ElementRef,
inject,
input,
model,
OnInit,
Expand Down Expand Up @@ -72,6 +74,7 @@ export class SiFilteredSearchValueComponent implements OnInit {

private readonly operatorInput = viewChild<ElementRef<HTMLInputElement>>('operatorInput');
private readonly valueInput = viewChild(SiFilteredSearchValueBase);
private cdRef = inject(ChangeDetectorRef);

readonly type = computed(() => {
const definition = this.definition();
Expand Down Expand Up @@ -149,6 +152,7 @@ export class SiFilteredSearchValueComponent implements OnInit {
if (this.active() && !focusOrigin && !this.valueInput()?.focusInOverlay()) {
this.active.set(false);
}
this.cdRef.markForCheck();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export class SiFilteredSearchComponent implements OnInit, OnChanges {
return this.translateService.translateAsync(criteria.map(c => c.label)).pipe(
map(translations => {
criteria.forEach(c => (c.translatedLabel = translations[c.label] ?? c.label ?? c.name));
this.cdRef.markForCheck();
return criteria;
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) Siemens 2016 - 2025
* SPDX-License-Identifier: MIT
*/
import { computed, DestroyRef, Directive, inject, input } from '@angular/core';
import { ChangeDetectorRef, computed, DestroyRef, Directive, inject, input } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { injectSiTranslateService } from '@siemens/element-translate-ng/translate';
import { BehaviorSubject, Observable, of, switchMap } from 'rxjs';
Expand Down Expand Up @@ -54,6 +54,8 @@ export abstract class SiFilteredSearchOptionValueBase extends SiFilteredSearchVa
);
});

private cdRef = inject(ChangeDetectorRef);

protected buildOptions(): Observable<TypeaheadOptionCriterion[]> | undefined {
let optionsStream: Observable<OptionCriterion[]> | undefined;
if (this.lazyValueProvider()) {
Expand Down Expand Up @@ -82,12 +84,13 @@ export abstract class SiFilteredSearchOptionValueBase extends SiFilteredSearchVa
switchMap(options => {
const keys: string[] = options.map(option => option.label!).filter(label => !!label);
return this.translateService.translateAsync(keys).pipe(
map(translations =>
options.map(option => ({
map(translations => {
this.cdRef.markForCheck();
return options.map(option => ({
...option,
translatedLabel: translations[option.label!] ?? option.label ?? option.value
}))
)
}));
})
);
})
);
Expand All @@ -98,7 +101,10 @@ export abstract class SiFilteredSearchOptionValueBase extends SiFilteredSearchVa
// resolve options for initial values
this.options()!
.pipe(first())
.subscribe(options => this.processTypeaheadOptions(options));
.subscribe(options => {
this.cdRef.markForCheck();
this.processTypeaheadOptions(options);
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) Siemens 2016 - 2025
* SPDX-License-Identifier: MIT
*/
import { Directive, input, OnDestroy, signal } from '@angular/core';
import { ChangeDetectorRef, Directive, inject, input, OnDestroy, signal } from '@angular/core';
import { of, Subject, switchMap } from 'rxjs';
import { debounceTime, takeUntil } from 'rxjs/operators';

Expand Down Expand Up @@ -38,6 +38,7 @@ export class SiSelectLazyOptionsDirective<T> implements SiSelectOptionsStrategy<

private valueChange = new Subject<void>();
private filterChange = new Subject<string | undefined>();
private cdRef = inject(ChangeDetectorRef);

constructor() {
this.filterChange
Expand All @@ -59,6 +60,7 @@ export class SiSelectLazyOptionsDirective<T> implements SiSelectOptionsStrategy<
.subscribe(rows => {
this.loading.set(false);
this.rows.set(rows);
this.cdRef.markForCheck();
});
}

Expand Down Expand Up @@ -95,7 +97,10 @@ export class SiSelectLazyOptionsDirective<T> implements SiSelectOptionsStrategy<
optionSource
.getOptionsForValues(value)
.pipe(takeUntil(this.valueChange))
.subscribe(selectedOptions => this.selectedRows.set(selectedOptions));
.subscribe(selectedOptions => {
this.selectedRows.set(selectedOptions);
this.cdRef.markForCheck();
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[id]="baseId() + '-content'"
[siAutoCollapsableList]="selectionStrategy.allowMultiple"
>
@for (activeOption of selectedRows(); track activeOption) {
@for (activeOption of selectedRows(); track $index) {
@if (activeOption) {
<si-select-option
siAutoCollapsableListItem
Expand Down
5 changes: 4 additions & 1 deletion projects/element-ng/side-panel/si-side-panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ export class SiSidePanelComponent implements OnInit, OnDestroy, OnChanges {
if (open) {
this.isHidden.set(false);
}
setTimeout(() => this.doOpenClose(open));
setTimeout(() => {
this.doOpenClose(open);
this.cdRef.markForCheck();
});
}

private doOpenClose(open: boolean): void {
Expand Down
3 changes: 3 additions & 0 deletions projects/element-ng/typeahead/si-typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ConnectionPositionPair, Overlay, OverlayRef } from '@angular/cdk/overla
import { ComponentPortal } from '@angular/cdk/portal';
import {
booleanAttribute,
ChangeDetectorRef,
ComponentRef,
computed,
Directive,
Expand Down Expand Up @@ -287,6 +288,7 @@ export class SiTypeaheadDirective implements OnChanges, OnDestroy {
private matchSorter = new SiTypeaheadSorting();

private overlayRef?: OverlayRef;
private cdRef = inject(ChangeDetectorRef);

/**
* Indicates that the typeahead can be potentially open.
Expand Down Expand Up @@ -424,6 +426,7 @@ export class SiTypeaheadDirective implements OnChanges, OnDestroy {
this.query.set(value);
this.typeaheadOnInput.emit(value ?? '');
this.canBeOpen.set(true);
this.cdRef.markForCheck();
}, this.typeaheadWaitMs());
}

Expand Down
Loading
Loading