@acorex/components 20.7.37 → 20.7.38

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,7 +1,8 @@
1
1
  import { AXEvent, MXInteractiveComponent, AXComponent, MXValueComponent, AXPagedComponent } from '@acorex/cdk/common';
2
- import { AXUnsubscriber, AXHtmlUtil } from '@acorex/core/utils';
2
+ import { AXLocaleService } from '@acorex/core/locale';
3
+ import { AXUnsubscriber } from '@acorex/core/utils';
3
4
  import * as i0 from '@angular/core';
4
- import { Injectable, inject, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, computed, afterNextRender, signal, EventEmitter, forwardRef, HostBinding, Output, NgModule } from '@angular/core';
5
+ import { Injectable, inject, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, signal, EventEmitter, forwardRef, HostBinding, Output, NgModule } from '@angular/core';
5
6
  import { AXDecoratorGenericComponent, AXDecoratorIconComponent, AXDecoratorModule } from '@acorex/components/decorators';
6
7
  import { AXTranslationService, AXTranslatorPipe, AXTranslationModule } from '@acorex/core/translation';
7
8
  import { AsyncPipe, NgClass, CommonModule } from '@angular/common';
@@ -9,7 +10,6 @@ import { AXNumberBoxComponent, AXNumberBoxModule } from '@acorex/components/numb
9
10
  import * as i1 from '@angular/forms';
10
11
  import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
11
12
  import { AXButtonComponent, AXButtonItemListComponent, AXButtonItemComponent, AXButtonModule } from '@acorex/components/button';
12
- import { AXLocaleService } from '@acorex/core/locale';
13
13
  import { AXDropdownPanelComponent, AXDropdownModule } from '@acorex/components/dropdown';
14
14
  import { isNumber, isEqual, cloneDeep } from 'lodash-es';
15
15
  import { AXButtonGroupModule } from '@acorex/components/button-group';
