@sankhyalabs/ezui 1.1.151 → 1.1.154

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.
Files changed (34) hide show
  1. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  2. package/dist/cjs/ez-grid.cjs.entry.js +83 -22
  3. package/dist/cjs/ez-view-stack.cjs.entry.js +6 -0
  4. package/dist/cjs/ezui.cjs.js +1 -1
  5. package/dist/cjs/grid-config.cjs.entry.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/ez-dialog/ez-dialog.css +1 -1
  8. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +15 -2
  9. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +63 -19
  10. package/dist/collection/components/ez-grid/controller/ag-grid/template/HeaderColumnTemplate.js +6 -2
  11. package/dist/collection/components/ez-grid/ez-grid.js +7 -6
  12. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +1 -1
  13. package/dist/collection/components/ez-view-stack/ez-view-stack.js +22 -0
  14. package/dist/custom-elements/index.js +92 -25
  15. package/dist/esm/ez-dialog.entry.js +1 -1
  16. package/dist/esm/ez-grid.entry.js +84 -23
  17. package/dist/esm/ez-view-stack.entry.js +6 -0
  18. package/dist/esm/ezui.js +1 -1
  19. package/dist/esm/grid-config.entry.js +1 -1
  20. package/dist/esm/loader.js +1 -1
  21. package/dist/ezui/ezui.esm.js +1 -1
  22. package/dist/ezui/p-4f2e5cf4.entry.js +1 -0
  23. package/dist/ezui/p-905688e6.entry.js +1 -0
  24. package/dist/ezui/{p-298ff75d.entry.js → p-addedd7d.entry.js} +11 -11
  25. package/dist/ezui/{p-33cb1991.entry.js → p-ec7b7e26.entry.js} +1 -1
  26. package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +1 -0
  27. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +8 -4
  28. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +6 -2
  29. package/dist/types/components/ez-grid/ez-grid.d.ts +2 -2
  30. package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +4 -0
  31. package/dist/types/components.d.ts +6 -2
  32. package/package.json +1 -1
  33. package/dist/ezui/p-517d7759.entry.js +0 -1
  34. package/dist/ezui/p-793a28cc.entry.js +0 -1
@@ -1,11 +1,11 @@
1
1
  import { Grid as EnterpriseGrid, LicenseManager } from "ag-grid-enterprise";
2
2
  import { Grid } from "ag-grid-community";
3
3
  import gridTerms from "./i18n/pt-BR.js";
4
- import HeaderColumnTemplate from "./template/HeaderColumnTemplate.js";
4
+ import getHeaderColumnTemplate from "./template/HeaderColumnTemplate.js";
5
5
  import DataSource from "./DataSource";
6
6
  import { ApplicationContext, DataType } from "@sankhyalabs/core";
7
7
  import { SortMode, UserInterface } from "@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";
