@acorex/components 20.1.16 → 20.1.18

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.
@@ -9,10 +9,10 @@ import { AXNumberBoxComponent, AXNumberBoxModule } from '@acorex/components/numb
9
9
  import * as i1 from '@angular/forms';
10
10
  import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
11
11
  import { AXButtonComponent, AXButtonItemListComponent, AXButtonItemComponent, AXButtonModule } from '@acorex/components/button';
12
- import { AXSkeletonComponent, AXSkeletonModule } from '@acorex/components/skeleton';
13
12
  import { AXDropdownPanelComponent, AXDropdownModule } from '@acorex/components/dropdown';
14
13
  import { isNumber, isEqual, cloneDeep } from 'lodash-es';
15
14
  import { AXButtonGroupModule } from '@acorex/components/button-group';
15
+ import { AXSkeletonModule } from '@acorex/components/skeleton';
16
16
 
17
17
  class AXDataPagerChangedEvent extends AXEvent {
18
18
  constructor() {
@@ -77,7 +77,7 @@ class AXDataPagerInfoComponent extends AXDataPagerChild {
77
77
  */
78
78
  async applyParent() {
79
79
  const info = this._parent.displayInfo;
80
- if ([info.range, info.range.from, info.totalItems].every((c) => c)) {
80
+ if ([info.range, info.range.from, info.totalItems].every((c) => c != undefined)) {
81
81
  this._textFormatted = (await this.translateService.translateAsync(this.text ?? '@acorex:datapager.info.text'))
82
82
  .replace('[from]', info.range.from.toString())
83
83
  .replace('[to]', info.range.to.toString())
@@ -389,7 +389,7 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
389
389
  ], usesInheritance: true, ngImport: i0, template: `
390
390
  <ax-button
391
391
  class="ax-sm"
392
- [disabled]="_currentPage === 1 || _parent.disabled"
392
+ [disabled]="_currentPage === 1 || _parent.disabled || _parent.isLoading"
393
393
  look="blank"
394
394
  (onClick)="_handleOnItemClick({ data: 1 })"
395
395
  >
@@ -402,28 +402,24 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
402
402
  ></ax-icon>
403
403
  </ax-button>
404
404
 
405
- @if (!_parent.isLoading) {
406
- @for (item of _items; track $index) {
407
- <ax-button
408
- class="ax-data-pager-num-button"
409
- [disabled]="_parent.disabled"
410
- [color]="_currentPage === item.data ? 'primary' : 'default'"
411
- [look]="_currentPage === item.data ? 'solid' : 'blank'"
412
- [text]="item.text"
413
- (onClick)="_handleOnItemClick(item)"
414
- >
415
- @if (item.iconClass) {
416
- <ax-icon class="ax-icon" [ngClass]="item.iconClass"></ax-icon>
417
- }
418
- </ax-button>
419
- }
420
- } @else {
421
- <ax-skeleton></ax-skeleton>
405
+ @for (item of _items; track $index) {
406
+ <ax-button
407
+ class="ax-data-pager-num-button"
408
+ [disabled]="_parent.disabled || _parent.isLoading"
409
+ [color]="_currentPage === item.data ? 'primary' : 'default'"
410
+ [look]="_currentPage === item.data ? 'solid' : 'blank'"
411
+ [text]="item.text"
412
+ (onClick)="_handleOnItemClick(item)"
413
+ >
414
+ @if (item.iconClass) {
415
+ <ax-icon class="ax-icon" [ngClass]="item.iconClass"></ax-icon>
416
+ }
417
+ </ax-button>
422
418
  }
423
419
 
424
420
  <ax-button
425
421
  class="ax-sm"
426
- [disabled]="_currentPage === _lastPage || _parent.disabled"
422
+ [disabled]="_currentPage === _lastPage || _parent.disabled || _parent.isLoading"
427
423
  look="blank"
428
424
  (onClick)="_handleOnItemClick({ data: _lastPage })"
429
425
  >
@@ -435,7 +431,7 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
435
431
  }"
436
432
  ></ax-icon>
437
433
  </ax-button>
438
- `, 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"] }, { kind: "component", type: AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
434
+ `, 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 }); }
439
435
  }
440
436
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXDataPagerNumericSelectorComponent, decorators: [{
441
437
  type: Component,
@@ -444,7 +440,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
444
440
  template: `
445
441
  <ax-button
446
442
  class="ax-sm"
447
- [disabled]="_currentPage === 1 || _parent.disabled"
443
+ [disabled]="_currentPage === 1 || _parent.disabled || _parent.isLoading"
448
444
  look="blank"
449
445
  (onClick)="_handleOnItemClick({ data: 1 })"
450
446
  >
@@ -457,28 +453,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
457
453
  ></ax-icon>
458
454
  </ax-button>
459
455
 
460
- @if (!_parent.isLoading) {
461
- @for (item of _items; track $index) {
462
- <ax-button
463
- class="ax-data-pager-num-button"
464
- [disabled]="_parent.disabled"
465
- [color]="_currentPage === item.data ? 'primary' : 'default'"
466
- [look]="_currentPage === item.data ? 'solid' : 'blank'"
467
- [text]="item.text"
468
- (onClick)="_handleOnItemClick(item)"
469
- >
470
- @if (item.iconClass) {
471
- <ax-icon class="ax-icon" [ngClass]="item.iconClass"></ax-icon>
472
- }
473
- </ax-button>
474
- }
475
- } @else {
476
- <ax-skeleton></ax-skeleton>
456
+ @for (item of _items; track $index) {
457
+ <ax-button
458
+ class="ax-data-pager-num-button"
459
+ [disabled]="_parent.disabled || _parent.isLoading"
460
+ [color]="_currentPage === item.data ? 'primary' : 'default'"
461
+ [look]="_currentPage === item.data ? 'solid' : 'blank'"
462
+ [text]="item.text"
463
+ (onClick)="_handleOnItemClick(item)"
464
+ >
465
+ @if (item.iconClass) {
466
+ <ax-icon class="ax-icon" [ngClass]="item.iconClass"></ax-icon>
467
+ }
468
+ </ax-button>
477
469
  }
478
470
 
479
471
  <ax-button
480
472
  class="ax-sm"
481
- [disabled]="_currentPage === _lastPage || _parent.disabled"
473
+ [disabled]="_currentPage === _lastPage || _parent.disabled || _parent.isLoading"
482
474
  look="blank"
483
475
  (onClick)="_handleOnItemClick({ data: _lastPage })"
484
476
  >
@@ -501,7 +493,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
501
493
  AXUnsubscriber,
502
494
  { provide: AXComponent, useExisting: AXDataPagerNumericSelectorComponent },
503
495
  ],
504
- imports: [AXButtonComponent, AXDecoratorIconComponent, NgClass, AXSkeletonComponent],
496
+ imports: [AXButtonComponent, AXDecoratorIconComponent, NgClass],
505
497
  }]
506
498
  }], ctorParameters: () => [] });
507
499
 
@@ -918,7 +910,7 @@ class AXDataPagerComponent extends MXValueComponent {
918
910
  * @ignore
919
911
  */
920
912
  _emitChangedEvent(u = false) {
921
- this.totalPages = Math.ceil(this._total / this.size);
913
+ this.totalPages = Math.ceil(this._total / this.size) || 1;
922
914
  //
923
915
  if (!isEqual(this.previousDisplayInfo, this.displayInfo)) {
924
916
  this.onChanged.emit(Object.assign({