@@ -41,6 +41,7 @@ class AXDataPagerChild extends MXInteractiveComponent {
41
41
  super();
42
42
  this._parent = inject(AXDataPagerParentComponent);
43
43
  this._unsubscriber = inject(AXUnsubscriber);
44
+ this._localeService = inject(AXLocaleService);
44
45
  //
45
46
  this._parent.onChanged.pipe(this._unsubscriber.takeUntilDestroy).subscribe(async (c) => {
46
47
  await this.applyParent();
@@ -49,6 +50,10 @@ class AXDataPagerChild extends MXInteractiveComponent {
49
50
  this._parent.onOptionChanged.pipe(this._unsubscriber.takeUntilDestroy).subscribe(async (c) => {
50
51
  await this.applyParent();
51
52
  });
53
+ //
54
+ this._localeService.profileChanged$.pipe(this._unsubscriber.takeUntilDestroy).subscribe(() => {
55
+ void this.applyParent();
56
+ });
52
57
  }
53
58
  /**
54
59
  * @ignore
@@ -206,12 +211,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
206
211
  * @category Components
207
212
  */
208
213
  class AXDataPagerNextButtonsComponent extends AXDataPagerChild {
209
- /**
210
- * @ignore
211
- */
212
- ngOnInit() {
213
- super.ngOnInit;
214
- this.rtl = AXHtmlUtil.isRtl(this.getHostElement());
214
+ constructor() {
215
+ super(...arguments);
216
+ this.localeService = inject(AXLocaleService);
217
+ this.isRtl = this.localeService.isRtl;
215
218
  }
216
219
  /**
217
220
  * @ignore
@@ -251,8 +254,8 @@ class AXDataPagerNextButtonsComponent extends AXDataPagerChild {
251
254
  <ax-icon
252
255
  class="ax-icon ax-text-xl"
253
256
  [ngClass]="{
254
- 'ax-icon-chevron-left': rtl,
255
- 'ax-icon-chevron-right': !rtl,
257
+ 'ax-icon-chevron-left': isRtl(),
258
+ 'ax-icon-chevron-right': !isRtl(),
256
259
  }"
257
260
  ></ax-icon>
258
261
  </ax-button>
@@ -265,7 +268,7 @@ class AXDataPagerNextButtonsComponent extends AXDataPagerChild {
265
268
  >
266
269
  <ax-icon
267
270
  class="ax-icon ax-text-xl"
268
- [ngClass]="{ 'ax-icon-chevron-double-left': rtl, 'ax-icon-chevron-double-right': !rtl }"
271
+ [ngClass]="{ 'ax-icon-chevron-double-left': isRtl(), 'ax-icon-chevron-double-right': !isRtl() }"
269
272
  ></ax-icon>
270
273
  </ax-button>
271
274
  `, isInline: true, dependencies: [{ kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
@@ -285,8 +288,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
285
288
  <ax-icon
286
289
  class="ax-icon ax-text-xl"
287
290
  [ngClass]="{
288
- 'ax-icon-chevron-left': rtl,
289
- 'ax-icon-chevron-right': !rtl,
291
+ 'ax-icon-chevron-left': isRtl(),
292
+ 'ax-icon-chevron-right': !isRtl(),
290
293
  }"
291
294
  ></ax-icon>
292
295
  </ax-button>
@@ -299,7 +302,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
299
302
  >
300
303
  <ax-icon
301
304
  class="ax-icon ax-text-xl"
302
- [ngClass]="{ 'ax-icon-chevron-double-left': rtl, 'ax-icon-chevron-double-right': !rtl }"
305
+ [ngClass]="{ 'ax-icon-chevron-double-left': isRtl(), 'ax-icon-chevron-double-right': !isRtl() }"
303
306
  ></ax-icon>
304
307
  </ax-button>
305
308
  `,
@@ -320,28 +323,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
320
323
  * @category Components
321
324
  */
322
325
  class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
323
- /**
324
- * @ignore
325
- */
326
326
  constructor() {
327
- super();
327
+ super(...arguments);
328
328
  this._items = [];
329
329
  this._currentPage = 1;
330
330
  this._lastPage = 1;
331
331
  this._loading = false;
332
332
  this.localeService = inject(AXLocaleService);
333
- this.rtlstatus = computed(() => {
334
- // console.log(this.localeService.activeProfile().i18nMeta?.rtl ?? false);
335
- return this.localeService.activeProfile().i18nMeta?.rtl ?? false;
336
- }, ...(ngDevMode ? [{ debugName: "rtlstatus" }] : []));
333
+ this.isRtl = this.localeService.isRtl;
337
334
  /**
338
335
  * @ignore
339
336
  */
340
337
  this._displayCount = 5;
341
- afterNextRender(() => {
342
- this.rtl = AXHtmlUtil.isRtl(this.getHostElement());
343
- this.cdr.detectChanges();
344
- });
345
338
  }
346
339
  /**
347
340
  * @ignore
@@ -363,7 +356,7 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
363
356
  // Add ellipsis button for previous pages if needed
364
357
  if (start > 1) {
365
358
  this._items.push({
366
- iconClass: this.rtl ? 'ax-icon-chevron-right' : 'ax-icon-chevron-left',
359
+ iconClass: this.isRtl() ? 'ax-icon-chevron-right' : 'ax-icon-chevron-left',
367
360
  data: start - 1,
368
361
  });
369
362
  }
@@ -377,7 +370,7 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
377
370
  // Add ellipsis button for next pages if needed
378
371
  if (end < this._lastPage) {
379
372
  this._items.push({
380
- iconClass: this.rtl ? 'ax-icon-chevron-left' : 'ax-icon-chevron-right',
373
+ iconClass: this.isRtl() ? 'ax-icon-chevron-left' : 'ax-icon-chevron-right',
381
374
  data: end + 1,
382
375
  });
383
376
  }
@@ -397,8 +390,8 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
397
390
  // } else {
398
391
  // this._parent.goToPage(Number(e.data));
399
392
  // }
400
- const nextIcon = this.rtl ? 'ax-icon-chevron-left' : 'ax-icon-chevron-right';
401
- const prevIcon = this.rtl ? 'ax-icon-chevron-right' : 'ax-icon-chevron-left';
393
+ const nextIcon = this.isRtl() ? 'ax-icon-chevron-left' : 'ax-icon-chevron-right';
394
+ const prevIcon = this.isRtl() ? 'ax-icon-chevron-right' : 'ax-icon-chevron-left';
402
395
  if (e.iconClass === nextIcon) {
403
396
  this._parent.goNextPage();
404
397
  }
@@ -409,7 +402,7 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
409
402
  this._parent.goToPage(Number(e.data));
410
403
  }
411
404
  }
412
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXDataPagerNumericSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
405
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXDataPagerNumericSelectorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
413
406
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXDataPagerNumericSelectorComponent, isStandalone: true, selector: "ax-data-pager-numeric-selector", providers: [
414
407
  {
415
408
  provide: AXDataPagerChild,
@@ -427,8 +420,8 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
427
420
  <ax-icon
428
421
  class="ax-icon"
429
422
  [ngClass]="{
430
- 'ax-icon-chevron-double-left': !rtl,
431
- 'ax-icon-chevron-double-right': rtl,
423
+ 'ax-icon-chevron-double-left': !isRtl(),
424
+ 'ax-icon-chevron-double-right': isRtl(),
432
425
  }"
433
426
  ></ax-icon>
434
427
  </ax-button>
@@ -457,8 +450,8 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
457
450
  <ax-icon
458
451
  class="ax-icon"
459
452
  [ngClass]="{
460
- 'ax-icon-chevron-double-left': rtl,
461
- 'ax-icon-chevron-double-right': !rtl,
453
+ 'ax-icon-chevron-double-left': isRtl(),
454
+ 'ax-icon-chevron-double-right': !isRtl(),
462
455
  }"
463
456
  ></ax-icon>
464
457
  </ax-button>
@@ -478,8 +471,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
478
471
  <ax-icon
479
472
  class="ax-icon"
480
473
  [ngClass]="{
481
- 'ax-icon-chevron-double-left': !rtl,
482
- 'ax-icon-chevron-double-right': rtl,
474
+ 'ax-icon-chevron-double-left': !isRtl(),
475
+ 'ax-icon-chevron-double-right': isRtl(),
483
476
  }"
484
477
  ></ax-icon>
485
478
  </ax-button>
@@ -508,8 +501,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
508
501
  <ax-icon
509
502
  class="ax-icon"
510
503
  [ngClass]="{
511
- 'ax-icon-chevron-double-left': rtl,
512
- 'ax-icon-chevron-double-right': !rtl,
504
+ 'ax-icon-chevron-double-left': isRtl(),
505
+ 'ax-icon-chevron-double-right': !isRtl(),
513
506
  }"
514
507
  ></ax-icon>
515
508
  </ax-button>
@@ -526,7 +519,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
526
519
  ],
527
520
  imports: [AXButtonComponent, AXDecoratorIconComponent, NgClass],
528
521
  }]
529
- }], ctorParameters: () => [] });
522
+ }] });
530
523
 
531
524
  /**
532
525
  * Displays a button to select page sizes for data pagination.
@@ -649,12 +642,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
649
642
  * @category Components
650
643
  */
651
644
  class AXDataPagerPrevButtonsComponent extends AXDataPagerChild {
652
- /**
653
- * @ignore
654
- */
655
- ngOnInit() {
656
- super.ngOnInit;
657
- this.rtl = AXHtmlUtil.isRtl(this.getHostElement());
645
+ constructor() {
646
+ super(...arguments);
647
+ this.localeService = inject(AXLocaleService);
648
+ this.isRtl = this.localeService.isRtl;
658
649
  }
659
650
  /**
660
651
  * @ignore
@@ -693,7 +684,7 @@ class AXDataPagerPrevButtonsComponent extends AXDataPagerChild {
693
684
  >
694
685
  <ax-icon
695
686
  class="ax-icon ax-text-xl"
696
- [ngClass]="{ 'ax-icon-chevron-double-right': rtl, 'ax-icon-chevron-double-left': !rtl }"
687
+ [ngClass]="{ 'ax-icon-chevron-double-right': isRtl(), 'ax-icon-chevron-double-left': !isRtl() }"
697
688
  ></ax-icon>
698
689
  </ax-button>
699
690
  <ax-button
@@ -706,8 +697,8 @@ class AXDataPagerPrevButtonsComponent extends AXDataPagerChild {
706
697
  <ax-icon
707
698
  class="ax-icon ax-text-xl"
708
699
  [ngClass]="{
709
- 'ax-icon-chevron-left': !rtl,
710
- 'ax-icon-chevron-right': rtl,
700
+ 'ax-icon-chevron-left': !isRtl(),
701
+ 'ax-icon-chevron-right': isRtl(),
711
702
  }"
712
703
  ></ax-icon>
713
704
  </ax-button>
@@ -727,7 +718,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
727
718
  >
728
719
  <ax-icon
729
720
  class="ax-icon ax-text-xl"
730
- [ngClass]="{ 'ax-icon-chevron-double-right': rtl, 'ax-icon-chevron-double-left': !rtl }"
721
+ [ngClass]="{ 'ax-icon-chevron-double-right': isRtl(), 'ax-icon-chevron-double-left': !isRtl() }"
731
722
  ></ax-icon>
732
723
  </ax-button>
733
724
  <ax-button
@@ -740,8 +731,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
740
731
  <ax-icon
741
732
  class="ax-icon ax-text-xl"
742
733
  [ngClass]="{
743
- 'ax-icon-chevron-left': !rtl,
744
- 'ax-icon-chevron-right': rtl,
734
+ 'ax-icon-chevron-left': !isRtl(),
735
+ 'ax-icon-chevron-right': isRtl(),
745
736
  }"
746
737
  ></ax-icon>
747
738
  </ax-button>