@gipisistemas/ngx-core 1.0.17 → 1.0.19

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.
@@ -66,7 +66,6 @@
66
66
  align-items: center;
67
67
  justify-content: center;
68
68
  padding: 0.6rem 1.2rem;
69
- max-width: 10rem;
70
69
  border-radius: 0.4rem;
71
70
  font-family: $font-family;
72
71
  font-size: $font-size;
@@ -32,7 +32,7 @@
32
32
  height: 100%;
33
33
  box-sizing: border-box;
34
34
  padding: 1.6rem;
35
- background-color: transparent;
35
+ background-color: #{utils.get-color($theme, white, 100)};
36
36
  transition: transform 0.2s ease;
37
37
  z-index: 4;
38
38
 
@@ -41,7 +41,7 @@ import * as i3 from '@angular/material/input';
41
41
  import { MatInputModule } from '@angular/material/input';
42
42
  import { NgxMaskDirective, provideNgxMask } from 'ngx-mask';
43
43
  import * as i1$7 from '@angular/material/paginator';
44
- import { MatPaginatorModule, MatPaginatorIntl, MatPaginator } from '@angular/material/paginator';
44
+ import { MatPaginatorIntl, MatPaginatorModule, MatPaginator } from '@angular/material/paginator';
45
45
  import { GlobalWorkerOptions, getDocument, OPS } from 'pdfjs-dist';
46
46
  import { EventBus, PDFLinkService, PDFViewer } from 'pdfjs-dist/web/pdf_viewer.mjs';
47
47
  import { __decorate } from 'tslib';
