@progress/kendo-angular-l10n
Version:
Kendo UI Angular l10n component - an easily customized popup from the most trusted provider of professional Angular components.
45 lines (44 loc) • 1.81 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Directive } from '@angular/core';
import { skip } from "rxjs/operators";
import * as i0 from "@angular/core";
/**
* Base class that acts as a component messages container.
*
* For internal use.
* @hidden
*/
export class ComponentMessages {
service;
subscription;
get override() {
return false;
}
ngOnChanges(changes) {
this.register(changes);
if (Object.keys(changes).some(field => !changes[field].isFirstChange())) {
this.service.notifyChanges();
}
}
ngOnInit() {
this.subscription = this.service.changes.pipe(skip(1)).subscribe(() => this.register(this));
}
register(changes) {
const keys = Object.keys(changes);
keys.forEach(key => this.service.register(key, this[key], this.override));
}
ngOnDestroy() {
if (this.subscription) {
this.subscription.unsubscribe();
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ComponentMessages, deps: [], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ComponentMessages, usesOnChanges: true, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ComponentMessages, decorators: [{
type: Directive,
args: [{}]
}] });