@gipisistemas/ngx-core 1.0.18 → 1.0.20

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
 
@@ -18,6 +18,7 @@ import * as libPhone from 'libphonenumber-js';
18
18
  import * as i2 from '@angular/material/icon';
19
19
  import { MatIconModule, MatIconRegistry } from '@angular/material/icon';
20
20
  import { HttpClient, HttpHeaders, HttpParams, HttpErrorResponse } from '@angular/common/http';
21
+ import { SelectionModel } from '@angular/cdk/collections';
21
22
  import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
22
23
  import * as i1$4 from '@angular/forms';
23
24
  import { NG_VALUE_ACCESSOR, FormsModule, NgControl } from '@angular/forms';
@@ -45,7 +46,6 @@ import { MatPaginatorIntl, MatPaginatorModule, MatPaginator } from '@angular/mat
45
46
  import { GlobalWorkerOptions, getDocument, OPS } from 'pdfjs-dist';
46
47
  import { EventBus, PDFLinkService, PDFViewer } from 'pdfjs-dist/web/pdf_viewer.mjs';
47
48
  import { __decorate } from 'tslib';
48
- import { SelectionModel } from '@angular/cdk/collections';
49
49
  import * as i2$4 from '@angular/cdk/table';
50
50
  import { CdkTableModule } from '@angular/cdk/table';
51
51
  import { MatCheckboxModule } from '@angular/material/checkbox';
@@ -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>
@@ -5174,6 +5174,9 @@ function useFilterPersistence(config) {
5174
5174
  }
5175
5175
 
5176
5176
  class BaseListComponent extends BaseComponent {
5177
+ get idsSelectedEntities() {
5178
+ return this.selectedEntities.selected.map((entity) => entity.id);
5179
+ }
5177
5180
  constructor(service) {
5178
5181
  super();
5179
5182
  this.service = service;
@@ -5181,6 +5184,7 @@ class BaseListComponent extends BaseComponent {
5181
5184
  this.pageAdjustService = inject(PageAdjustService);
5182
5185
  this._isHydrating = signal(true, ...(ngDevMode ? [{ debugName: "_isHydrating" }] : []));
5183
5186
  this._persistTimer = null;
5187
+ this.selectedEntities = new SelectionModel(true, []);
5184
5188
  this.filter = signal(this.newFilter(), ...(ngDevMode ? [{ debugName: "filter" }] : []));
5185
5189
  this.page = signal(this.newPage(), ...(ngDevMode ? [{ debugName: "page" }] : []));
5186
5190
  this.tableColumns = signal([], ...(ngDevMode ? [{ debugName: "tableColumns" }] : []));
@@ -5643,18 +5647,11 @@ class BaseListComponent extends BaseComponent {
5643
5647
  this.findAll();
5644
5648
  }
5645
5649
  handleEntityId(id) {
5646
- if (!UUIDUtil.isValid(id)) {
5650
+ if (!UUIDUtil.isEmpty(id) && !UUIDUtil.isValid(id) && this.selectedEntities.isEmpty()) {
5647
5651
  throw new Error('O identificador do registro não é válido');
5648
5652
  }
5649
- const page = this.page();
5650
- if (ObjectUtil.isEmpty(id) &&
5651
- !ObjectUtil.isEmpty(page) &&
5652
- !ArrayUtil.isEmpty(page.content)) {
5653
- const firstSeletected = page.content.filter((c) => c.selected)[0];
5654
- if (ObjectUtil.isEmpty(firstSeletected)) {
5655
- return null;
5656
- }
5657
- return firstSeletected.id;
5653
+ if (UUIDUtil.isEmpty(id) && !ArrayUtil.isEmpty(this.page()?.content)) {
5654
+ return this.idsSelectedEntities[0] ?? null;
5658
5655
  }
5659
5656
  return id;
5660
5657
  }
@@ -5666,14 +5663,8 @@ class BaseListComponent extends BaseComponent {
5666
5663
  }
5667
5664
  }
5668
5665
  }
5669
- const page = this.page();
5670
- if (ArrayUtil.isEmpty(idList) &&
5671
- !ObjectUtil.isEmpty(page) &&
5672
- !ArrayUtil.isEmpty(page.content)) {
5673
- const listSelected = page.content
5674
- .filter((p) => p.selected)
5675
- .map((p) => p.id);
5676
- return listSelected;
5666
+ if (ArrayUtil.isEmpty(idList) && !ArrayUtil.isEmpty(this.page()?.content)) {
5667
+ return this.idsSelectedEntities;
5677
5668
  }
5678
5669
  return !ArrayUtil.isEmpty(idList) ? idList : [];
5679
5670
  }
@@ -5923,10 +5914,10 @@ class BaseModel {
5923
5914
  this.id = data?.id ?? null;
5924
5915
  this.integrationIdentifier = data?.integrationIdentifier ?? null;
5925
5916
  this.companyId = data?.companyId ?? null;
5917
+ this.tenantId = data?.tenantId ?? null;
5926
5918
  this.enabled = data?.enabled ?? true;
5927
5919
  this.createdDate = data?.createdDate ?? null;
5928
5920
  this.modifiedDate = data?.modifiedDate ?? null;
5929
- this.selected = data?.selected ?? false;
5930
5921
  }
5931
5922
  }
5932
5923