@@ -1170,12 +1170,12 @@ class ConfirmDialog {
1170
1170
  mat-dialog-content
1171
1171
  class="g-confirm-dialog-content"
1172
1172
  >
1173
- @if (dialogData.message && !dialogData.listMessage) {
1173
+ @if (!!dialogData.message) {
1174
1174
  <p class="g-confirm-dialog-message">
1175
1175
  {{ dialogData.message }}
1176
1176
  </p>
1177
1177
  }
1178
- @if (!dialogData.message && dialogData.listMessage) {
1178
+ @if (!!dialogData.listMessage) {
1179
1179
  <ul class="g-confirm-dialog-list-message">
1180
1180
  @for (message of dialogData.listMessage; track $index) {
1181
1181
  <li>{{ message }}</li>
@@ -1230,12 +1230,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
1230
1230
  mat-dialog-content
1231
1231
  class="g-confirm-dialog-content"
1232
1232
  >
1233
- @if (dialogData.message && !dialogData.listMessage) {
1233
+ @if (!!dialogData.message) {
1234
1234
  <p class="g-confirm-dialog-message">
1235
1235
  {{ dialogData.message }}
1236
1236
  </p>
1237
1237
  }
1238
- @if (!dialogData.message && dialogData.listMessage) {
1238
+ @if (!!dialogData.listMessage) {
1239
1239
  <ul class="g-confirm-dialog-list-message">
1240
1240
  @for (message of dialogData.listMessage; track $index) {
1241
1241
  <li>{{ message }}</li>
@@ -4007,11 +4007,9 @@ class BaseService {
4007
4007
  const direction = 'direction' in value
4008
4008
  ? (value.direction ?? 'ASC')
4009
4009
  : 'ASC';
4010
- paramValue = `${value.field},${direction.toUpperCase()}`;
4011
- params.set(key, paramValue);
4010
+ params.set(key, `${value.field},${direction.toUpperCase()}`);
4012
4011
  }
4013
4012
  else if (Array.isArray(value)) {
4014
- paramValue = '';
4015
4013
  for (const item of value) {
4016
4014
  if (typeof item === 'object' && 'field' in item) {
4017
4015
  const direction = 'direction' in item
@@ -4020,15 +4018,22 @@ class BaseService {
4020
4018
  params.append('sort', `${item.field},${direction.toUpperCase()}`);
4021
4019
  }
4022
4020
  }
4021
+ continue;
4023
4022
  }
4024
4023
  }
4025
- else {
4026
- if (typeof value === 'object') {
4027
- paramValue = JSON.stringify(value);
4028
- }
4029
- else {
4030
- paramValue = String(value).trim();
4024
+ else if (Array.isArray(value)) {
4025
+ for (const item of value) {
4026
+ if (item !== null && item !== undefined) {
4027
+ params.append(key, String(item));
4028
+ }
4031
4029
  }
4030
+ continue;
4031
+ }
4032
+ else if (typeof value === 'object') {
4033
+ paramValue = JSON.stringify(value);
4034
+ }
4035
+ else {
4036
+ paramValue = String(value).trim();
4032
4037
  }
4033
4038
  if (key !== 'sort') {
4034
4039
  params.set(key, paramValue);
@@ -5255,6 +5260,12 @@ class BaseListComponent extends BaseComponent {
5255
5260
  return (!ArrayUtil.isEmpty(this.appliedFilters) &&
5256
5261
  this.appliedFilters().findIndex((e) => e.key === key) >= 0);
5257
5262
  }
5263
+ hasAnyAvailableAction(actions, canExecuteAction) {
5264
+ if (ArrayUtil.isEmpty(actions)) {
5265
+ return false;
5266
+ }
5267
+ return actions.some((action) => canExecuteAction(action));
5268
+ }
5258
5269
  /**
5259
5270
  * Método chamado quando o componente é inicializado.
5260
5271
  * - Chamado no OnInit
@@ -5912,6 +5923,7 @@ class BaseModel {
5912
5923
  this.id = data?.id ?? null;
5913
5924
  this.integrationIdentifier = data?.integrationIdentifier ?? null;
5914
5925
  this.companyId = data?.companyId ?? null;
5926
+ this.tenantId = data?.tenantId ?? null;
5915
5927
  this.enabled = data?.enabled ?? true;
5916
5928
  this.createdDate = data?.createdDate ?? null;
5917
5929
  this.modifiedDate = data?.modifiedDate ?? null;
@@ -10729,6 +10741,20 @@ class DatePickerCalendar {
10729
10741
  this.yearRangeStart.set(Math.floor(this.currentYear() / YEARS_DISPLAYED) * YEARS_DISPLAYED);
10730
10742
  }
10731
10743
  }
10744
+ navigatePrevious() {
10745
+ if (this.showMonthYearPicker() && this.monthYearPickerView() === 'year') {
10746
+ this.previousYearRange();
10747
+ return;
10748
+ }
10749
+ this.previousMonth();
10750
+ }
10751
+ navigateNext() {
10752
+ if (this.showMonthYearPicker() && this.monthYearPickerView() === 'year') {
10753
+ this.nextYearRange();
10754
+ return;
10755
+ }
10756
+ this.nextMonth();
10757
+ }
10732
10758
  previousMonth() {
10733
10759
  if (this.currentMonth() === 0) {
10734
10760
  this.currentMonth.set(11);
@@ -11838,24 +11864,26 @@ class DatePickerCalendar {
11838
11864
 
11839
11865
  <div class="g-navigation-buttons">
11840
11866
  <button
11841
- aria-label="Mês anterior"
11867
+ [attr.aria-label]="
11868
+ showMonthYearPicker() && monthYearPickerView() === 'year'
11869
+ ? 'Anos anteriores'
11870
+ : 'Mês anterior'
11871
+ "
11842
11872
  type="button"
11843
11873
  class="g-nav-button"
11844
- (click)="
11845
- monthYearPickerView() === 'year'
11846
- ? previousYearRange()
11847
- : previousMonth()
11848
- "
11874
+ (click)="navigatePrevious()"
11849
11875
  >
11850
11876
  <span class="material-symbols-rounded">chevron_left</span>
11851
11877
  </button>
11852
11878
  <button
11853
- aria-label="Próximo mês"
11879
+ [attr.aria-label]="
11880
+ showMonthYearPicker() && monthYearPickerView() === 'year'
11881
+ ? 'Próximos anos'
11882
+ : 'Próximo mês'
11883
+ "
11854
11884
  type="button"
11855
11885
  class="g-nav-button"
11856
- (click)="
11857
- monthYearPickerView() === 'year' ? nextYearRange() : nextMonth()
11858
- "
11886
+ (click)="navigateNext()"
11859
11887
  >
11860
11888
  <span class="material-symbols-rounded">chevron_right</span>
11861
11889
  </button>
@@ -12438,24 +12466,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
12438
12466
 
12439
12467
  <div class="g-navigation-buttons">
12440
12468
  <button
12441
- aria-label="Mês anterior"
12469
+ [attr.aria-label]="
12470
+ showMonthYearPicker() && monthYearPickerView() === 'year'
12471
+ ? 'Anos anteriores'
12472
+ : 'Mês anterior'
12473
+ "
12442
12474
  type="button"
12443
12475
  class="g-nav-button"
12444
- (click)="
12445
- monthYearPickerView() === 'year'
12446
- ? previousYearRange()
12447
- : previousMonth()
12448
- "
12476
+ (click)="navigatePrevious()"
12449
12477
  >
12450
12478
  <span class="material-symbols-rounded">chevron_left</span>
12451
12479
  </button>
12452
12480
  <button
12453
- aria-label="Próximo mês"
12481
+ [attr.aria-label]="
12482
+ showMonthYearPicker() && monthYearPickerView() === 'year'
12483
+ ? 'Próximos anos'
12484
+ : 'Próximo mês'
12485
+ "
12454
12486
  type="button"
12455
12487
  class="g-nav-button"
12456
- (click)="
12457
- monthYearPickerView() === 'year' ? nextYearRange() : nextMonth()
12458
- "
12488
+ (click)="navigateNext()"
12459
12489
  >
12460
12490
  <span class="material-symbols-rounded">chevron_right</span>
12461
12491
  </button>
@@ -17442,9 +17472,12 @@ class InputPhone extends BaseControlValueAccessor {
17442
17472
  this._uniqueId = inject(_IdGenerator).getId('gipi-input-phone-');
17443
17473
  this._controlId = inject(_IdGenerator).getId('gipi-input-phone-control-');
17444
17474
  this._inputElementRef = viewChild('inputElement', ...(ngDevMode ? [{ debugName: "_inputElementRef" }] : []));
17475
+ this._syncResetHandle = null;
17445
17476
  this.prefixRef = contentChild('prefix', ...(ngDevMode ? [{ debugName: "prefixRef" }] : []));
17446
17477
  this.suffixRef = contentChild('suffix', ...(ngDevMode ? [{ debugName: "suffixRef" }] : []));
17447
17478
  this.ngControl = viewChild(NgControl, ...(ngDevMode ? [{ debugName: "ngControl" }] : []));
17479
+ this._isSynchronizingViewValue = signal(false, ...(ngDevMode ? [{ debugName: "_isSynchronizingViewValue" }] : []));
17480
+ this.displayValue = signal('', ...(ngDevMode ? [{ debugName: "displayValue" }] : []));
17448
17481
  this.isInputFocused = signal(false, ...(ngDevMode ? [{ debugName: "isInputFocused" }] : []));
17449
17482
  this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
17450
17483
  this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
@@ -17464,21 +17497,43 @@ class InputPhone extends BaseControlValueAccessor {
17464
17497
  this.phoneMask = signal('0*', ...(ngDevMode ? [{ debugName: "phoneMask" }] : []));
17465
17498
  }
17466
17499
  writeControlValue(value, setModelValue) {
17467
- const newValue = value || '';
17468
- this.value.set(newValue);
17469
- this._updatePhoneMask(newValue);
17470
- if (setModelValue) {
17471
- setModelValue(newValue);
17472
- }
17500
+ const newValue = this._normalizeModelValue(value || '');
17501
+ this._synchronizeViewValue(() => {
17502
+ if (setModelValue) {
17503
+ setModelValue(newValue);
17504
+ }
17505
+ else {
17506
+ this.value.set(newValue);
17507
+ }
17508
+ this._applyViewValue(newValue);
17509
+ });
17473
17510
  }
17474
17511
  onInputChange(value) {
17475
- if (this.$disabled()) {
17512
+ if (this.$disabled() || this._isSynchronizingViewValue()) {
17476
17513
  return;
17477
17514
  }
17478
- this._updatePhoneMask(value);
17479
- this.notifyValueChange(value);
17515
+ const modelValue = this._normalizeModelValue(value);
17516
+ this.displayValue.set(value || '');
17517
+ this._updatePhoneMask(modelValue);
17518
+ this.notifyValueChange(modelValue);
17480
17519
  this.markAsTouched();
17481
17520
  }
17521
+ _synchronizeViewValue(syncFn) {
17522
+ // O ngx-mask pode ecoar um ngModelChange apos writeValue/mudancas de mascara.
17523
+ this._isSynchronizingViewValue.set(true);
17524
+ if (this._syncResetHandle !== null) {
17525
+ clearTimeout(this._syncResetHandle);
17526
+ }
17527
+ try {
17528
+ syncFn();
17529
+ }
17530
+ finally {
17531
+ this._syncResetHandle = setTimeout(() => {
17532
+ this._isSynchronizingViewValue.set(false);
17533
+ this._syncResetHandle = null;
17534
+ });
17535
+ }
17536
+ }
17482
17537
  _updatePhoneMask(value) {
17483
17538
  if (this.foreign()) {
17484
17539
  this.phoneMask.set('0*');
@@ -17494,6 +17549,22 @@ class InputPhone extends BaseControlValueAccessor {
17494
17549
  this.phoneMask.set(mask);
17495
17550
  }
17496
17551
  }
17552
+ _applyViewValue(value) {
17553
+ this.displayValue.set(this._formatDisplayValue(value));
17554
+ this._updatePhoneMask(value);
17555
+ }
17556
+ _formatDisplayValue(value) {
17557
+ if (StringUtil.isEmpty(value) || this.foreign() || this.isInputFocused()) {
17558
+ return value;
17559
+ }
17560
+ return PhoneUtil.format(value);
17561
+ }
17562
+ _normalizeModelValue(value) {
17563
+ if (StringUtil.isEmpty(value) || this.foreign()) {
17564
+ return value || '';
17565
+ }
17566
+ return PhoneUtil.removeCharacters(value);
17567
+ }
17497
17568
  onInputKeydown(event) {
17498
17569
  if (this.readonly() || this.$disabled()) {
17499
17570
  return;
@@ -17507,7 +17578,7 @@ class InputPhone extends BaseControlValueAccessor {
17507
17578
  this.isInputFocused.set(true);
17508
17579
  // Para telefones nacionais, simplifica a máscara durante o foco
17509
17580
  if (!this.foreign()) {
17510
- this.phoneMask.set('0*');
17581
+ this._synchronizeViewValue(() => this._applyViewValue(this.value()));
17511
17582
  }
17512
17583
  this.onFocusEvent.emit(event);
17513
17584
  }
@@ -17518,15 +17589,7 @@ class InputPhone extends BaseControlValueAccessor {
17518
17589
  this.isInputFocused.set(false);
17519
17590
  // Para telefones nacionais, formata o número ao sair do campo
17520
17591
  if (!this.foreign()) {
17521
- const currentValue = this.value();
17522
- if (!StringUtil.isEmpty(currentValue)) {
17523
- const formattedValue = PhoneUtil.format(currentValue);
17524
- if (formattedValue !== currentValue) {
17525
- this.value.set(formattedValue);
17526
- this.notifyValueChange(formattedValue);
17527
- }
17528
- this._updatePhoneMask(formattedValue);
17529
- }
17592
+ this._synchronizeViewValue(() => this._applyViewValue(this.value()));
17530
17593
  }
17531
17594
  this.onBlurEvent.emit(event);
17532
17595
  this.markAsTouched();
@@ -17535,22 +17598,19 @@ class InputPhone extends BaseControlValueAccessor {
17535
17598
  if (this.$disabled() || !this._inputElementRef()?.nativeElement) {
17536
17599
  return;
17537
17600
  }
17538
- setTimeout(() => {
17539
- this._inputElementRef()?.nativeElement?.focus(options);
17540
- });
17601
+ setTimeout(() => this._inputElementRef()?.nativeElement?.focus(options));
17541
17602
  }
17542
17603
  select() {
17543
17604
  if (this.$disabled() || !this._inputElementRef()?.nativeElement) {
17544
17605
  return;
17545
17606
  }
17546
- setTimeout(() => {
17547
- this._inputElementRef()?.nativeElement?.select();
17548
- });
17607
+ setTimeout(() => this._inputElementRef()?.nativeElement?.select());
17549
17608
  }
17550
17609
  clear() {
17551
17610
  if (this.$disabled()) {
17552
17611
  return;
17553
17612
  }
17613
+ this.displayValue.set('');
17554
17614
  this.phoneMask.set('0*');
17555
17615
  this.notifyValueChange('');
17556
17616
  }
@@ -17589,7 +17649,7 @@ class InputPhone extends BaseControlValueAccessor {
17589
17649
  [disabled]="$disabled()"
17590
17650
  [readonly]="readonly()"
17591
17651
  [required]="required()"
17592
- [ngModel]="value()"
17652
+ [ngModel]="displayValue()"
17593
17653
  (ngModelChange)="onInputChange($event)"
17594
17654
  (keydown)="onInputKeydown($event)"
17595
17655
  (focus)="onInputFocus($event)"
@@ -17647,7 +17707,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
17647
17707
  [disabled]="$disabled()"
17648
17708
  [readonly]="readonly()"
17649
17709
  [required]="required()"
17650
- [ngModel]="value()"
17710
+ [ngModel]="displayValue()"
17651
17711
  (ngModelChange)="onInputChange($event)"
17652
17712
  (keydown)="onInputKeydown($event)"
17653
17713
  (focus)="onInputFocus($event)"
@@ -17767,63 +17827,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
17767
17827
  }]
17768
17828
  }] });
17769
17829
 
17830
+ const portugueseRangeLabel = (page, pageSize, length) => {
17831
+ if (length === 0 || pageSize === 0) {
17832
+ return `0 de ${length}`;
17833
+ }
17834
+ length = Math.max(length, 0);
17835
+ const startIndex = page * pageSize;
17836
+ // Se o índice inicial exceder o comprimento da lista, não tente fixar o índice final no final.
17837
+ const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
17838
+ return `${startIndex + 1} - ${endIndex} de ${length}`;
17839
+ };
17840
+ const PAGINATOR_INTL_PT_BR = () => {
17841
+ const paginatorIntl = new MatPaginatorIntl();
17842
+ paginatorIntl.itemsPerPageLabel = 'Itens por página';
17843
+ paginatorIntl.nextPageLabel = 'Próxima página';
17844
+ paginatorIntl.previousPageLabel = 'Página anterior';
17845
+ paginatorIntl.getRangeLabel = portugueseRangeLabel;
17846
+ paginatorIntl.firstPageLabel = 'Primeira página';
17847
+ paginatorIntl.lastPageLabel = 'Última página';
17848
+ return paginatorIntl;
17849
+ };
17850
+ // eslint-disable-next-line @typescript-eslint/naming-convention
17851
+ const PaginatorIntlToken = new InjectionToken('PAGINATOR_INTL_TOKEN', {
17852
+ factory: () => PAGINATOR_INTL_PT_BR(),
17853
+ });
17854
+ function providePaginatorIntl(config) {
17855
+ return {
17856
+ provide: PaginatorIntlToken,
17857
+ useValue: config ?? PAGINATOR_INTL_PT_BR(),
17858
+ };
17859
+ }
17860
+
17770
17861
  class Paginator {
17771
17862
  constructor() {
17772
17863
  this._uniqueId = inject(_IdGenerator).getId('gipi-paginator-');
17773
- this.currentPage = signal(0, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
17774
- this.currentPageSize = signal(0, ...(ngDevMode ? [{ debugName: "currentPageSize" }] : []));
17775
17864
  this.id = input(this._uniqueId, ...(ngDevMode ? [{ debugName: "id" }] : []));
17776
17865
  this.name = input(this._uniqueId, ...(ngDevMode ? [{ debugName: "name" }] : []));
17777
17866
  this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
17778
17867
  this.hidePageSize = input(false, ...(ngDevMode ? [{ debugName: "hidePageSize", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
17779
17868
  this.length = input(0, ...(ngDevMode ? [{ debugName: "length", transform: numberAttribute }] : [{ transform: numberAttribute }]));
17780
- this.pageNumber = input(0, ...(ngDevMode ? [{ debugName: "pageNumber", transform: numberAttribute }] : [{ transform: numberAttribute }]));
17781
- this.pageSize = input(0, ...(ngDevMode ? [{ debugName: "pageSize", transform: numberAttribute }] : [{ transform: numberAttribute }]));
17782
17869
  this.pageSizeOptions = input([10, 20, 30], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
17870
+ this.pageNumber = model(0, ...(ngDevMode ? [{ debugName: "pageNumber" }] : []));
17871
+ this.pageSize = model(0, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
17783
17872
  this.onPage = output();
17784
- this.currentPage.set(this.pageNumber());
17785
- this.currentPageSize.set(this.pageSize());
17786
17873
  }
17787
17874
  onHandlePage(pageEvent) {
17788
17875
  if (!pageEvent) {
17789
17876
  return;
17790
17877
  }
17791
- this.currentPage.set(pageEvent.pageIndex);
17792
- this.currentPageSize.set(pageEvent.pageSize);
17878
+ this.pageNumber.set(pageEvent.pageIndex);
17879
+ this.pageSize.set(pageEvent.pageSize);
17793
17880
  this.onPage.emit(pageEvent);
17794
17881
  }
17795
17882
  setPage(pageIndex) {
17796
- this.currentPage.set(pageIndex);
17883
+ this.pageNumber.set(pageIndex);
17797
17884
  }
17798
17885
  setPageSize(pageSize) {
17799
- this.currentPageSize.set(pageSize);
17886
+ this.pageSize.set(pageSize);
17800
17887
  }
17801
17888
  nextPage() {
17802
- this.currentPage.update((page) => page + 1);
17889
+ this.pageNumber.update((page) => page + 1);
17803
17890
  }
17804
17891
  previousPage() {
17805
- this.currentPage.update((page) => Math.max(0, page - 1));
17892
+ this.pageNumber.update((page) => Math.max(0, page - 1));
17806
17893
  }
17807
17894
  firstPage() {
17808
- this.currentPage.set(0);
17895
+ this.pageNumber.set(0);
17809
17896
  }
17810
17897
  lastPage() {
17811
- const totalPages = Math.ceil(this.length() / this.currentPageSize());
17812
- this.currentPage.set(Math.max(0, totalPages - 1));
17898
+ const totalPages = Math.ceil(this.length() / this.pageSize());
17899
+ this.pageNumber.set(Math.max(0, totalPages - 1));
17813
17900
  }
17814
17901
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: Paginator, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
17815
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.16", type: Paginator, isStandalone: true, selector: "gipi-paginator", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, hidePageSize: { classPropertyName: "hidePageSize", publicName: "hidePageSize", isSignal: true, isRequired: false, transformFunction: null }, length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, pageNumber: { classPropertyName: "pageNumber", publicName: "pageNumber", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onPage: "onPage" }, host: { properties: { "attr.id": "id()", "attr.name": "name()" }, classAttribute: "g-paginator" }, exportAs: ["gPaginator"], ngImport: i0, template: `
17902
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.16", type: Paginator, isStandalone: true, selector: "gipi-paginator", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, hidePageSize: { classPropertyName: "hidePageSize", publicName: "hidePageSize", isSignal: true, isRequired: false, transformFunction: null }, length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, pageNumber: { classPropertyName: "pageNumber", publicName: "pageNumber", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageNumber: "pageNumberChange", pageSize: "pageSizeChange", onPage: "onPage" }, host: { properties: { "attr.id": "id()", "attr.name": "name()" }, classAttribute: "g-paginator" }, providers: [
17903
+ {
17904
+ provide: MatPaginatorIntl,
17905
+ useFactory: () => inject(PaginatorIntlToken),
17906
+ },
17907
+ ], exportAs: ["gPaginator"], ngImport: i0, template: `
17816
17908
  <mat-paginator
17817
17909
  class="g-paginator-control"
17818
17910
  [disabled]="disabled()"
17819
17911
  [hidePageSize]="hidePageSize()"
17820
17912
  [length]="length()"
17821
- [pageIndex]="currentPage()"
17822
- [pageSize]="currentPageSize()"
17913
+ [pageIndex]="pageNumber()"
17914
+ [pageSize]="pageSize()"
17823
17915
  [pageSizeOptions]="pageSizeOptions()"
17824
17916
  [selectConfig]="{}"
17825
17917
  [showFirstLastButtons]="true"
17826
- (page)="onHandlePage($event)" />
17918
+ (page)="onHandlePage($event)"
17919
+ />
17827
17920
  `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i1$7.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
17828
17921
  }
17829
17922
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: Paginator, decorators: [{
@@ -17834,18 +17927,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
17834
17927
  [disabled]="disabled()"
17835
17928
  [hidePageSize]="hidePageSize()"
17836
17929
  [length]="length()"
17837
- [pageIndex]="currentPage()"
17838
- [pageSize]="currentPageSize()"
17930
+ [pageIndex]="pageNumber()"
17931
+ [pageSize]="pageSize()"
17839
17932
  [pageSizeOptions]="pageSizeOptions()"
17840
17933
  [selectConfig]="{}"
17841
17934
  [showFirstLastButtons]="true"
17842
- (page)="onHandlePage($event)" />
17935
+ (page)="onHandlePage($event)"
17936
+ />
17843
17937
  `, changeDetection: ChangeDetectionStrategy.OnPush, host: {
17844
17938
  '[attr.id]': 'id()',
17845
17939
  '[attr.name]': 'name()',
17846
17940
  class: 'g-paginator',
17847
- }, imports: [MatPaginatorModule] }]
17848
- }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], hidePageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidePageSize", required: false }] }], length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], pageNumber: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageNumber", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], onPage: [{ type: i0.Output, args: ["onPage"] }] } });
17941
+ }, providers: [
17942
+ {
17943
+ provide: MatPaginatorIntl,
17944
+ useFactory: () => inject(PaginatorIntlToken),
17945
+ },
17946
+ ], imports: [MatPaginatorModule] }]
17947
+ }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], hidePageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidePageSize", required: false }] }], length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], pageNumber: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageNumber", required: false }] }, { type: i0.Output, args: ["pageNumberChange"] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], onPage: [{ type: i0.Output, args: ["onPage"] }] } });
17849
17948
  class PaginatorModule {
17850
17949
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PaginatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
17851
17950
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: PaginatorModule, imports: [Paginator], exports: [Paginator] }); }
@@ -20783,37 +20882,6 @@ function Debounce(options = 300) {
20783
20882
  };
20784
20883
  }
20785
20884
 
20786
- const portugueseRangeLabel = (page, pageSize, length) => {
20787
- if (length === 0 || pageSize === 0) {
20788
- return `0 de ${length}`;
20789
- }
20790
- length = Math.max(length, 0);
20791
- const startIndex = page * pageSize;
20792
- // Se o índice inicial exceder o comprimento da lista, não tente fixar o índice final no final.
20793
- const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
20794
- return `${startIndex + 1} - ${endIndex} de ${length}`;
20795
- };
20796
- const PAGINATOR_INTL_PT_BR = () => {
20797
- const paginatorIntl = new MatPaginatorIntl();
20798
- paginatorIntl.itemsPerPageLabel = 'Itens por página';
20799
- paginatorIntl.nextPageLabel = 'Próxima página';
20800
- paginatorIntl.previousPageLabel = 'Página anterior';
20801
- paginatorIntl.getRangeLabel = portugueseRangeLabel;
20802
- paginatorIntl.firstPageLabel = 'Primeira página';
20803
- paginatorIntl.lastPageLabel = 'Última página';
20804
- return paginatorIntl;
20805
- };
20806
- // eslint-disable-next-line @typescript-eslint/naming-convention
20807
- const PaginatorIntlToken = new InjectionToken('PAGINATOR_INTL_TOKEN', {
20808
- factory: () => PAGINATOR_INTL_PT_BR(),
20809
- });
20810
- function providePaginatorIntl(config) {
20811
- return {
20812
- provide: PaginatorIntlToken,
20813
- useValue: config ?? PAGINATOR_INTL_PT_BR(),
20814
- };
20815
- }
20816
-
20817
20885
  class TextEllipsisDirective {
20818
20886
  constructor() {
20819
20887
  this._elementRef = inject(ElementRef);