@fundamental-ngx/core 0.64.2-rc.48 → 0.64.2-rc.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,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Attribute, Directive, inject, Injectable, EventEmitter, effect, ElementRef, ViewChild, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, signal, input, computed, DestroyRef, Inject, model, forwardRef, HostListener, HostBinding, Optional, NgModule } from '@angular/core';
2
+ import { Attribute, Directive, inject, Injectable, EventEmitter, ElementRef, ViewChild, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, signal, input, computed, DestroyRef, Inject, model, effect, forwardRef, HostListener, HostBinding, Optional, NgModule } from '@angular/core';
3
3
  import { resolveTranslationSignal, FdTranslatePipe, resolveTranslationSignalFn, FD_LANGUAGE_ENGLISH, FD_LANGUAGE_SIGNAL } from '@fundamental-ngx/i18n';
4
+ import { RtlService, onLocaleChange, FocusableListDirective, FocusableItemDirective } from '@fundamental-ngx/cdk/utils';
4
5
  import * as i2 from '@fundamental-ngx/core/datetime';
5
6
  import { DATE_TIME_FORMATS } from '@fundamental-ngx/core/datetime';
6
7
  import { ButtonComponent } from '@fundamental-ngx/core/button';
7
8
  import { Subject } from 'rxjs';
8
- import { RtlService, FocusableListDirective, FocusableItemDirective } from '@fundamental-ngx/cdk/utils';
9
9
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
10
  import { NgClass } from '@angular/common';
11
11
  import { shallowEqual } from 'fast-equals';
@@ -316,15 +316,10 @@ class CalendarHeaderComponent {
316
316
  this._monthNames = [];
317
317
  /** Get information about amount of years displayed at once on year view */
318
318
  this._amountOfYearsPerPeriod = 1;
319
- /** @hidden */
320
- this._initiated = false;
321
- effect(() => {
322
- this._dateTimeAdapter.locale();
323
- if (this._initiated) {
324
- this._calculateMonthNames();
325
- this._calculateLabels();
326
- this._changeDetRef.markForCheck();
327
- }
319
+ onLocaleChange(this._dateTimeAdapter, () => {
320
+ this._calculateMonthNames();
321
+ this._calculateLabels();
322
+ this._changeDetRef.markForCheck();
328
323
  });
329
324
  }
330
325
  /** @hidden */
@@ -336,7 +331,6 @@ class CalendarHeaderComponent {
336
331
  }
337
332
  /** @hidden */
338
333
  ngOnInit() {
339
- this._initiated = true;
340
334
  this._calendarService.leftArrowId = this._prevButtonId;
341
335
  this._calculateMonthNames();
342
336
  this._calculateLabels();
@@ -725,12 +719,9 @@ class CalendarAggregatedYearViewComponent {
725
719
  this._initiated = false;
726
720
  // default values
727
721
  this._currentYear = _dateTimeAdapter.getYear(_dateTimeAdapter.today());
728
- effect(() => {
729
- this._dateTimeAdapter.locale();
730
- if (this._initiated) {
731
- this._constructYearsGrid();
732
- this._changeDetectorRef.markForCheck();
733
- }
722
+ onLocaleChange(this._dateTimeAdapter, () => {
723
+ this._constructYearsGrid();
724
+ this._changeDetectorRef.markForCheck();
734
725
  });
735
726
  }
736
727
  /** @hidden */
@@ -1219,13 +1210,10 @@ class CalendarDayViewComponent {
1219
1210
  }
1220
1211
  });
1221
1212
  // Effect to react to locale changes
1222
- effect(() => {
1223
- this._dateTimeAdapter.locale();
1224
- if (this._isInitiated) {
1225
- this._refreshShortWeekDays();
1226
- this._buildDayViewGrid();
1227
- this.changeDetRef.markForCheck();
1228
- }
1213
+ onLocaleChange(this._dateTimeAdapter, () => {
1214
+ this._refreshShortWeekDays();
1215
+ this._buildDayViewGrid();
1216
+ this.changeDetRef.markForCheck();
1229
1217
  });
1230
1218
  }
1231
1219
  /** @hidden */
@@ -2343,12 +2331,9 @@ class CalendarMonthViewComponent {
2343
2331
  /** @hidden */
2344
2332
  this._initiated = false;
2345
2333
  this._isOnRangePick = false;
2346
- effect(() => {
2347
- this._dateTimeAdapter.locale();
2348
- if (this._initiated) {
2349
- this._constructMonthGrid();
2350
- this._changeDetectorRef.markForCheck();
2351
- }
2334
+ onLocaleChange(this._dateTimeAdapter, () => {
2335
+ this._constructMonthGrid();
2336
+ this._changeDetectorRef.markForCheck();
2352
2337
  });
2353
2338
  }
2354
2339
  /** @hidden */
@@ -2759,12 +2744,9 @@ class CalendarYearViewComponent {
2759
2744
  // default values
2760
2745
  this._currentYear = _dateTimeAdapter.getYear(_dateTimeAdapter.today());
2761
2746
  this._firstYearInList = this._currentYear;
2762
- effect(() => {
2763
- this._dateTimeAdapter.locale();
2764
- if (this._initiated) {
2765
- this._constructYearGrid();
2766
- this._changeDetectorRef.markForCheck();
2767
- }
2747
+ onLocaleChange(this._dateTimeAdapter, () => {
2748
+ this._constructYearGrid();
2749
+ this._changeDetectorRef.markForCheck();
2768
2750
  });
2769
2751
  }
2770
2752
  /** @hidden */
@@ -3385,8 +3367,7 @@ class CalendarComponent {
3385
3367
  this._adapterStartingDayOfWeek = (this._dateTimeAdapter.getFirstDayOfWeek() + 1);
3386
3368
  this.selectedDate = this._dateTimeAdapter.today();
3387
3369
  this._changeDetectorRef.markForCheck();
3388
- effect(() => {
3389
- this._dateTimeAdapter.locale();
3370
+ onLocaleChange(this._dateTimeAdapter, () => {
3390
3371
  this._adapterStartingDayOfWeek = (this._dateTimeAdapter.getFirstDayOfWeek() + 1);
3391
3372
  this._changeDetectorRef.markForCheck();
3392
3373
  });