@sankhyalabs/ezui 0.0.0-bugfix-dev-kb-67792.0 → 0.0.0-bugfix-dev-KB-68936.0
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.
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-badge.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +2 -2
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +120 -10
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +2 -2
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_2.cjs.entry.js +222 -0
- package/dist/cjs/ez-search.cjs.entry.js +2 -1
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +92 -0
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/{ez-scroller_3.cjs.entry.js → ez-tree.cjs.entry.js} +1 -216
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +13 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +43 -4
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +73 -5
- package/dist/collection/components/ez-grid/ez-grid.js +21 -0
- package/dist/collection/components/ez-popup/ez-popup.css +1 -2
- package/dist/collection/components/ez-search/ez-search.js +1 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +6 -2
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +180 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js +293 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js +5 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js +3 -0
- package/dist/collection/components/ez-sidebar-navigator/messages/constants.js +5 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +212 -14
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-badge.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +1 -1
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-custom-form-input_2.entry.js +2 -2
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +120 -10
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +2 -2
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_2.entry.js +217 -0
- package/dist/esm/ez-search.entry.js +2 -1
- package/dist/esm/ez-sidebar-navigator.entry.js +88 -0
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/{ez-scroller_3.entry.js → ez-tree.entry.js} +3 -216
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +13 -3
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-61d638fa.entry.js → p-034e21ca.entry.js} +1 -1
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- package/dist/ezui/{p-1285c902.entry.js → p-11b09aa1.entry.js} +1 -1
- package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
- package/dist/ezui/p-1b08bf3c.entry.js +1 -0
- package/dist/ezui/{p-af95cd16.entry.js → p-24ca32a3.entry.js} +1 -1
- package/dist/ezui/{p-7922142b.entry.js → p-2af4e2de.entry.js} +1 -1
- package/dist/ezui/{p-baf80b13.entry.js → p-30951bd7.entry.js} +1 -1
- package/dist/ezui/{p-922ac38b.entry.js → p-31674f8e.entry.js} +1 -1
- package/dist/ezui/{p-bf79aaa1.entry.js → p-33792b2b.entry.js} +1 -1
- package/dist/ezui/{p-e85c48d7.entry.js → p-36180f4d.entry.js} +1 -1
- package/dist/ezui/{p-7bc07c31.entry.js → p-3f8c33e0.entry.js} +1 -1
- package/dist/ezui/{p-5056284a.entry.js → p-439fbc78.entry.js} +1 -1
- package/dist/ezui/{p-ffef392d.entry.js → p-569a0b9a.entry.js} +1 -1
- package/dist/ezui/p-5fefcdc9.entry.js +1 -0
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
- package/dist/ezui/p-6ec40dec.entry.js +1 -0
- package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
- package/dist/ezui/p-752c4069.entry.js +1 -0
- package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
- package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
- package/dist/ezui/{p-3b4eeeb6.entry.js → p-81cffa53.entry.js} +1 -1
- package/dist/ezui/p-81f99ace.entry.js +1 -0
- package/dist/ezui/{p-072e6347.entry.js → p-82ac8b06.entry.js} +1 -1
- package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
- package/dist/ezui/{p-bcb53f27.entry.js → p-868b56f7.entry.js} +1 -1
- package/dist/ezui/{p-85c8baae.entry.js → p-8eef0f70.entry.js} +1 -1
- package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
- package/dist/ezui/{p-3faa2b46.entry.js → p-9634631d.entry.js} +1 -1
- package/dist/ezui/{p-f3c526cc.entry.js → p-9a11e223.entry.js} +1 -1
- package/dist/ezui/{p-7af81663.entry.js → p-9a23d513.entry.js} +1 -1
- package/dist/ezui/{p-84e439b9.entry.js → p-9aa27e69.entry.js} +1 -1
- package/dist/ezui/{p-784fe207.entry.js → p-9c2e2d68.entry.js} +1 -1
- package/dist/ezui/{p-9ab22a07.entry.js → p-a35b41e6.entry.js} +1 -1
- package/dist/ezui/{p-e252a728.entry.js → p-ac426b69.entry.js} +2 -2
- package/dist/ezui/{p-9050d2cd.entry.js → p-b0e71d23.entry.js} +1 -1
- package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/{p-5bd5e68f.entry.js → p-c3b7a23e.entry.js} +1 -1
- package/dist/ezui/{p-2dcb50d4.entry.js → p-c5a80844.entry.js} +1 -1
- package/dist/ezui/{p-2f8bcd75.entry.js → p-cd1a2e6b.entry.js} +1 -1
- package/dist/ezui/{p-bae4e180.entry.js → p-dbeee5aa.entry.js} +1 -1
- package/dist/ezui/{p-2097d0cf.entry.js → p-de870657.entry.js} +1 -1
- package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
- package/dist/ezui/{p-30775e7f.entry.js → p-e151e795.entry.js} +1 -1
- package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
- package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
- package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
- package/dist/ezui/{p-13d2fe2d.entry.js → p-f1c3f85d.entry.js} +1 -1
- package/dist/ezui/{p-49456b34.entry.js → p-f291db18.entry.js} +1 -1
- package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +13 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +8 -1
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +17 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +4 -0
- package/dist/types/components/ez-sidebar-navigator/ez-sidebar-navigator.d.ts +57 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.d.ts +4 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/index.d.ts +3 -0
- package/dist/types/components/ez-sidebar-navigator/messages/constants.d.ts +5 -0
- package/dist/types/components.d.ts +98 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-4d5235f1.entry.js +0 -1
- package/dist/ezui/p-91f626d3.entry.js +0 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
|
@@ -379,10 +379,15 @@ export default class AgGridController {
|
|
|
379
379
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
updateRows() {
|
|
382
|
+
updateRows(rows) {
|
|
383
383
|
if (this._grid === undefined) {
|
|
384
384
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
385
385
|
}
|
|
386
|
+
rows === null || rows === void 0 ? void 0 : rows.forEach(row => this.updateRowData(row));
|
|
387
|
+
}
|
|
388
|
+
updateRowData(row) {
|
|
389
|
+
const node = this._gridOptions.api.getRowNode(row[this._idAttribName]);
|
|
390
|
+
node.setData(Object.assign({}, row));
|
|
386
391
|
}
|
|
387
392
|
selectAll(quietly = false) {
|
|
388
393
|
try {
|
|
@@ -491,6 +496,10 @@ export default class AgGridController {
|
|
|
491
496
|
var _a;
|
|
492
497
|
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
|
|
493
498
|
}
|
|
499
|
+
setEnableGridInsert(enable) {
|
|
500
|
+
var _a;
|
|
501
|
+
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setEnableGridInsert(enable);
|
|
502
|
+
}
|
|
494
503
|
setFocusFirstRow() {
|
|
495
504
|
const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
|
|
496
505
|
if (firstRow) {
|
|
@@ -506,9 +515,38 @@ export default class AgGridController {
|
|
|
506
515
|
this.setFocusOnRow(lastRow.rowIndex);
|
|
507
516
|
}
|
|
508
517
|
}
|
|
518
|
+
startEditionOnRowByIndex(rowIndex) {
|
|
519
|
+
const firstCol = this.getFirstEditableColl(rowIndex);
|
|
520
|
+
this.focusByCollAndRow(firstCol, rowIndex);
|
|
521
|
+
this.startEdition(rowIndex, firstCol);
|
|
522
|
+
}
|
|
523
|
+
startEdition(rowIndex, firstCol) {
|
|
524
|
+
this._gridOptions.api.clearRangeSelection();
|
|
525
|
+
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstCol] });
|
|
526
|
+
this._gridOptions.api.setFocusedCell(rowIndex, firstCol);
|
|
527
|
+
this._gridOptions.api.startEditingCell({ rowIndex, colKey: firstCol });
|
|
528
|
+
const cellEditor = this._gridOptions.api.getCellEditorInstances()[0];
|
|
529
|
+
if (cellEditor) {
|
|
530
|
+
cellEditor.focusIn();
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
getFirstEditableColl(rowIndex) {
|
|
534
|
+
const displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
|
|
535
|
+
return displayedColumns.find(column => this.isColumnEditable(rowIndex, column));
|
|
536
|
+
}
|
|
537
|
+
isColumnEditable(rowIndex, column) {
|
|
538
|
+
if (column.getColDef().headerName === '')
|
|
539
|
+
return false;
|
|
540
|
+
const rowId = this._dataUnit.records[rowIndex][this._idAttribName];
|
|
541
|
+
const rowNode = this._gridOptions.api.getRowNode(rowId);
|
|
542
|
+
return column.isCellEditable(rowNode);
|
|
543
|
+
}
|
|
509
544
|
setFocusOnRow(rowIndex) {
|
|
510
545
|
let displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
|
|
511
|
-
let
|
|
546
|
+
let firstColl = displayedColumns.find(column => column.getColDef().headerName !== '');
|
|
547
|
+
this.focusByCollAndRow(firstColl, rowIndex);
|
|
548
|
+
}
|
|
549
|
+
focusByCollAndRow(firstCell, rowIndex) {
|
|
512
550
|
this._gridOptions.api.ensureColumnVisible(firstCell);
|
|
513
551
|
this._gridOptions.api.ensureIndexVisible(rowIndex);
|
|
514
552
|
this._gridOptions.api.setFocusedCell(rowIndex, firstCell);
|
|
@@ -576,9 +614,11 @@ export default class AgGridController {
|
|
|
576
614
|
//Existem colunas implícitas que não tem estado, essas colunas são sempre as primeiras.
|
|
577
615
|
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
578
616
|
const columnsOffset = colDef.length - columns.length;
|
|
617
|
+
this._gridConfig = state;
|
|
579
618
|
let sort = [];
|
|
580
619
|
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
581
|
-
|
|
620
|
+
var _a;
|
|
621
|
+
const colWidth = (_a = this._gridOptions.columnApi.getColumn(cfgColumn.name)) === null || _a === void 0 ? void 0 : _a.getActualWidth();
|
|
582
622
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
583
623
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
584
624
|
visibleColumns.push(cfgColumn.name);
|
|
@@ -593,7 +633,6 @@ export default class AgGridController {
|
|
|
593
633
|
state: sort,
|
|
594
634
|
defaultState: { sort: null },
|
|
595
635
|
});
|
|
596
|
-
this._gridConfig = state;
|
|
597
636
|
}
|
|
598
637
|
getAdaptiveWidth(width) {
|
|
599
638
|
const widthGrid = this._container.clientWidth;
|
|
@@ -2,6 +2,67 @@ import { Action, ObjectUtils } from '@sankhyalabs/core';
|
|
|
2
2
|
import { EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
|
|
3
3
|
import { DataSourceInterceptor } from "./DataSourceInterceptor";
|
|
4
4
|
export default class DataSource {
|
|
5
|
+
handleDataChanged(action) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
if (!this._options.enableGridInsert) {
|
|
8
|
+
this.handleRefresh(action);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
this.updateGridRowNodes((_b = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.records) !== null && _b !== void 0 ? _b : []);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Nesse ponto, o registro já se encontra atualizado no DU,
|
|
15
|
+
* basta então passar seu valor para que a garde possa atualizar sua linha.
|
|
16
|
+
*/
|
|
17
|
+
updateGridRowNodes(recordIDList) {
|
|
18
|
+
const recordsToUpdate = recordIDList === null || recordIDList === void 0 ? void 0 : recordIDList.map(id => this.getRecordById(id));
|
|
19
|
+
this._controller.updateRows(recordsToUpdate);
|
|
20
|
+
}
|
|
21
|
+
getRecordById(recordId) {
|
|
22
|
+
return this._dataUnit.records.find(record => record['__record__id__'] === recordId);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Em caso de necessidade de reload (isWaitingToReload), eh preciso chamar o dataUnit.gotoPage, pois ele aplica tambem a ordenacao dos registros,
|
|
26
|
+
* enquanto que o _controller.refresh apenas recarrega os dados na ordem que atua.
|
|
27
|
+
*/
|
|
28
|
+
handleRefreshOrReload(action) {
|
|
29
|
+
if (this._dataUnit.isWaitingToReload()) {
|
|
30
|
+
this.handleReload();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.handleRefresh(action);
|
|
34
|
+
}
|
|
35
|
+
handleReload() {
|
|
36
|
+
this._dataUnit.setWaitingToReload(false);
|
|
37
|
+
this._dataUnit.gotoPage(0);
|
|
38
|
+
}
|
|
39
|
+
handleRefresh(action) {
|
|
40
|
+
if (this.isSilentChange(action)) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this._controller.refresh();
|
|
44
|
+
}
|
|
45
|
+
handleRecordsAdded() {
|
|
46
|
+
if (this._options.enableGridInsert) {
|
|
47
|
+
this._controller.refresh();
|
|
48
|
+
this.focusOnNewRecord();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
focusOnNewRecord() {
|
|
52
|
+
/**
|
|
53
|
+
* O SetTimeout eh utilizado pois é preciso aguardar que o novo registro seja renderizado na grade.
|
|
54
|
+
* Tentamos utilizar a api da grade para adicionar um event listener, porém na versão que utilizamos, não existe
|
|
55
|
+
* algo que resolva nosso cenário.
|
|
56
|
+
*
|
|
57
|
+
* Sugiro no futuro utilizar algo como o applyServerSideTransaction, porém será preciso lidar com os handlers
|
|
58
|
+
* e callbacks implementados no AgGridController e GridEditionManager.
|
|
59
|
+
*/
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
var _a;
|
|
62
|
+
const newRowIndex = ((_a = this._dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) - 1;
|
|
63
|
+
this._controller.startEditionOnRowByIndex(newRowIndex);
|
|
64
|
+
}, 500);
|
|
65
|
+
}
|
|
5
66
|
updateLoadedRecords(action) {
|
|
6
67
|
const records = action.payload;
|
|
7
68
|
if ((records === null || records === void 0 ? void 0 : records.length) > 0) {
|
|
@@ -53,15 +114,19 @@ export default class DataSource {
|
|
|
53
114
|
this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());
|
|
54
115
|
}
|
|
55
116
|
break;
|
|
56
|
-
case Action.
|
|
117
|
+
case Action.RECORDS_ADDED:
|
|
118
|
+
this.handleRecordsAdded();
|
|
119
|
+
break;
|
|
57
120
|
case Action.DATA_SAVED:
|
|
58
121
|
case Action.EDITION_CANCELED:
|
|
122
|
+
this.handleRefreshOrReload(action);
|
|
123
|
+
break;
|
|
59
124
|
case Action.DATA_CHANGED:
|
|
60
125
|
case Action.DATA_RESOLVED:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.
|
|
126
|
+
this.handleDataChanged(action);
|
|
127
|
+
break;
|
|
128
|
+
case Action.RECORDS_REMOVED:
|
|
129
|
+
this.handleRefresh(action);
|
|
65
130
|
break;
|
|
66
131
|
case Action.SELECTION_CHANGED:
|
|
67
132
|
case Action.NEXT_SELECTED:
|
|
@@ -92,6 +157,9 @@ export default class DataSource {
|
|
|
92
157
|
setAutoFocus(autoFocus) {
|
|
93
158
|
this._options.autoFocus = autoFocus;
|
|
94
159
|
}
|
|
160
|
+
setEnableGridInsert(enable) {
|
|
161
|
+
this._options.enableGridInsert = enable;
|
|
162
|
+
}
|
|
95
163
|
getRows(params) {
|
|
96
164
|
if (this.needReload(params)) {
|
|
97
165
|
this._lastLoadingParams = params;
|
|
@@ -36,6 +36,7 @@ export class EzGrid {
|
|
|
36
36
|
this.recordsValidator = undefined;
|
|
37
37
|
this.canEdit = true;
|
|
38
38
|
this.autoFocus = true;
|
|
39
|
+
this.enableGridInsert = false;
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* Aplica a definição de colunas.
|
|
@@ -362,6 +363,7 @@ export class EzGrid {
|
|
|
362
363
|
editionIsDisabled: () => !this.canEdit,
|
|
363
364
|
customFormatters: this._customFormatters,
|
|
364
365
|
autoFocus: this.autoFocus,
|
|
366
|
+
enableGridInsert: this.enableGridInsert,
|
|
365
367
|
onRefresh: () => {
|
|
366
368
|
if (this.dataUnit) {
|
|
367
369
|
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
@@ -454,6 +456,7 @@ export class EzGrid {
|
|
|
454
456
|
}
|
|
455
457
|
componentDidUpdate() {
|
|
456
458
|
this._gridController.setAutoFocus(this.autoFocus);
|
|
459
|
+
this._gridController.setEnableGridInsert(this.enableGridInsert);
|
|
457
460
|
}
|
|
458
461
|
getDataSource() {
|
|
459
462
|
var _a;
|
|
@@ -694,6 +697,24 @@ export class EzGrid {
|
|
|
694
697
|
"attribute": "auto-focus",
|
|
695
698
|
"reflect": false,
|
|
696
699
|
"defaultValue": "true"
|
|
700
|
+
},
|
|
701
|
+
"enableGridInsert": {
|
|
702
|
+
"type": "boolean",
|
|
703
|
+
"mutable": false,
|
|
704
|
+
"complexType": {
|
|
705
|
+
"original": "boolean",
|
|
706
|
+
"resolved": "boolean",
|
|
707
|
+
"references": {}
|
|
708
|
+
},
|
|
709
|
+
"required": false,
|
|
710
|
+
"optional": true,
|
|
711
|
+
"docs": {
|
|
712
|
+
"tags": [],
|
|
713
|
+
"text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
|
|
714
|
+
},
|
|
715
|
+
"attribute": "enable-grid-insert",
|
|
716
|
+
"reflect": false,
|
|
717
|
+
"defaultValue": "false"
|
|
697
718
|
}
|
|
698
719
|
};
|
|
699
720
|
}
|
|
@@ -68,8 +68,7 @@
|
|
|
68
68
|
border-radius: 12px;
|
|
69
69
|
box-shadow: 0px 0px 16px rgba(0, 38, 111, 0.122);
|
|
70
70
|
box-sizing: border-box;
|
|
71
|
-
padding: var(--ez-popup__container--padding)
|
|
72
|
-
overflow-y: auto;
|
|
71
|
+
padding: var(--ez-popup__container--padding)
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
.popup__container--auto {
|
|
@@ -543,6 +543,7 @@ export class EzSearch {
|
|
|
543
543
|
this.validateDescriptionValue();
|
|
544
544
|
}
|
|
545
545
|
componentDidLoad() {
|
|
546
|
+
this._currentValue = this.value;
|
|
546
547
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
547
548
|
this.setInputValue(false);
|
|
548
549
|
this._resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -43,15 +43,19 @@ button {
|
|
|
43
43
|
box-shadow: var(--ez-sidebar-button--box-shadow);
|
|
44
44
|
padding: 0;
|
|
45
45
|
cursor: pointer;
|
|
46
|
+
align-items: center;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
span {
|
|
49
50
|
width: var(--ez-sidebar-button--width);
|
|
50
51
|
height: var(--ez-sidebar-button--height);
|
|
51
|
-
margin: var(--ez-sidebar-button--space--medium)
|
|
52
|
+
margin: var(--ez-sidebar-button--space--medium) 0 var(--ez-sidebar-button--space--medium) 0;
|
|
52
53
|
background: var(--ez-sidebar-button--background-color--primary);
|
|
53
54
|
border-radius: 0 var(--ez-sidebar-button--border--radius-small) var(--ez-sidebar-button--border--radius-small) 0;
|
|
54
55
|
}
|
|
56
|
+
ez-icon {
|
|
57
|
+
--ez-icon--color: var(--ez-sidebar-button--background-color--primary);
|
|
58
|
+
}
|
|
55
59
|
|
|
56
60
|
button:hover {
|
|
57
61
|
box-shadow: var(--ez-sidebar-button--hover--box-shadow);
|
|
@@ -59,5 +63,5 @@ button:hover {
|
|
|
59
63
|
|
|
60
64
|
button:hover span {
|
|
61
65
|
width: var(--ez-sidebar-button--hover--width);
|
|
62
|
-
margin: var(--ez-sidebar-button--space--medium)
|
|
66
|
+
margin: var(--ez-sidebar-button--space--medium) 0 var(--ez-sidebar-button--space--medium) 0;
|
|
63
67
|
}
|
|
@@ -11,7 +11,7 @@ export class EzSidebarButton {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h("button", { type: "button", onClick: () => { this.ezClick.emit(); }, ref: (el) => this._button = el }, h("span", null)));
|
|
14
|
+
return (h("button", { type: "button", onClick: () => { this.ezClick.emit(); }, ref: (el) => this._button = el }, h("span", null), h("ez-icon", { iconName: "chevron-right" })));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "ez-sidebar-button"; }
|
|
17
17
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
/* Label Container */
|
|
3
|
+
/*@doc Define o espaçamento da esquerda do container*/
|
|
4
|
+
--ez-sidebar-navigator--padding-left: var(--space--xs, 12px);
|
|
5
|
+
/*@doc Define o espaçamento da direita do container*/
|
|
6
|
+
--ez-sidebar-navigator--padding-right: var(--space--xs, 12px);
|
|
7
|
+
/*@doc Define o espaçamento entre o cabeçalho conteúdo e rodapé*/
|
|
8
|
+
--ez-sidebar-navigator--gap: var(--space--xs, 12px);
|
|
9
|
+
/*@doc Define a cor de shadow box do container de label*/
|
|
10
|
+
--ez-sidebar-navigator--box-shadow: var(--shadow, 0px 0px 24px 0px #000);
|
|
11
|
+
/*@doc Define a cor de fundo do container de label*/
|
|
12
|
+
--ez-sidebar-navigator--background-color: var(--color--inverted);
|
|
13
|
+
/*@doc Define o border radius do container de label*/
|
|
14
|
+
--ez-sidebar-navigator--border-radius: 0px var(--border--radius-medium) var(--border--radius-medium) 0px;
|
|
15
|
+
/*@doc Força uma altura especifica para o sidebar, o padrão é 100% da tela*/
|
|
16
|
+
--ez-sidebar-navigator--height: calc(100vh - var(--space--lg, 24px));
|
|
17
|
+
|
|
18
|
+
/*Labels Header */
|
|
19
|
+
/*@doc Define o espaçamento entre os componente do cabeçalho*/
|
|
20
|
+
--ez-sidebar-navigator--header-gap: var(--space--xs, 12px);
|
|
21
|
+
|
|
22
|
+
/*Labels Footer */
|
|
23
|
+
/*@doc Define o espaçamento entre os componente do rodadé*/
|
|
24
|
+
--ez-sidebar-navigator--footer-gap: var(--space--xs, 12px);
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/* Title */
|
|
28
|
+
/*@doc Define a fonte do título do componente */
|
|
29
|
+
--ez-ez-sidebar-navigator__title--font-family: var(--font-pattern, "Roboto");
|
|
30
|
+
/*@doc Define o tamanho da fonte do título do componente.*/
|
|
31
|
+
--ez-ez-sidebar-navigator__title--font-size: var(--title--medium, 16px);
|
|
32
|
+
/*@doc Define a cor da fonte do título do componente.*/
|
|
33
|
+
--ez-ez-sidebar-navigator__title--color: var(--title--primary, #2b3a54);
|
|
34
|
+
/*@doc Define o peso da fonte do título do componente.*/
|
|
35
|
+
--ez-ez-sidebar-navigator__title--font-weight: var(--text-weight--extra-large, 700);
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.inverted {
|
|
40
|
+
/* private */
|
|
41
|
+
transform: rotate(180deg);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ez-sidebar-navigator {
|
|
45
|
+
/* private */
|
|
46
|
+
display: -webkit-box;
|
|
47
|
+
display: -ms-flexbox;
|
|
48
|
+
display: flex;
|
|
49
|
+
-webkit-box-orient: vertical;
|
|
50
|
+
-webkit-box-direction: normal;
|
|
51
|
+
-ms-flex-direction: column;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
height: var(--ez-sidebar-navigator--height);
|
|
54
|
+
padding-top: var(--space--xs, 12px);
|
|
55
|
+
padding-bottom: var(--space--xs, 12px);
|
|
56
|
+
|
|
57
|
+
/* public */
|
|
58
|
+
gap: var(--ez-sidebar-navigator--gap);
|
|
59
|
+
padding-left: var(--ez-sidebar-navigator--padding-left);
|
|
60
|
+
padding-right: var(--ez-sidebar-navigator--padding-right);
|
|
61
|
+
background-color: var(--ez-sidebar-navigator--background-color);
|
|
62
|
+
-webkit-box-shadow: var(--ez-sidebar-navigator--box-shadow);
|
|
63
|
+
box-shadow: var(--ez-sidebar-navigator--box-shadow);
|
|
64
|
+
border-radius: var(--ez-sidebar-navigator--border-radius);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ez-sidebar-navigator__header {
|
|
68
|
+
/* private */
|
|
69
|
+
display: -webkit-box;
|
|
70
|
+
display: -ms-flexbox;
|
|
71
|
+
display: flex;
|
|
72
|
+
-webkit-box-align: center;
|
|
73
|
+
-ms-flex-align: center;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: space-between;
|
|
76
|
+
|
|
77
|
+
/* public */
|
|
78
|
+
gap: var(--ez-sidebar-navigator--header-gap);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ez-sidebar-navigator__content {
|
|
82
|
+
height: 100%;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ez-sidebar-navigator__footer {
|
|
86
|
+
/* private */
|
|
87
|
+
display: -webkit-box;
|
|
88
|
+
display: -ms-flexbox;
|
|
89
|
+
display: flex;
|
|
90
|
+
-webkit-box-align: center;
|
|
91
|
+
-ms-flex-align: center;
|
|
92
|
+
align-items: center;
|
|
93
|
+
|
|
94
|
+
/* public */
|
|
95
|
+
gap: var(--ez-sidebar-navigator--footer-gap);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ez-sidebar-navigator__title {
|
|
99
|
+
/* private */
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
|
|
104
|
+
/* public */
|
|
105
|
+
font-family: var(--ez-ez-sidebar-navigator__title--font-family);
|
|
106
|
+
font-size: var(--ez-ez-sidebar-navigator__title--font-size);
|
|
107
|
+
font-weight: var(--ez-ez-sidebar-navigator__title--font-weight);
|
|
108
|
+
color: var(--ez-ez-sidebar-navigator__title--color);
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ez-sidebar-navigator__end {
|
|
113
|
+
/* private */
|
|
114
|
+
display: -webkit-box;
|
|
115
|
+
display: -ms-flexbox;
|
|
116
|
+
display: flex;
|
|
117
|
+
-webkit-box-align: center;
|
|
118
|
+
-ms-flex-align: center;
|
|
119
|
+
align-items: center;
|
|
120
|
+
margin-left: auto;
|
|
121
|
+
/* public */
|
|
122
|
+
gap: var(--ez-sidebar-navigator--gap);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.dynamic {
|
|
126
|
+
position: absolute;
|
|
127
|
+
z-index: var(--most-visible , 4);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.fixed {
|
|
131
|
+
position: relative;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.hidden {
|
|
135
|
+
display: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.show {
|
|
139
|
+
animation: fadeIn .1s ease-in-out 1;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@keyframes fadeIn {
|
|
143
|
+
from {
|
|
144
|
+
transform: translate(-100%);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.sm {
|
|
149
|
+
/* private */
|
|
150
|
+
width: 240px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.md {
|
|
154
|
+
/* private */
|
|
155
|
+
width: 280px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.lg {
|
|
159
|
+
/* private */
|
|
160
|
+
width: 320px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@media screen and (max-width: 991px) {
|
|
164
|
+
.responsive {
|
|
165
|
+
/* private */
|
|
166
|
+
width: 240px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
@media screen and (min-width: 992px) {
|
|
170
|
+
.responsive {
|
|
171
|
+
/* private */
|
|
172
|
+
width: 280px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
@media screen and (min-width: 1200px) {
|
|
176
|
+
.responsive {
|
|
177
|
+
/* private */
|
|
178
|
+
width: 320px;
|
|
179
|
+
}
|
|
180
|
+
}
|