mn-angular-lib 0.0.48 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Optional, Inject, inject, Input, ChangeDetectionStrategy, Component, HostBinding, Self, DestroyRef, APP_INITIALIZER, ElementRef, HostListener, forwardRef, Directive, EventEmitter, TemplateRef, Output, ViewChildren, ViewContainerRef, ViewChild, ApplicationRef, EnvironmentInjector, createComponent, SkipSelf, Attribute, Pipe } from '@angular/core';
2
+ import { InjectionToken, Injectable, Optional, Inject, inject, Input, ChangeDetectionStrategy, Component, HostBinding, DestroyRef, Self, APP_INITIALIZER, ElementRef, HostListener, forwardRef, Directive, EventEmitter, TemplateRef, Output, ViewChildren, ViewContainerRef, ViewChild, ApplicationRef, EnvironmentInjector, createComponent, SkipSelf, Attribute, Pipe } from '@angular/core';
3
3
  export { TemplateRef, Type } from '@angular/core';
4
4
  import { BehaviorSubject, firstValueFrom, skip, Subject, debounceTime, map, catchError, of } from 'rxjs';
5
5
  import * as i1 from '@angular/common';
@@ -870,6 +870,8 @@ class MnInputField {
870
870
  configService = inject(MnConfigService);
871
871
  sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];
872
872
  explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });
873
+ lang = inject(MnLanguageService);
874
+ destroyRef = inject(DestroyRef);
873
875
  /** Current raw string value of the input element */
874
876
  value = null;
875
877
  /** Whether the input is disabled */
@@ -904,6 +906,10 @@ class MnInputField {
904
906
  }
905
907
  ngOnInit() {
906
908
  this.resolveConfig();
909
+ const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {
910
+ this.resolveConfig();
911
+ });
912
+ this.destroyRef.onDestroy(() => sub.unsubscribe());
907
913
  }
908
914
  resolveConfig() {
909
915
  const instanceId = this.explicitInstanceId || `mn-input-${this.props.id}`;
@@ -1372,6 +1378,8 @@ class MnTextarea {
1372
1378
  configService = inject(MnConfigService);
1373
1379
  sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];
1374
1380
  explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });
1381
+ lang = inject(MnLanguageService);
1382
+ destroyRef = inject(DestroyRef);
1375
1383
  /** Current raw string value of the textarea element */
1376
1384
  value = null;
1377
1385
  /** Whether the textarea is disabled */
@@ -1403,6 +1411,10 @@ class MnTextarea {
1403
1411
  }
1404
1412
  ngOnInit() {
1405
1413
  this.resolveConfig();
1414
+ const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {
1415
+ this.resolveConfig();
1416
+ });
1417
+ this.destroyRef.onDestroy(() => sub.unsubscribe());
1406
1418
  }
1407
1419
  resolveConfig() {
1408
1420
  const instanceId = this.explicitInstanceId || `mn-textarea-${this.props.id}`;
@@ -1607,6 +1619,8 @@ class MnCheckbox {
1607
1619
  configService = inject(MnConfigService);
1608
1620
  sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];
1609
1621
  explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });
1622
+ lang = inject(MnLanguageService);
1623
+ destroyRef = inject(DestroyRef);
1610
1624
  value = false;
1611
1625
  isDisabled = false;
1612
1626
  onChange = () => { };
@@ -1621,6 +1635,10 @@ class MnCheckbox {
1621
1635
  }
1622
1636
  ngOnInit() {
1623
1637
  this.resolveConfig();
1638
+ const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {
1639
+ this.resolveConfig();
1640
+ });
1641
+ this.destroyRef.onDestroy(() => sub.unsubscribe());
1624
1642
  }
1625
1643
  resolveConfig() {
1626
1644
  const instanceId = this.explicitInstanceId || `mn-checkbox-${this.props.id}`;
@@ -1766,6 +1784,8 @@ class MnDatetime {
1766
1784
  configService = inject(MnConfigService);
1767
1785
  sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];
1768
1786
  explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });
1787
+ lang = inject(MnLanguageService);
1788
+ destroyRef = inject(DestroyRef);
1769
1789
  value = null;
1770
1790
  isDisabled = false;
1771
1791
  onChange = () => { };
@@ -1782,6 +1802,10 @@ class MnDatetime {
1782
1802
  }
1783
1803
  ngOnInit() {
1784
1804
  this.resolveConfig();
1805
+ const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {
1806
+ this.resolveConfig();
1807
+ });
1808
+ this.destroyRef.onDestroy(() => sub.unsubscribe());
1785
1809
  }
1786
1810
  resolveConfig() {
1787
1811
  const instanceId = this.explicitInstanceId || `mn-datetime-${this.props.id}`;
@@ -1936,6 +1960,8 @@ class MnMultiSelect {
1936
1960
  sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];
1937
1961
  explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });
1938
1962
  elRef = inject(ElementRef);
1963
+ lang = inject(MnLanguageService);
1964
+ destroyRef = inject(DestroyRef);
1939
1965
  /** Currently selected values */
1940
1966
  selectedValues = [];
1941
1967
  isOpen = false;
@@ -1953,6 +1979,10 @@ class MnMultiSelect {
1953
1979
  }
1954
1980
  ngOnInit() {
1955
1981
  this.resolveConfig();
1982
+ const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {
1983
+ this.resolveConfig();
1984
+ });
1985
+ this.destroyRef.onDestroy(() => sub.unsubscribe());
1956
1986
  }
1957
1987
  resolveConfig() {
1958
1988
  const instanceId = this.explicitInstanceId || `mn-multi-select-${this.props.id}`;