8
- import { NumberUtils } from "@sankhyalabs/core";
8
+ import { NumberUtils, StringUtils } from "@sankhyalabs/core";
9
9
  export default class AgGridController {
10
10
  constructor(enterprise) {
11
11
  this.DEFAULT_ROW_HEIGHT = 25;
@@ -82,6 +82,9 @@ export default class AgGridController {
82
82
  else {
83
83
  this._grid = new Grid(container, this._gridOptions);
84
84
  }
85
+ this._lastPageStatus = this.getPaginationStatus();
86
+ //Atualiza estado da seleção inicial
87
+ this.onSelectionChange();
85
88
  }
86
89
  }
87
90
  setOptionsEvents(opt) {
@@ -90,7 +93,7 @@ export default class AgGridController {
90
93
  opt.onColumnPinned = e => this.onCallStateChange("columnPinned", e);
91
94
  opt.onColumnMoved = e => this.onCallStateChange("columnMoved", e);
92
95
  opt.onColumnVisible = e => this.onCallStateChange("visibleChange", e);
93
- opt.onSelectionChanged = e => this.onSelectionChange(e);
96
+ opt.onSelectionChanged = () => this.onSelectionChange();
94
97
  opt.onPaginationChanged = () => this.onPaginationChange();
95
98
  opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
96
99
  opt.onDragStopped = evt => this.onCallStateChange("columnMovedEnd", evt);
@@ -117,11 +120,28 @@ export default class AgGridController {
117
120
  }
118
121
  this._gridOptions.api.setRowData(data);
119
122
  }
120
- addRows() {
123
+ addRows(rows) {
121
124
  if (this._grid === undefined) {
122
125
  throw new Error("Erro interno: Grid ainda não inicializado.");
123
126
  }
124
- this._gridOptions.api.refreshServerSideStore({});
127
+ if (rows.length > 0) {
128
+ this._gridOptions.api.applyServerSideTransaction({
129
+ addIndex: 0,
130
+ add: rows
131
+ });
132
+ this.syncSelection();
133
+ }
134
+ }
135
+ updateRows(rows) {
136
+ if (this._grid === undefined) {
137
+ throw new Error("Erro interno: Grid ainda não inicializado.");
138
+ }
139
+ if (rows.length > 0) {
140
+ rows.forEach(row => {
141
+ this.changeValues(row, [row[this._idAttribName]]);
142
+ });
143
+ this.syncSelection();
144
+ }
125
145
  }
126
146
  selectRows(rowIds) {
127
147
  if (this._grid === undefined) {
@@ -254,6 +274,9 @@ export default class AgGridController {
254
274
  this.conditionalSet(colState, "width", s.width);
255
275
  this.conditionalSet(colState, "pinned", s.pinned !== null);
256
276
  this.conditionalSet(colState, "hidden", s.hide);
277
+ const props = new Map();
278
+ props.set('sortable', def.sortable);
279
+ this.conditionalSet(colState, "props", props);
257
280
  return colState;
258
281
  }).filter(c => c.name !== "__SELECTION__");
259
282
  }
@@ -264,9 +287,11 @@ export default class AgGridController {
264
287
  this._menuItems.push(item);
265
288
  }
266
289
  nextPage() {
290
+ this._lastPageStatus = this.getPaginationStatus();
267
291
  this._gridOptions.api.paginationGoToNextPage();
268
292
  }
269
293
  previousPage() {
294
+ this._lastPageStatus = this.getPaginationStatus();
270
295
  this._gridOptions.api.paginationGoToPreviousPage();
271
296
  }
272
297
  goToPage(page) {
@@ -316,9 +341,8 @@ export default class AgGridController {
316
341
  }
317
342
  }
318
343
  }
319
- setSelectedIndex(index) {
320
- var _a;
321
- (_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
344
+ selectFirstRow() {
345
+ this._dataUnit.selectFirst();
322
346
  }
323
347
  hasPreviousRecord() {
324
348
  const pagination = this.getPaginationStatus();
@@ -349,14 +373,29 @@ export default class AgGridController {
349
373
  }
350
374
  }
351
375
  }
376
+ selectLastRow() {
377
+ this._dataUnit.selectLast();
378
+ }
379
+ setSelectedIndex(index) {
380
+ var _a;
381
+ (_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
382
+ }
352
383
  buildColDef(source) {
384
+ let tooltip = undefined;
385
+ const propSortable = StringUtils.getBooleanValue(source.props.get("gridSortable"), true);
386
+ if (source.props.get("gridHeaderTooltip")) {
387
+ tooltip = source.props.get("gridHeaderTooltip");
388
+ }
389
+ else if (propSortable === false) {
390
+ tooltip = "Coluna não pode ser ordenada";
391
+ }
353
392
  return {
354
393
  headerName: source.label,
355
394
  field: source.name,
356
- sortable: true,
395
+ sortable: propSortable,
357
396
  resizable: true,
358
397
  headerComponentParams: {
359
- template: HeaderColumnTemplate
398
+ template: getHeaderColumnTemplate(tooltip)
360
399
  },
361
400
  valueFormatter: params => {
362
401
  return this.getFormatterByColumn(params, source);
@@ -392,17 +431,17 @@ export default class AgGridController {
392
431
  }
393
432
  }
394
433
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.SEARCH) {
395
- if (params.value !== undefined) {
434
+ if (params.value != undefined) {
396
435
  return ((_a = params === null || params === void 0 ? void 0 : params.value) === null || _a === void 0 ? void 0 : _a.value) + " - " + ((_b = params === null || params === void 0 ? void 0 : params.value) === null || _b === void 0 ? void 0 : _b.label);
397
436
  }
398
437
  }
399
438
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.DECIMALNUMBER) {
400
- if (params.value !== undefined) {
439
+ if (params.value != undefined) {
401
440
  return NumberUtils.format(params.value.toString(), 2, 2);
402
441
  }
403
442
  }
404
443
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.DATE || (source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.DATETIME) {
405
- if (params.value !== undefined) {
444
+ if (params.value != undefined) {
406
445
  return params.value.toLocaleDateString();
407
446
  }
408
447
  }
@@ -429,25 +468,30 @@ export default class AgGridController {
429
468
  }
430
469
  return false;
431
470
  }
432
- onSelectionChange(e) {
433
- const selectedNodes = e.api.getSelectedNodes();
471
+ onSelectionChange() {
472
+ const selectedNodes = this._gridOptions.api.getSelectedNodes();
434
473
  if (selectedNodes.length > 0) {
435
- this._isFirstRecordOfPage = selectedNodes[0].rowIndex === e.api.getFirstDisplayedRow();
436
- this._isLastRecordOfPage = selectedNodes[0].rowIndex === e.api.getLastDisplayedRow();
474
+ this._isFirstRecordOfPage = selectedNodes[0].rowIndex === this._gridOptions.api.getFirstDisplayedRow();
475
+ this._isLastRecordOfPage = selectedNodes[0].rowIndex === this._gridOptions.api.getLastDisplayedRow();
437
476
  }
438
477
  if (this._selectionChangeCallback) {
439
478
  this._selectionChangeCallback({
440
- selection: e.api.getSelectedRows(),
479
+ selection: this._gridOptions.api.getSelectedRows(),
441
480
  isFirstOfPage: this._isFirstRecordOfPage,
442
481
  isLastOfPage: this._isLastRecordOfPage
443
482
  });
444
483
  }
445
484
  }
446
485
  onPaginationChange() {
486
+ var _a, _b;
487
+ const currentPageStatus = this.getPaginationStatus();
488
+ if (((_a = this._lastPageStatus) === null || _a === void 0 ? void 0 : _a.currentPage) != (currentPageStatus === null || currentPageStatus === void 0 ? void 0 : currentPageStatus.currentPage)) {
489
+ ((_b = this._lastPageStatus) === null || _b === void 0 ? void 0 : _b.currentPage) < (currentPageStatus === null || currentPageStatus === void 0 ? void 0 : currentPageStatus.currentPage) ? this.selectFirstRow() : this.selectLastRow();
490
+ }
447
491
  this.syncSelection();
448
492
  if (this._paginationChangeCallback) {
449
493
  if (this._gridOptions.api) {
450
- this._paginationChangeCallback(this.getPaginationStatus());
494
+ this._paginationChangeCallback(currentPageStatus);
451
495
  }
452
496
  }
453
497
  }
@@ -1,4 +1,4 @@
1
- const HeaderColumnTemplate = `<div class="ag-cell-label-container" role="presentation">
1
+ const HeaderColumnTemplate = `<div class="ag-cell-label-container" role="presentation" title="{{HEADER_TITLE}}">
2
2
  <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
3
3
  <div ref="eLabel" class="ag-header-cell-label" role="presentation" unselectable="on">
4
4
  <span ref="eText" class="ag-header-cell-text" unselectable="on"></span>
@@ -9,4 +9,8 @@ const HeaderColumnTemplate = `<div class="ag-cell-label-container" role="present
9
9
  </div>
10
10
  </div>`;
11
11
 
12
- export default HeaderColumnTemplate;
12
+ function getHeaderColumnTemplate(headerTooltip = "") {
13
+ return HeaderColumnTemplate.replaceAll("{{HEADER_TITLE}}", headerTooltip)
14
+ }
15
+
16
+ export default getHeaderColumnTemplate;
@@ -137,7 +137,7 @@ export class EzGrid {
137
137
  componentWillLoad() {
138
138
  if (this.dataUnit) {
139
139
  this._dataUnitBridge = new DataUnitBridge(this._gridController, this.dataUnit);
140
- addEventListener("ezSelectionChange", (evt) => this.dataUnit.setSelection(evt.detail.map((r) => r.__record__id__)));
140
+ addEventListener("ezSelectionChange", (evt) => this.dataUnit.setSelection(evt.detail.selection.map((r) => r.__record__id__)));
141
141
  }
142
142
  }
143
143
  onColumnStateChange(type, state, info) {
@@ -206,7 +206,7 @@ export class EzGrid {
206
206
  componentDidLoad() {
207
207
  this._gridController.initDatagrid(this._container, {
208
208
  onColumnStateChange: (type, state, info) => this.onColumnStateChange(type, state, info),
209
- onSelectionChange: (state) => this.ezSelectionChange.emit(state.selection),
209
+ onSelectionChange: (state) => this.ezSelectionChange.emit(state),
210
210
  onPaginationChange: (status) => {
211
211
  this._navigationHasPrevious = status.hasPrevious;
212
212
  this._navigationHasNext = status.hasNext;
@@ -411,11 +411,12 @@ export class EzGrid {
411
411
  "text": "Evento disparado ao selecionar linhas da grade."
412
412
  },
413
413
  "complexType": {
414
- "original": "Array<any>",
415
- "resolved": "any[]",
414
+ "original": "EzGridSelectionStatus",
415
+ "resolved": "EzGridSelectionStatus",
416
416
  "references": {
417
- "Array": {
418
- "location": "global"
417
+ "EzGridSelectionStatus": {
418
+ "location": "import",
419
+ "path": "./controller/EzGridController"
419
420
  }
420
421
  }
421
422
  }
@@ -13,7 +13,7 @@ export class GridConfig {
13
13
  /* Creation Methods */
14
14
  createOrderList() {
15
15
  let newList = [];
16
- this.columns.forEach(column => {
16
+ this.columns.filter(col => { var _a; return StringUtils.getBooleanValue((_a = col === null || col === void 0 ? void 0 : col.props) === null || _a === void 0 ? void 0 : _a.get("sortable"), true); }).forEach(column => {
17
17
  var _a;
18
18
  let configItem = (_a = this.config) === null || _a === void 0 ? void 0 : _a.columns.find(item => item.name === column.name);
19
19
  let item = { name: column.name, label: column.label };
@@ -10,6 +10,12 @@ export class EzViewStack {
10
10
  this._focusedIndex = index;
11
11
  }
12
12
  }
13
+ /**
14
+ * Retorna o index que est� atualmente ativo e sendo exibido.
15
+ */
16
+ async getSelectedIndex() {
17
+ return this._focusedIndex;
18
+ }
13
19
  policyHideRemove() {
14
20
  let element = this._hostElem.querySelector(`#el_${this._focusedIndex}`);
15
21
  this.checkElementVisibility(element);
@@ -81,6 +87,22 @@ export class EzViewStack {
81
87
  "text": "Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.",
82
88
  "tags": []
83
89
  }
90
+ },
91
+ "getSelectedIndex": {
92
+ "complexType": {
93
+ "signature": "() => Promise<number>",
94
+ "parameters": [],
95
+ "references": {
96
+ "Promise": {
97
+ "location": "global"
98
+ }
99
+ },
100
+ "return": "Promise<number>"
101
+ },
102
+ "docs": {
103
+ "text": "Retorna o index que est\uFFFD atualmente ativo e sendo exibido.",
104
+ "tags": []
105
+ }
84
106
  }
85
107
  }; }
86
108
  static get elementRef() { return "_hostElem"; }
@@ -1,6 +1,6 @@
1
1
  import { HTMLElement as HTMLElement$1, createEvent, h, forceUpdate, Host, proxyCustomElement } from '@stencil/core/internal/client';
2
2
  export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
3
- import { FloatingManager, DateUtils, TimeFormatter, UserInterface, Action, WaitingChangeException, ApplicationContext, DataUnitAction, DataUnit, NumberUtils, DataType, StringUtils, MaskFormatter } from '@sankhyalabs/core';
3
+ import { FloatingManager, DateUtils, TimeFormatter, UserInterface, Action, WaitingChangeException, ApplicationContext, DataUnitAction, DataUnit, StringUtils, NumberUtils, DataType, MaskFormatter } from '@sankhyalabs/core';
4
4
  import { UserInterface as UserInterface$1, SortMode } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
5
5
 
6
6
  const ezApplicationCss = "";
@@ -1167,7 +1167,7 @@ let EzDateTimeInput$1 = class extends HTMLElement$1 {
1167
1167
  static get style() { return ezDateTimeInputCss; }
1168
1168
  };
1169
1169
 
1170
- const ezDialogCss = ":host{--dialog__container-padding:var(--space--large, 24px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--dialog__title--font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--dialog__body--text-shadow:var(--text-shadow, \"0 0 0 #353535, 0 0 1px transparent\");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--large, 24px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog-z-index:var(--most-visible, 3);--dialog--warning__image:url('data: image/svg+xml;utf8,<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895\"/></svg>');--dialog--critical__image:url('data: image/svg+xml;utf8,<svg width=\"13\" height=\"13\" viewBox=\"0 0 13 13\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z\"/></svg>')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:24px;overflow-y:auto}.changeable__icon{background:var(--dialog__warning--background-color);--ez-icon--color:var(--dialog__icon--color);display:grid;place-items:center;width:26px;height:26px;border-radius:50%}.changeable__icon.critical{background:var(--dialog__critical--background-color)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);line-height:1.3}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title--label{padding-left:var(--dialog__title--padding-left)}.title-icon{outline:none;border:none;background-color:var(--dialog__warning--background-color);width:26px;height:26px;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center}.title-icon--critical{background-color:var(--dialog__critical--background-color)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:'';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.title-icon--critical::after{content:'';display:flex;background-color:#FFFF;width:13px;height:13px;-webkit-mask-image:var(--dialog--critical__image);mask-image:var(--dialog--critical__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
1170
+ const ezDialogCss = ":host{--dialog__container-padding:var(--space--large, 24px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--dialog__title--font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--dialog__body--text-shadow:var(--text-shadow, \"0 0 0 #353535, 0 0 1px transparent\");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--large, 24px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog-z-index:var(--most-visible, 3);--dialog--warning__image:url('data: image/svg+xml;utf8,<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895\"/></svg>');--dialog--critical__image:url('data: image/svg+xml;utf8,<svg width=\"13\" height=\"13\" viewBox=\"0 0 13 13\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z\"/></svg>')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:24px;overflow-y:auto}.changeable__icon{background:var(--dialog__warning--background-color);--ez-icon--color:var(--dialog__icon--color);display:grid;place-items:center;width:26px;height:26px;border-radius:50%}.changeable__icon.critical{background:var(--dialog__critical--background-color)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);line-height:0}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title--label{padding-left:var(--dialog__title--padding-left)}.title-icon{outline:none;border:none;background-color:var(--dialog__warning--background-color);width:26px;height:26px;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center}.title-icon--critical{background-color:var(--dialog__critical--background-color)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:'';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.title-icon--critical::after{content:'';display:flex;background-color:#FFFF;width:13px;height:13px;-webkit-mask-image:var(--dialog--critical__image);mask-image:var(--dialog--critical__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
1171
1171
 
1172
1172
  class Message {
1173
1173
  constructor(title, message, critical, confirm, icon, labelCancel, labelConfirm, btnConfirmDanger, callBack) {
@@ -112211,7 +112211,7 @@ const gridTerms = {
112211
112211
  ctrlV: "Ctrl+V"
112212
112212
  };
112213
112213
 
112214
- const HeaderColumnTemplate = `<div class="ag-cell-label-container" role="presentation">
112214
+ const HeaderColumnTemplate = `<div class="ag-cell-label-container" role="presentation" title="{{HEADER_TITLE}}">
112215
112215
  <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
112216
112216
  <div ref="eLabel" class="ag-header-cell-label" role="presentation" unselectable="on">
112217
112217
  <span ref="eText" class="ag-header-cell-text" unselectable="on"></span>
@@ -112222,6 +112222,10 @@ const HeaderColumnTemplate = `<div class="ag-cell-label-container" role="present
112222
112222
  </div>
112223
112223
  </div>`;
112224
112224
 
112225
+ function getHeaderColumnTemplate(headerTooltip = "") {
112226
+ return HeaderColumnTemplate.replaceAll("{{HEADER_TITLE}}", headerTooltip)
112227
+ }
112228
+
112225
112229
  class Server {
112226
112230
  constructor(data) {
112227
112231
  this._data = data;
@@ -112412,6 +112416,9 @@ class AgGridController {
112412
112416
  else {
112413
112417
  this._grid = new agGridCommunity_cjs.Grid(container, this._gridOptions);
112414
112418
  }
112419
+ this._lastPageStatus = this.getPaginationStatus();
112420
+ //Atualiza estado da seleção inicial
112421
+ this.onSelectionChange();
112415
112422
  }
112416
112423
  }
112417
112424
  setOptionsEvents(opt) {
@@ -112420,7 +112427,7 @@ class AgGridController {
112420
112427
  opt.onColumnPinned = e => this.onCallStateChange("columnPinned", e);
112421
112428
  opt.onColumnMoved = e => this.onCallStateChange("columnMoved", e);
112422
112429
  opt.onColumnVisible = e => this.onCallStateChange("visibleChange", e);
112423
- opt.onSelectionChanged = e => this.onSelectionChange(e);
112430
+ opt.onSelectionChanged = () => this.onSelectionChange();
112424
112431
  opt.onPaginationChanged = () => this.onPaginationChange();
112425
112432
  opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
112426
112433
  opt.onDragStopped = evt => this.onCallStateChange("columnMovedEnd", evt);
@@ -112447,11 +112454,28 @@ class AgGridController {
112447
112454
  }
112448
112455
  this._gridOptions.api.setRowData(data);
112449
112456
  }
112450
- addRows() {
112457
+ addRows(rows) {
112458
+ if (this._grid === undefined) {
112459
+ throw new Error("Erro interno: Grid ainda não inicializado.");
112460
+ }
112461
+ if (rows.length > 0) {
112462
+ this._gridOptions.api.applyServerSideTransaction({
112463
+ addIndex: 0,
112464
+ add: rows
112465
+ });
112466
+ this.syncSelection();
112467
+ }
112468
+ }
112469
+ updateRows(rows) {
112451
112470
  if (this._grid === undefined) {
112452
112471
  throw new Error("Erro interno: Grid ainda não inicializado.");
112453
112472
  }
112454
- this._gridOptions.api.refreshServerSideStore({});
112473
+ if (rows.length > 0) {
112474
+ rows.forEach(row => {
112475
+ this.changeValues(row, [row[this._idAttribName]]);
112476
+ });
112477
+ this.syncSelection();
112478
+ }
112455
112479
  }
112456
112480
  selectRows(rowIds) {
112457
112481
  if (this._grid === undefined) {
@@ -112584,6 +112608,9 @@ class AgGridController {
112584
112608
  this.conditionalSet(colState, "width", s.width);
112585
112609
  this.conditionalSet(colState, "pinned", s.pinned !== null);
112586
112610
  this.conditionalSet(colState, "hidden", s.hide);
112611
+ const props = new Map();
112612
+ props.set('sortable', def.sortable);
112613
+ this.conditionalSet(colState, "props", props);
112587
112614
  return colState;
112588
112615
  }).filter(c => c.name !== "__SELECTION__");
112589
112616
  }
@@ -112594,9 +112621,11 @@ class AgGridController {
112594
112621
  this._menuItems.push(item);
112595
112622
  }
112596
112623
  nextPage() {
112624
+ this._lastPageStatus = this.getPaginationStatus();
112597
112625
  this._gridOptions.api.paginationGoToNextPage();
112598
112626
  }
112599
112627
  previousPage() {
112628
+ this._lastPageStatus = this.getPaginationStatus();
112600
112629
  this._gridOptions.api.paginationGoToPreviousPage();
112601
112630
  }
112602
112631
  goToPage(page) {
@@ -112646,9 +112675,8 @@ class AgGridController {
112646
112675
  }
112647
112676
  }
112648
112677
  }
112649
- setSelectedIndex(index) {
112650
- var _a;
112651
- (_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
112678
+ selectFirstRow() {
112679
+ this._dataUnit.selectFirst();
112652
112680
  }
112653
112681
  hasPreviousRecord() {
112654
112682
  const pagination = this.getPaginationStatus();
@@ -112679,14 +112707,29 @@ class AgGridController {
112679
112707
  }
112680
112708
  }
112681
112709
  }
112710
+ selectLastRow() {
112711
+ this._dataUnit.selectLast();
112712
+ }
112713
+ setSelectedIndex(index) {
112714
+ var _a;
112715
+ (_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
112716
+ }
112682
112717
  buildColDef(source) {
112718
+ let tooltip = undefined;
112719
+ const propSortable = StringUtils.getBooleanValue(source.props.get("gridSortable"), true);
112720
+ if (source.props.get("gridHeaderTooltip")) {
112721
+ tooltip = source.props.get("gridHeaderTooltip");
112722
+ }
112723
+ else if (propSortable === false) {
112724
+ tooltip = "Coluna não pode ser ordenada";
112725
+ }
112683
112726
  return {
112684
112727
  headerName: source.label,
112685
112728
  field: source.name,
112686
- sortable: true,
112729
+ sortable: propSortable,
112687
112730
  resizable: true,
112688
112731
  headerComponentParams: {
112689
- template: HeaderColumnTemplate
112732
+ template: getHeaderColumnTemplate(tooltip)
112690
112733
  },
112691
112734
  valueFormatter: params => {
112692
112735
  return this.getFormatterByColumn(params, source);
@@ -112722,17 +112765,17 @@ class AgGridController {
112722
112765
  }
112723
112766
  }
112724
112767
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.SEARCH) {
112725
- if (params.value !== undefined) {
112768
+ if (params.value != undefined) {
112726
112769
  return ((_a = params === null || params === void 0 ? void 0 : params.value) === null || _a === void 0 ? void 0 : _a.value) + " - " + ((_b = params === null || params === void 0 ? void 0 : params.value) === null || _b === void 0 ? void 0 : _b.label);
112727
112770
  }
112728
112771
  }
112729
112772
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.DECIMALNUMBER) {
112730
- if (params.value !== undefined) {
112773
+ if (params.value != undefined) {
112731
112774
  return NumberUtils.format(params.value.toString(), 2, 2);
112732
112775
  }
112733
112776
  }
112734
112777
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.DATE || (source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.DATETIME) {
112735
- if (params.value !== undefined) {
112778
+ if (params.value != undefined) {
112736
112779
  return params.value.toLocaleDateString();
112737
112780
  }
112738
112781
  }
@@ -112759,25 +112802,30 @@ class AgGridController {
112759
112802
  }
112760
112803
  return false;
112761
112804
  }
112762
- onSelectionChange(e) {
112763
- const selectedNodes = e.api.getSelectedNodes();
112805
+ onSelectionChange() {
112806
+ const selectedNodes = this._gridOptions.api.getSelectedNodes();
112764
112807
  if (selectedNodes.length > 0) {
112765
- this._isFirstRecordOfPage = selectedNodes[0].rowIndex === e.api.getFirstDisplayedRow();
112766
- this._isLastRecordOfPage = selectedNodes[0].rowIndex === e.api.getLastDisplayedRow();
112808
+ this._isFirstRecordOfPage = selectedNodes[0].rowIndex === this._gridOptions.api.getFirstDisplayedRow();
112809
+ this._isLastRecordOfPage = selectedNodes[0].rowIndex === this._gridOptions.api.getLastDisplayedRow();
112767
112810
  }
112768
112811
  if (this._selectionChangeCallback) {
112769
112812
  this._selectionChangeCallback({
112770
- selection: e.api.getSelectedRows(),
112813
+ selection: this._gridOptions.api.getSelectedRows(),
112771
112814
  isFirstOfPage: this._isFirstRecordOfPage,
112772
112815
  isLastOfPage: this._isLastRecordOfPage
112773
112816
  });
112774
112817
  }
112775
112818
  }
112776
112819
  onPaginationChange() {
112820
+ var _a, _b;
112821
+ const currentPageStatus = this.getPaginationStatus();
112822
+ if (((_a = this._lastPageStatus) === null || _a === void 0 ? void 0 : _a.currentPage) != (currentPageStatus === null || currentPageStatus === void 0 ? void 0 : currentPageStatus.currentPage)) {
112823
+ ((_b = this._lastPageStatus) === null || _b === void 0 ? void 0 : _b.currentPage) < (currentPageStatus === null || currentPageStatus === void 0 ? void 0 : currentPageStatus.currentPage) ? this.selectFirstRow() : this.selectLastRow();
112824
+ }
112777
112825
  this.syncSelection();
112778
112826
  if (this._paginationChangeCallback) {
112779
112827
  if (this._gridOptions.api) {
112780
- this._paginationChangeCallback(this.getPaginationStatus());
112828
+ this._paginationChangeCallback(currentPageStatus);
112781
112829
  }
112782
112830
  }
112783
112831
  }
@@ -112814,6 +112862,7 @@ class DataUnitBridge {
112814
112862
  constructor(gridController, dataUnit) {
112815
112863
  this.RECORD_ARCHIVE = "__RECORD_ARCHIVE__";
112816
112864
  this.processAction = (action) => {
112865
+ var _a, _b, _c, _d;
112817
112866
  switch (action.type) {
112818
112867
  case Action.METADATA_LOADED:
112819
112868
  this._gridController.setColumnsDef(this.buildColumnDefs(), true);
@@ -112822,9 +112871,16 @@ class DataUnitBridge {
112822
112871
  const { records } = action.payload;
112823
112872
  this._gridController.removeRows(records);
112824
112873
  break;
112825
- case Action.EDITION_CANCELED:
112826
112874
  case Action.DATA_SAVED:
112827
- this._gridController.refresh();
112875
+ const recordsAdded = (_b = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.filter(r => { var _a; return (_a = r.__old__id__) === null || _a === void 0 ? void 0 : _a.startsWith('NEW_'); });
112876
+ const recordsUpdated = (_d = (_c = action.payload) === null || _c === void 0 ? void 0 : _c.records) === null || _d === void 0 ? void 0 : _d.filter(r => { var _a; return !((_a = r.__old__id__) === null || _a === void 0 ? void 0 : _a.startsWith('NEW_')); });
112877
+ if (recordsAdded.length > 0)
112878
+ this._gridController.addRows(recordsAdded);
112879
+ if (recordsUpdated.length > 0)
112880
+ this._gridController.updateRows(recordsUpdated);
112881
+ break;
112882
+ case Action.EDITION_CANCELED:
112883
+ this.updateValues();
112828
112884
  break;
112829
112885
  case Action.SELECTION_CHANGED:
112830
112886
  const { selection } = action.payload;
@@ -112844,6 +112900,11 @@ class DataUnitBridge {
112844
112900
  this._dataUnit = dataUnit;
112845
112901
  this._dataUnit.subscribe(this.processAction);
112846
112902
  }
112903
+ updateValues() {
112904
+ this._dataUnit.getSelectedRecords().forEach((record) => {
112905
+ this._gridController.changeValues(record, [record.__record__id__]);
112906
+ });
112907
+ }
112847
112908
  buildColumnDefs() {
112848
112909
  const columnDefs = [];
112849
112910
  if (this._dataUnit.metadata) {
@@ -113010,7 +113071,7 @@ let EzGrid$1 = class extends HTMLElement$1 {
113010
113071
  componentWillLoad() {
113011
113072
  if (this.dataUnit) {
113012
113073
  this._dataUnitBridge = new DataUnitBridge(this._gridController, this.dataUnit);
113013
- addEventListener("ezSelectionChange", (evt) => this.dataUnit.setSelection(evt.detail.map((r) => r.__record__id__)));
113074
+ addEventListener("ezSelectionChange", (evt) => this.dataUnit.setSelection(evt.detail.selection.map((r) => r.__record__id__)));
113014
113075
  }
113015
113076
  }
113016
113077
  onColumnStateChange(type, state, info) {
@@ -113079,7 +113140,7 @@ let EzGrid$1 = class extends HTMLElement$1 {
113079
113140
  componentDidLoad() {
113080
113141
  this._gridController.initDatagrid(this._container, {
113081
113142
  onColumnStateChange: (type, state, info) => this.onColumnStateChange(type, state, info),
113082
- onSelectionChange: (state) => this.ezSelectionChange.emit(state.selection),
113143
+ onSelectionChange: (state) => this.ezSelectionChange.emit(state),
113083
113144
  onPaginationChange: (status) => {
113084
113145
  this._navigationHasPrevious = status.hasPrevious;
113085
113146
  this._navigationHasNext = status.hasNext;
@@ -115277,6 +115338,12 @@ let EzViewStack$1 = class extends HTMLElement$1 {
115277
115338
  this._focusedIndex = index;
115278
115339
  }
115279
115340
  }
115341
+ /**
115342
+ * Retorna o index que est� atualmente ativo e sendo exibido.
115343
+ */
115344
+ async getSelectedIndex() {
115345
+ return this._focusedIndex;
115346
+ }
115280
115347
  policyHideRemove() {
115281
115348
  let element = this._hostElem.querySelector(`#el_${this._focusedIndex}`);
115282
115349
  this.checkElementVisibility(element);
@@ -115343,7 +115410,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
115343
115410
  /* Creation Methods */
115344
115411
  createOrderList() {
115345
115412
  let newList = [];
115346
- this.columns.forEach(column => {
115413
+ this.columns.filter(col => { var _a; return StringUtils.getBooleanValue((_a = col === null || col === void 0 ? void 0 : col.props) === null || _a === void 0 ? void 0 : _a.get("sortable"), true); }).forEach(column => {
115347
115414
  var _a;
115348
115415
  let configItem = (_a = this.config) === null || _a === void 0 ? void 0 : _a.columns.find(item => item.name === column.name);
115349
115416
  let item = { name: column.name, label: column.label };