@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-77126.0 → 0.0.0-bugfix-dev-KB-77074.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/RecordValidationProcessor-10846595.js +108 -0
- package/dist/cjs/ez-card-item_3.cjs.entry.js +19 -12
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +10 -46
- package/dist/cjs/ez-date-input.cjs.entry.js +2 -8
- package/dist/cjs/ez-date-time-input.cjs.entry.js +2 -8
- package/dist/cjs/ez-dialog.cjs.entry.js +2 -10
- package/dist/cjs/ez-form-view.cjs.entry.js +2 -2
- package/dist/cjs/ez-form.cjs.entry.js +324 -4
- package/dist/cjs/ez-grid.cjs.entry.js +70542 -14645
- package/dist/cjs/ez-list.cjs.entry.js +100 -151
- package/dist/cjs/ez-number-input.cjs.entry.js +0 -7
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +12 -28
- package/dist/cjs/ez-text-area.cjs.entry.js +4 -66
- package/dist/cjs/ez-text-input.cjs.entry.js +7 -49
- package/dist/cjs/ez-time-input.cjs.entry.js +0 -6
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-card-item/ez-card-item.css +5 -14
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +14 -75
- package/dist/collection/components/ez-date-input/ez-date-input.js +4 -35
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +4 -35
- package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
- package/dist/collection/components/ez-dialog/ez-dialog.js +1 -9
- package/dist/collection/components/ez-filter-input/ez-filter-input.css +11 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +52 -22
- package/dist/collection/components/ez-form/ez-form.js +0 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +25 -80
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +0 -8
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +46 -167
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +0 -7
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +1 -4
- package/dist/collection/components/ez-grid/ez-grid.js +3 -90
- package/dist/collection/components/ez-list/ez-list.css +5 -5
- package/dist/collection/components/ez-list/ez-list.js +170 -152
- package/dist/collection/components/ez-number-input/ez-number-input.js +0 -25
- package/dist/collection/components/ez-popover/ez-popover.css +10 -3
- package/dist/collection/components/ez-popup/ez-popup.js +1 -1
- package/dist/collection/components/ez-search/ez-search.css +1 -1
- package/dist/collection/components/ez-search/ez-search.js +14 -55
- package/dist/collection/components/ez-text-area/ez-text-area.css +0 -49
- package/dist/collection/components/ez-text-area/ez-text-area.js +2 -102
- package/dist/collection/components/ez-text-input/ez-text-input.css +53 -27
- package/dist/collection/components/ez-text-input/ez-text-input.js +6 -84
- package/dist/collection/components/ez-time-input/ez-time-input.js +0 -24
- package/dist/collection/utils/form/DataBinder.js +3 -18
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/custom-elements/index.js +70890 -15272
- package/dist/esm/RecordValidationProcessor-9c6cc267.js +105 -0
- package/dist/esm/ez-card-item_3.entry.js +19 -12
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +11 -47
- package/dist/esm/ez-date-input.entry.js +2 -8
- package/dist/esm/ez-date-time-input.entry.js +2 -8
- package/dist/esm/ez-dialog.entry.js +2 -10
- package/dist/esm/ez-form-view.entry.js +2 -2
- package/dist/esm/ez-form.entry.js +323 -3
- package/dist/esm/ez-grid.entry.js +70542 -14645
- package/dist/esm/ez-list.entry.js +101 -152
- package/dist/esm/ez-number-input.entry.js +0 -7
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +12 -28
- package/dist/esm/ez-text-area.entry.js +4 -66
- package/dist/esm/ez-text-input.entry.js +7 -49
- package/dist/esm/ez-time-input.entry.js +0 -6
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-188f1c4c.entry.js +1 -0
- package/dist/ezui/p-49456b34.entry.js +1 -0
- package/dist/ezui/p-5a90d7d1.entry.js +1 -0
- package/dist/ezui/p-5b205c80.entry.js +1 -0
- package/dist/ezui/p-62732269.entry.js +1 -0
- package/dist/ezui/p-86b6aa01.entry.js +1 -0
- package/dist/ezui/p-b3b94f72.entry.js +1 -0
- package/dist/ezui/p-b95632e8.entry.js +1 -0
- package/dist/ezui/p-bcd47eda.entry.js +1 -0
- package/dist/ezui/p-c3c3d640.entry.js +304 -0
- package/dist/ezui/p-cdc472cc.entry.js +1 -0
- package/dist/ezui/p-d2c06f38.entry.js +1 -0
- package/dist/ezui/p-d8f64bb7.entry.js +1 -0
- package/dist/ezui/p-dc4ada32.entry.js +1 -0
- package/dist/ezui/p-e85c48d7.entry.js +1 -0
- package/dist/ezui/p-f299c608.entry.js +1 -0
- package/dist/ezui/p-f42855b9.js +1 -0
- package/dist/ezui/p-f80ac647.entry.js +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -7
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +1 -6
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +1 -6
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +0 -2
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +11 -4
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +0 -12
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -7
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -2
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -19
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +1 -3
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +0 -1
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +1 -11
- package/dist/types/components/ez-list/ez-list.d.ts +26 -3
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +0 -4
- package/dist/types/components/ez-search/ez-search.d.ts +1 -6
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +0 -17
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +0 -9
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +0 -4
- package/dist/types/components.d.ts +42 -107
- package/dist/types/utils/form/DataBinder.d.ts +0 -3
- package/package.json +4 -11
- package/dist/cjs/DataBinder-3b083480.js +0 -445
- package/dist/cjs/FocusResolver-885f2173.js +0 -35
- package/dist/collection/utils/FocusResolver.js +0 -31
- package/dist/esm/DataBinder-02fa9bb9.js +0 -441
- package/dist/esm/FocusResolver-1ccbf850.js +0 -33
- package/dist/ezui/p-0a75bb05.entry.js +0 -1
- package/dist/ezui/p-0db68715.entry.js +0 -1
- package/dist/ezui/p-19098a3f.entry.js +0 -1
- package/dist/ezui/p-1f830a2f.entry.js +0 -1
- package/dist/ezui/p-2aa8e4b2.entry.js +0 -1
- package/dist/ezui/p-3dd919b7.entry.js +0 -1
- package/dist/ezui/p-455e737c.js +0 -1
- package/dist/ezui/p-8d0f02c7.entry.js +0 -309
- package/dist/ezui/p-91266ddd.entry.js +0 -1
- package/dist/ezui/p-97af4b13.entry.js +0 -1
- package/dist/ezui/p-a5b91a77.entry.js +0 -1
- package/dist/ezui/p-a80b1287.entry.js +0 -1
- package/dist/ezui/p-b54e17d2.entry.js +0 -1
- package/dist/ezui/p-bfad39eb.entry.js +0 -1
- package/dist/ezui/p-c27b2e17.entry.js +0 -1
- package/dist/ezui/p-cd2e78f0.entry.js +0 -1
- package/dist/ezui/p-d0ca26fe.entry.js +0 -1
- package/dist/ezui/p-dc628ed3.js +0 -1
- package/dist/ezui/p-ffd246f5.entry.js +0 -1
- package/dist/types/utils/FocusResolver.d.ts +0 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApplicationContext, DataType,
|
|
2
|
-
import { Grid } from
|
|
3
|
-
import { LicenseManager } from '
|
|
1
|
+
import { ApplicationContext, DataType, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
|
2
|
+
import { Grid, } from 'ag-grid-community';
|
|
3
|
+
import { Grid as EnterpriseGrid, LicenseManager } from 'ag-grid-enterprise';
|
|
4
4
|
import DataSource from './DataSource';
|
|
5
5
|
import { EzGridCustomHeader } from './components/EzGridCustomHeader';
|
|
6
6
|
import { CellRendererStatus } from './components/cellRendererStatus';
|
|
@@ -8,12 +8,6 @@ import SelectionHeader from './components/selectionHeader';
|
|
|
8
8
|
import gridTerms from './i18n/pt-BR';
|
|
9
9
|
import { DISTINCT_FILTER_NAME_PREFIX, EZ_GRID_LOADING_SOURCE } from '../../../../utils/constants';
|
|
10
10
|
import GridEditionManager from './GridEditionManager';
|
|
11
|
-
import { ModuleRegistry } from '@ag-grid-community/core';
|
|
12
|
-
import { EnterpriseCoreModule } from '@ag-grid-enterprise/core';
|
|
13
|
-
import { RangeSelectionModule } from '@ag-grid-enterprise/range-selection';
|
|
14
|
-
import { ServerSideRowModelModule } from '@ag-grid-enterprise/server-side-row-model';
|
|
15
|
-
import { ClipboardModule } from '@ag-grid-enterprise/clipboard';
|
|
16
|
-
import { MenuModule } from '@ag-grid-enterprise/menu';
|
|
17
11
|
export default class AgGridController {
|
|
18
12
|
configFilterColumn(filterColumn) {
|
|
19
13
|
this._filterColumn = filterColumn;
|
|
@@ -33,7 +27,7 @@ export default class AgGridController {
|
|
|
33
27
|
var _a;
|
|
34
28
|
(_a = this._filterColumn) === null || _a === void 0 ? void 0 : _a.show(configs);
|
|
35
29
|
}
|
|
36
|
-
constructor(
|
|
30
|
+
constructor(enterprise) {
|
|
37
31
|
this.DEFAULT_ROW_HEIGHT = 30;
|
|
38
32
|
this.DEFAULT_HEADER_ROW_HEIGHT = 32;
|
|
39
33
|
this.CHECK_BOX_COL_ID = 'checkBoxColumn';
|
|
@@ -49,13 +43,7 @@ export default class AgGridController {
|
|
|
49
43
|
this._customFormatters = new Map();
|
|
50
44
|
this._gridShowDom = false;
|
|
51
45
|
this.peddingExecutionsOnGridShow = [];
|
|
52
|
-
|
|
53
|
-
EnterpriseCoreModule,
|
|
54
|
-
RangeSelectionModule,
|
|
55
|
-
ServerSideRowModelModule,
|
|
56
|
-
ClipboardModule,
|
|
57
|
-
MenuModule
|
|
58
|
-
]);
|
|
46
|
+
this._enterprise = enterprise;
|
|
59
47
|
}
|
|
60
48
|
getGridConfig() {
|
|
61
49
|
return this._gridConfig;
|
|
@@ -133,7 +121,6 @@ export default class AgGridController {
|
|
|
133
121
|
var _a;
|
|
134
122
|
this._options = options;
|
|
135
123
|
this._container = container;
|
|
136
|
-
const lockerId = options.enableLockManger ? LockManager.addLockManagerCtxId(this._container) : null;
|
|
137
124
|
if (this._grid === undefined) {
|
|
138
125
|
LicenseManager.setLicenseKey(ApplicationContext.getContextValue('__EZUI__GRID_LICENSE__'));
|
|
139
126
|
this._columnStateChangeCallback = options.onColumnStateChange;
|
|
@@ -141,7 +128,7 @@ export default class AgGridController {
|
|
|
141
128
|
this._doubleClickCallBack = options.onDoubleClick;
|
|
142
129
|
this._multipleSelection = options.allowMultipleSelection;
|
|
143
130
|
this._dataUnit = options.dataUnit;
|
|
144
|
-
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders, options.enableContinuousInsert, options.enableGridInsert
|
|
131
|
+
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders, options.enableContinuousInsert, options.enableGridInsert);
|
|
145
132
|
this._statusResolver = options.statusResolver;
|
|
146
133
|
if (this._dataUnit) {
|
|
147
134
|
this._dataUnit.sortingProvider = this;
|
|
@@ -188,7 +175,12 @@ export default class AgGridController {
|
|
|
188
175
|
this.setOptionsEvents(this._gridOptions);
|
|
189
176
|
this.setOptionsSupress(this._gridOptions);
|
|
190
177
|
this._gridOptions = this._editionManager.configureGrid(this._gridOptions);
|
|
191
|
-
|
|
178
|
+
if (this._enterprise) {
|
|
179
|
+
this._grid = new EnterpriseGrid(container, this._gridOptions);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this._grid = new Grid(container, this._gridOptions);
|
|
183
|
+
}
|
|
192
184
|
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
|
|
193
185
|
if (selection === null || selection === void 0 ? void 0 : selection.isAllRecords()) {
|
|
194
186
|
this.selectAll(true);
|
|
@@ -348,7 +340,7 @@ export default class AgGridController {
|
|
|
348
340
|
defineRowModelType(opt, sourceOptions) {
|
|
349
341
|
if (this._dataUnit != undefined) {
|
|
350
342
|
opt.rowModelType = 'serverSide';
|
|
351
|
-
opt.serverSideDatasource =
|
|
343
|
+
opt.serverSideDatasource = new DataSource(this._dataUnit, this, sourceOptions);
|
|
352
344
|
opt.serverSideSortOnServer = true;
|
|
353
345
|
opt.columnDefs = this._colDefs;
|
|
354
346
|
}
|
|
@@ -499,7 +491,7 @@ export default class AgGridController {
|
|
|
499
491
|
r.setData(data);
|
|
500
492
|
});
|
|
501
493
|
this._gridOptions.api.refreshCells({ force: true });
|
|
502
|
-
const invalidCell = this._editionManager.
|
|
494
|
+
const invalidCell = this._editionManager.getInvalidCell();
|
|
503
495
|
if (invalidCell) {
|
|
504
496
|
const rowNode = this._gridOptions.api.getRowNode(invalidCell.recordId);
|
|
505
497
|
if (rowNode && invalidCell.field) {
|
|
@@ -519,7 +511,6 @@ export default class AgGridController {
|
|
|
519
511
|
if (this._grid === undefined) {
|
|
520
512
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
521
513
|
}
|
|
522
|
-
this._gridOptions.api.clearRangeSelection();
|
|
523
514
|
this._gridOptions.api.refreshServerSide({ purge: true });
|
|
524
515
|
this._options.onRefresh();
|
|
525
516
|
if (scrollToSelectedRow)
|
|
@@ -542,15 +533,12 @@ export default class AgGridController {
|
|
|
542
533
|
}
|
|
543
534
|
setFocus() {
|
|
544
535
|
var _a, _b;
|
|
545
|
-
if (
|
|
546
|
-
this.focusOnGridContainer();
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
if (!this._dataUnit.getSelectedRecord()) {
|
|
536
|
+
if ((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) {
|
|
550
537
|
this.setFocusFirstRow();
|
|
551
|
-
return;
|
|
552
538
|
}
|
|
553
|
-
|
|
539
|
+
else {
|
|
540
|
+
this.focusOnGridContainer();
|
|
541
|
+
}
|
|
554
542
|
}
|
|
555
543
|
setAutoFocus(autoFocus) {
|
|
556
544
|
var _a;
|
|
@@ -594,23 +582,6 @@ export default class AgGridController {
|
|
|
594
582
|
this.startEditionOnRowByIndex(newRowIndex);
|
|
595
583
|
}
|
|
596
584
|
}
|
|
597
|
-
syncSelectWithDataUnit() {
|
|
598
|
-
const rowNode = this._gridOptions.api.getRowNode(this._dataUnit.getSelectedRecord().__record__id__);
|
|
599
|
-
if ((rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex) < 0)
|
|
600
|
-
return;
|
|
601
|
-
const rowRange = this._gridOptions.api.getCellRanges().find(row => row.startRow.rowIndex === rowNode.rowIndex);
|
|
602
|
-
if ((rowRange === null || rowRange === void 0 ? void 0 : rowRange.columns.length) > 0) {
|
|
603
|
-
if (this._dataUnit.hasNewRecord()) {
|
|
604
|
-
this.startEdition(rowNode.rowIndex, rowRange.columns[0]);
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
this.focusByCollAndRow(rowRange.columns[0], rowNode.rowIndex);
|
|
608
|
-
this._gridOptions.api.addCellRange({ rowStartIndex: rowNode.rowIndex, rowEndIndex: rowNode.rowIndex, columns: rowRange.columns });
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
this._gridOptions.api.clearRangeSelection();
|
|
612
|
-
this.setFocusOnRow(rowNode.rowIndex);
|
|
613
|
-
}
|
|
614
585
|
startEdition(rowIndex, firstCol) {
|
|
615
586
|
this._gridOptions.api.clearRangeSelection();
|
|
616
587
|
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstCol] });
|
|
@@ -641,7 +612,6 @@ export default class AgGridController {
|
|
|
641
612
|
let displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
|
|
642
613
|
let firstColl = displayedColumns.find(column => column.getColDef().headerName !== '');
|
|
643
614
|
this.focusByCollAndRow(firstColl, rowIndex);
|
|
644
|
-
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstColl] });
|
|
645
615
|
}
|
|
646
616
|
focusByCollAndRow(firstCell, rowIndex) {
|
|
647
617
|
this._gridOptions.api.ensureColumnVisible(firstCell);
|
|
@@ -681,14 +651,6 @@ export default class AgGridController {
|
|
|
681
651
|
this._gridOptions.api.setColumnDefs(this._colDefs);
|
|
682
652
|
}
|
|
683
653
|
}
|
|
684
|
-
hideSelectionColumn() {
|
|
685
|
-
var _a, _b;
|
|
686
|
-
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.columnApi) === null || _b === void 0 ? void 0 : _b.setColumnVisible(this.CHECK_BOX_COL_ID, false);
|
|
687
|
-
}
|
|
688
|
-
showSelectionColumn() {
|
|
689
|
-
var _a, _b;
|
|
690
|
-
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.columnApi) === null || _b === void 0 ? void 0 : _b.setColumnVisible(this.CHECK_BOX_COL_ID, true);
|
|
691
|
-
}
|
|
692
654
|
getColumnsDef() {
|
|
693
655
|
if (this._grid === undefined) {
|
|
694
656
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
@@ -973,24 +935,18 @@ export default class AgGridController {
|
|
|
973
935
|
return false;
|
|
974
936
|
}
|
|
975
937
|
onSelectionChange(event) {
|
|
976
|
-
var _a, _b;
|
|
977
|
-
const selectedRowId = (_b = (_a = event.api.getSelectedNodes()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id;
|
|
978
|
-
const isNewRecord = this._dataUnit.isNewRecord(selectedRowId);
|
|
979
938
|
if (!this._selectionChangeCallback)
|
|
980
939
|
return;
|
|
981
940
|
clearTimeout(this._selectionChangeDeboucing);
|
|
982
|
-
this._selectionChangeDeboucing = window.setTimeout(
|
|
983
|
-
|
|
984
|
-
if (!saveSuccess)
|
|
985
|
-
return;
|
|
941
|
+
this._selectionChangeDeboucing = window.setTimeout(() => {
|
|
942
|
+
this.handleExecuteProceedAutosave();
|
|
986
943
|
this.processBuildSelectionChangeCallback(event);
|
|
987
944
|
}, 0);
|
|
988
945
|
}
|
|
989
|
-
|
|
946
|
+
handleExecuteProceedAutosave() {
|
|
990
947
|
if (this._gridShowDom) {
|
|
991
|
-
|
|
948
|
+
this._editionManager.proceedAutoSave();
|
|
992
949
|
}
|
|
993
|
-
return true;
|
|
994
950
|
}
|
|
995
951
|
processBuildSelectionChangeCallback(event) {
|
|
996
952
|
if (this._dataUnit) {
|
|
@@ -1015,7 +971,7 @@ export default class AgGridController {
|
|
|
1015
971
|
});
|
|
1016
972
|
}
|
|
1017
973
|
onRowDoubleClick(evt) {
|
|
1018
|
-
if (this._doubleClickCallBack
|
|
974
|
+
if (this._doubleClickCallBack) {
|
|
1019
975
|
this._doubleClickCallBack(evt.data);
|
|
1020
976
|
}
|
|
1021
977
|
}
|
|
@@ -1031,11 +987,13 @@ export default class AgGridController {
|
|
|
1031
987
|
}
|
|
1032
988
|
}
|
|
1033
989
|
setCellEditors(customEditors) {
|
|
990
|
+
var _a;
|
|
1034
991
|
if (!this._editionManager) {
|
|
1035
992
|
this._customEditors = customEditors;
|
|
1036
993
|
return;
|
|
1037
994
|
}
|
|
1038
995
|
this._editionManager.setCellEditors(customEditors);
|
|
996
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
1039
997
|
}
|
|
1040
998
|
setCellRenders(customRenders) {
|
|
1041
999
|
var _a;
|
|
@@ -1056,19 +1014,6 @@ export default class AgGridController {
|
|
|
1056
1014
|
this._editionManager.processContinuousInsert();
|
|
1057
1015
|
}
|
|
1058
1016
|
destroy() {
|
|
1059
|
-
var _a;
|
|
1060
1017
|
this.observer.disconnect();
|
|
1061
|
-
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1062
|
-
}
|
|
1063
|
-
registryListeners() {
|
|
1064
|
-
var _a;
|
|
1065
|
-
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.registryListeners();
|
|
1066
|
-
}
|
|
1067
|
-
resetPaginationState() {
|
|
1068
|
-
var _a, _b;
|
|
1069
|
-
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.clearRangeSelection();
|
|
1070
|
-
}
|
|
1071
|
-
stopEdit() {
|
|
1072
|
-
this._gridOptions.api.stopEditing();
|
|
1073
1018
|
}
|
|
1074
1019
|
}
|
|
@@ -6,14 +6,12 @@ export default class DataSource {
|
|
|
6
6
|
this._controller.clearInvalidCells();
|
|
7
7
|
this.handleRefreshOrReload(action);
|
|
8
8
|
this._controller.processContinuousInsert();
|
|
9
|
-
this._controller.showSelectionColumn();
|
|
10
9
|
}
|
|
11
10
|
handleEditionCanceled(action) {
|
|
12
11
|
if (this._options.enableGridInsert) {
|
|
13
12
|
this._controller.processEditionCanceled();
|
|
14
13
|
}
|
|
15
14
|
this.handleRefreshOrReload(action);
|
|
16
|
-
this._controller.showSelectionColumn();
|
|
17
15
|
}
|
|
18
16
|
handleSavingCanceled(action) {
|
|
19
17
|
var _a, _b, _c, _d;
|
|
@@ -68,7 +66,6 @@ export default class DataSource {
|
|
|
68
66
|
}
|
|
69
67
|
handleRecordsAdded() {
|
|
70
68
|
if (this._options.enableGridInsert) {
|
|
71
|
-
this._controller.hideSelectionColumn();
|
|
72
69
|
this._controller.refresh();
|
|
73
70
|
this.focusOnNewRecord();
|
|
74
71
|
}
|
|
@@ -216,11 +213,6 @@ export default class DataSource {
|
|
|
216
213
|
destroy() {
|
|
217
214
|
this._dataUnit.unsubscribe(this.duObserver);
|
|
218
215
|
}
|
|
219
|
-
registryListeners() {
|
|
220
|
-
var _a, _b;
|
|
221
|
-
(_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.duObserver);
|
|
222
|
-
(_b = this._dataUnit) === null || _b === void 0 ? void 0 : _b.subscribe(this.duObserver);
|
|
223
|
-
}
|
|
224
216
|
buildColumnDefs() {
|
|
225
217
|
const gridConfig = this._controller.getGridConfig() || [];
|
|
226
218
|
const columnDefs = [];
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { KeyCode, } from
|
|
1
|
+
import { UserInterface } from '@sankhyalabs/core';
|
|
2
|
+
import { KeyCode, } from 'ag-grid-community';
|
|
3
3
|
import { RecordValidationProcessor } from '../../../../utils/validators/recordvalidator/RecordValidationProcessor';
|
|
4
4
|
import EzCellEditor from './editor/EzCellEditor';
|
|
5
5
|
import EzGridCustomCellEditor from './components/EzGridCustomCellEditor';
|
|
6
6
|
import EzGridCustomCellRender from './components/EzGridCustomCellRender';
|
|
7
|
-
import { DataBinder } from '../../../../utils';
|
|
8
7
|
export default class GridEditionManager {
|
|
9
|
-
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders, enableContinuousInsert, enableGridInsert
|
|
8
|
+
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders, enableContinuousInsert, enableGridInsert) {
|
|
10
9
|
this._dataUnit = dataUnit;
|
|
11
10
|
this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
|
|
12
11
|
getRequiredFields: () => this.getRequiredFields(),
|
|
13
|
-
markAsInvalid: (invalidField, recordId) => { this.
|
|
12
|
+
markAsInvalid: (invalidField, recordId) => { this.setInvalidCell(invalidField, recordId); },
|
|
14
13
|
getMessageForField: () => null,
|
|
15
14
|
}, recordsValidator);
|
|
16
15
|
this._useEnterLikeTab = useEnterLikeTab;
|
|
@@ -19,34 +18,16 @@ export default class GridEditionManager {
|
|
|
19
18
|
this._enableGridInsert = enableGridInsert;
|
|
20
19
|
this._customEditors = customEditors;
|
|
21
20
|
this._customRenders = customRenders;
|
|
22
|
-
this._lockerId = lockerId;
|
|
23
21
|
}
|
|
24
22
|
configureGrid(options) {
|
|
25
23
|
this._gridOptions = options;
|
|
26
24
|
options.readOnlyEdit = true;
|
|
27
25
|
options.onCellEditRequest = evt => this.onCellEditRequest(evt);
|
|
28
|
-
options.onCellEditingStarted = async (evt) => {
|
|
29
|
-
var _a;
|
|
30
|
-
if (this._dataUnit.hasNewRecord()) {
|
|
31
|
-
this.handleCellEditingStartedRowAdd(evt);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this._lastCellOpened = this._lastCellEdited = { rowIndex: evt.rowIndex, column: evt.column, rowPinned: undefined };
|
|
35
|
-
}
|
|
36
|
-
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
37
|
-
this._currentEditLock = LockManager.lock(this._lockerId, LockManagerOperation.TASKBAR_CLICK);
|
|
38
|
-
};
|
|
39
|
-
options.onCellEditingStopped = () => {
|
|
40
|
-
var _a;
|
|
41
|
-
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
42
|
-
};
|
|
43
26
|
options.onCellKeyDown = evt => {
|
|
44
27
|
if (evt.event && evt["column"]) {
|
|
45
28
|
this.onCellKeyDown(evt);
|
|
46
29
|
}
|
|
47
30
|
};
|
|
48
|
-
options.isRowSelectable = (node) => this.isSelectableRow(node);
|
|
49
|
-
options.onCellFocused = () => this.lockFocusWhenAddRow();
|
|
50
31
|
return options;
|
|
51
32
|
}
|
|
52
33
|
updateCurrentEditorGuiValue(updatedRowValue) {
|
|
@@ -59,82 +40,37 @@ export default class GridEditionManager {
|
|
|
59
40
|
const value = updatedRowValue[fieldName];
|
|
60
41
|
currentEditor.setGuiValue(value);
|
|
61
42
|
}
|
|
62
|
-
lockFocusWhenAddRow() {
|
|
63
|
-
var _a, _b, _c, _d;
|
|
64
|
-
const api = this._gridOptions.api;
|
|
65
|
-
const newFocusCell = api.getFocusedCell();
|
|
66
|
-
const rowIndex = newFocusCell === null || newFocusCell === void 0 ? void 0 : newFocusCell.rowIndex;
|
|
67
|
-
const recordId = (_b = (_a = this._dataUnit.getAddedRecords()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.__record__id__;
|
|
68
|
-
const rowNode = api.getRowNode(recordId);
|
|
69
|
-
if (!this._dataUnit.hasNewRecord() || rowIndex == (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex)) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const lastCell = (_d = (_c = this._lastCellOpened) !== null && _c !== void 0 ? _c : this._lastCellEdited) !== null && _d !== void 0 ? _d : this._lastCellClicked;
|
|
73
|
-
if ((lastCell === null || lastCell === void 0 ? void 0 : lastCell.rowIndex) < (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex)) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
api.clearFocusedCell();
|
|
77
|
-
if (!lastCell || (rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex) == undefined) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
lastCell.rowIndex = rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex;
|
|
81
|
-
this.focusOnCell(lastCell);
|
|
82
|
-
}
|
|
83
|
-
handleCellEditingStartedRowAdd(evt) {
|
|
84
|
-
var _a, _b, _c, _d, _e;
|
|
85
|
-
const nodeId = (_a = evt.node) === null || _a === void 0 ? void 0 : _a.id;
|
|
86
|
-
const addedRecordId = (_c = (_b = this._dataUnit.getAddedRecords()) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
87
|
-
if (nodeId == addedRecordId) {
|
|
88
|
-
this._lastCellOpened = this._lastCellEdited = { rowIndex: evt.rowIndex, column: evt === null || evt === void 0 ? void 0 : evt.column, rowPinned: undefined };
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
evt.api.stopEditing();
|
|
92
|
-
const rowIndex = (_d = evt.api.getRowNode(addedRecordId)) === null || _d === void 0 ? void 0 : _d.rowIndex;
|
|
93
|
-
this._lastCellOpened = this._lastCellEdited = { rowIndex: rowIndex, column: (_e = this._lastCellEdited) === null || _e === void 0 ? void 0 : _e.column, rowPinned: undefined };
|
|
94
|
-
}
|
|
95
|
-
isSelectableRow(node) {
|
|
96
|
-
if (!this._dataUnit.hasNewRecord()) {
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
if (!this._dataUnit.isNewRecord(node.id)) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
43
|
canContinuousInsert() {
|
|
105
44
|
var _a;
|
|
106
45
|
return this._enableContinuousInsert && (this._dataUnit.records.length - 1) === ((_a = this._lastCellEdited) === null || _a === void 0 ? void 0 : _a.rowIndex);
|
|
107
46
|
}
|
|
108
|
-
|
|
47
|
+
proceedAutoSave() {
|
|
109
48
|
if (!this._dataUnit.isDirty()) {
|
|
110
49
|
this.saveSuccess();
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
const currentRecord = this._dataUnit.getSelectedRecord();
|
|
114
|
-
if (currentRecord == undefined) {
|
|
115
|
-
return true;
|
|
50
|
+
return;
|
|
116
51
|
}
|
|
117
|
-
this.
|
|
118
|
-
|
|
119
|
-
await this._recordValidationProcessor.validate(true);
|
|
120
|
-
await this.saveDataUnit();
|
|
121
|
-
this.saveSuccess();
|
|
122
|
-
return true;
|
|
52
|
+
if (!this._isGridEdition) {
|
|
53
|
+
return;
|
|
123
54
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return
|
|
55
|
+
const currentRercord = this._dataUnit.getSelectedRecord();
|
|
56
|
+
if (currentRercord == undefined) {
|
|
57
|
+
return;
|
|
127
58
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
59
|
+
this._invalidCell = undefined;
|
|
60
|
+
this._recordValidationProcessor
|
|
61
|
+
.validate(true)
|
|
62
|
+
.then(() => {
|
|
63
|
+
this._dataUnit.saveData()
|
|
64
|
+
.then(() => this.saveSuccess())
|
|
65
|
+
.catch(reason => this.saveFail(reason));
|
|
66
|
+
})
|
|
67
|
+
.catch(reason => this.saveFail(reason));
|
|
132
68
|
}
|
|
133
69
|
async recordValidate() {
|
|
134
70
|
if (!this._dataUnit.isDirty())
|
|
135
71
|
return;
|
|
136
72
|
try {
|
|
137
|
-
this.
|
|
73
|
+
this._invalidCell = undefined;
|
|
138
74
|
await this._recordValidationProcessor.validate(false);
|
|
139
75
|
}
|
|
140
76
|
catch (error) { }
|
|
@@ -162,13 +98,6 @@ export default class GridEditionManager {
|
|
|
162
98
|
return { ezCellEditor: EzCellEditor };
|
|
163
99
|
}
|
|
164
100
|
verifyClickToEdition(api, cellClicked) {
|
|
165
|
-
var _a, _b;
|
|
166
|
-
const selectedRecordID = (_a = this._dataUnit.getSelectedRecord()) === null || _a === void 0 ? void 0 : _a.__record__id__;
|
|
167
|
-
if (this._dataUnit.hasNewRecord() && selectedRecordID) {
|
|
168
|
-
const dataUnitRecordIndex = (_b = api.getRowNode(selectedRecordID)) === null || _b === void 0 ? void 0 : _b.rowIndex;
|
|
169
|
-
if (dataUnitRecordIndex != cellClicked.rowIndex)
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
101
|
if (this.isSecondClick(cellClicked)) {
|
|
173
102
|
api.startEditingCell({ rowIndex: cellClicked.rowIndex, colKey: cellClicked.column.getColId() });
|
|
174
103
|
}
|
|
@@ -178,9 +107,6 @@ export default class GridEditionManager {
|
|
|
178
107
|
col.cellEditor = 'ezCellEditor';
|
|
179
108
|
col.editable = params => this.canEdit(params);
|
|
180
109
|
col.suppressKeyboardEvent = (params) => {
|
|
181
|
-
if (params.event.key === KeyCode.ESCAPE && params.editing) {
|
|
182
|
-
return this._dataUnit.isDirty();
|
|
183
|
-
}
|
|
184
110
|
return params.event.key === KeyCode.ENTER;
|
|
185
111
|
};
|
|
186
112
|
col.cellEditorSelector = (params) => {
|
|
@@ -210,21 +136,10 @@ export default class GridEditionManager {
|
|
|
210
136
|
return col;
|
|
211
137
|
}
|
|
212
138
|
getRequiredFields() {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return (fieldDefinition && fieldDefinition.required) || formRequiredFields.includes(column.getColId());
|
|
218
|
-
})
|
|
219
|
-
.map(column => column.getColId());
|
|
220
|
-
}
|
|
221
|
-
getFormRequiredFields() {
|
|
222
|
-
const formRequiredFields = [];
|
|
223
|
-
const dataBinders = DataBinder.getDataBindersByDataUnit(this._dataUnit);
|
|
224
|
-
dataBinders.forEach(dataBinder => {
|
|
225
|
-
formRequiredFields.push(...dataBinder.getFormRequiredFields());
|
|
226
|
-
});
|
|
227
|
-
return formRequiredFields;
|
|
139
|
+
return this._gridOptions.columnApi.getAllDisplayedColumns().filter(c => {
|
|
140
|
+
const fieldDefinition = this._dataUnit.getField(c.getColId());
|
|
141
|
+
return fieldDefinition && fieldDefinition.required;
|
|
142
|
+
}).map(c => c.getColId());
|
|
228
143
|
}
|
|
229
144
|
saveSuccess() {
|
|
230
145
|
var _a;
|
|
@@ -237,11 +152,10 @@ export default class GridEditionManager {
|
|
|
237
152
|
this._isGridEdition = false;
|
|
238
153
|
}
|
|
239
154
|
saveFail(reason) {
|
|
240
|
-
|
|
241
|
-
this.focusOnCell((_a = this._lastCellOpened) !== null && _a !== void 0 ? _a : this._lastCellEdited);
|
|
155
|
+
this.focusOnCell(this._lastCellEdited);
|
|
242
156
|
this._isGridEdition = false;
|
|
243
157
|
if (reason) {
|
|
244
|
-
|
|
158
|
+
Promise.reject(reason);
|
|
245
159
|
}
|
|
246
160
|
}
|
|
247
161
|
focusOnCell(cell) {
|
|
@@ -306,9 +220,6 @@ export default class GridEditionManager {
|
|
|
306
220
|
this.moveEditionVertically(api, 1);
|
|
307
221
|
}
|
|
308
222
|
moveEditionVertically(api, offset) {
|
|
309
|
-
if (this._dataUnit.hasNewRecord() && this._isGridEdition) {
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
223
|
const editionCell = api.getEditingCells()[0];
|
|
313
224
|
if (!editionCell) {
|
|
314
225
|
return;
|
|
@@ -353,66 +264,41 @@ export default class GridEditionManager {
|
|
|
353
264
|
return true;
|
|
354
265
|
}
|
|
355
266
|
onCellEditRequest(event) {
|
|
356
|
-
var _a;
|
|
357
|
-
const value = event.newValue;
|
|
358
|
-
if (event.oldValue == value) {
|
|
359
|
-
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
if (value instanceof Promise) {
|
|
363
|
-
this.handlePromiseValue(event, value);
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
this.updateCellValue(event, value);
|
|
367
|
-
}
|
|
368
|
-
async handlePromiseValue(event, value) {
|
|
369
267
|
const fieldName = event.colDef.field;
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
(_a = this._currentEditLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
381
|
-
if (event.oldValue !== newValue) {
|
|
268
|
+
const value = event.newValue;
|
|
269
|
+
if (event.oldValue != value) {
|
|
270
|
+
if (value instanceof Promise) {
|
|
271
|
+
const fieldDescriptor = this._dataUnit.getField(event.colDef.colId);
|
|
272
|
+
event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: (fieldDescriptor === null || fieldDescriptor === void 0 ? void 0 : fieldDescriptor.userInterface) === UserInterface.SEARCH ? value : event.oldValue }));
|
|
273
|
+
value.then(resolved => event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: resolved })));
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: value }));
|
|
277
|
+
}
|
|
382
278
|
this._isGridEdition = true;
|
|
383
|
-
this._dataUnit.setFieldValue(fieldName,
|
|
279
|
+
this._dataUnit.setFieldValue(fieldName, value, [event.data.__record__id__], { suppressCreateNewRecord: true });
|
|
384
280
|
this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
|
|
385
281
|
}
|
|
386
282
|
}
|
|
387
283
|
setCellEditors(customEditors) {
|
|
388
|
-
var _a, _b;
|
|
389
284
|
this._customEditors = customEditors;
|
|
390
|
-
if (!customEditors.has((_b = (_a = this._lastCellOpened) === null || _a === void 0 ? void 0 : _a.column) === null || _b === void 0 ? void 0 : _b.getColId()))
|
|
391
|
-
return;
|
|
392
|
-
this._gridOptions.api.stopEditing();
|
|
393
|
-
window.requestAnimationFrame(() => this.focusOnCell(this._lastCellOpened));
|
|
394
285
|
}
|
|
395
286
|
setCellRenders(customRenders) {
|
|
396
287
|
this._customRenders = customRenders;
|
|
397
288
|
}
|
|
398
|
-
|
|
399
|
-
this.
|
|
400
|
-
this._nextInvalidCell = this._invalidCells[0];
|
|
401
|
-
}
|
|
402
|
-
getInvalidCells() {
|
|
403
|
-
return this._invalidCells;
|
|
289
|
+
setInvalidCell(invalidCell, recordId) {
|
|
290
|
+
this._invalidCell = { field: invalidCell, recordId };
|
|
404
291
|
}
|
|
405
|
-
|
|
406
|
-
return this.
|
|
292
|
+
getInvalidCell() {
|
|
293
|
+
return this._invalidCell;
|
|
407
294
|
}
|
|
408
|
-
|
|
295
|
+
processContinuousInsert() {
|
|
409
296
|
if (!this.canContinuousInsert())
|
|
410
297
|
return;
|
|
411
298
|
this._dataUnit.addRecord();
|
|
412
299
|
}
|
|
413
300
|
clearInvalidCells(stopEdition) {
|
|
414
|
-
this.
|
|
415
|
-
this._nextInvalidCell = undefined;
|
|
301
|
+
this._invalidCell = undefined;
|
|
416
302
|
if (stopEdition) {
|
|
417
303
|
this._isGridEdition = false;
|
|
418
304
|
}
|
|
@@ -423,17 +309,10 @@ export default class GridEditionManager {
|
|
|
423
309
|
hasInvalidField(fieldName, recordId) {
|
|
424
310
|
if (!this.hasInvalidCell())
|
|
425
311
|
return false;
|
|
426
|
-
this.
|
|
427
|
-
const containsFieldName = this._nextInvalidCell.field.name === fieldName;
|
|
428
|
-
const containsRecordId = this._nextInvalidCell.recordId === recordId;
|
|
429
|
-
return containsFieldName && containsRecordId;
|
|
312
|
+
return this._invalidCell.field.name === fieldName && this._invalidCell.recordId === recordId;
|
|
430
313
|
}
|
|
431
314
|
hasInvalidCell() {
|
|
432
|
-
|
|
433
|
-
const hasInvalidCell = ((_a = this._invalidCells) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
434
|
-
const hasField = (_b = this._invalidCells) === null || _b === void 0 ? void 0 : _b.filter(invalidCell => { invalidCell.field; });
|
|
435
|
-
const hasRecordId = (_c = this._invalidCells) === null || _c === void 0 ? void 0 : _c.filter(invalidCell => { invalidCell.recordId; });
|
|
436
|
-
if (!hasInvalidCell || !hasField || !hasRecordId)
|
|
315
|
+
if (!this._invalidCell || !this._invalidCell.field || !this._invalidCell.recordId)
|
|
437
316
|
return false;
|
|
438
317
|
return true;
|
|
439
318
|
}
|
package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js
CHANGED
|
@@ -2,7 +2,6 @@ import { HTMLBuilder } from "@sankhyalabs/core";
|
|
|
2
2
|
import { CustomEditorSource } from "../../../../../utils/customEditor/interfaces/ICustomEditor";
|
|
3
3
|
import EzCellEditor from "../editor/EzCellEditor";
|
|
4
4
|
import { getViewPortHeight } from "../editor/GridEditorUtils";
|
|
5
|
-
import FocusResolver from "../../../../../utils/FocusResolver";
|
|
6
5
|
export default class EzGridCustomCellEditor extends EzCellEditor {
|
|
7
6
|
init(params) {
|
|
8
7
|
var _a, _b;
|
|
@@ -66,10 +65,4 @@ export default class EzGridCustomCellEditor extends EzCellEditor {
|
|
|
66
65
|
return this._customGui.value;
|
|
67
66
|
return this._value;
|
|
68
67
|
}
|
|
69
|
-
afterGuiAttached() {
|
|
70
|
-
this.focusIn();
|
|
71
|
-
}
|
|
72
|
-
focusIn() {
|
|
73
|
-
FocusResolver.resolveFocus(this._customGui);
|
|
74
|
-
}
|
|
75
68
|
}
|
package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js
CHANGED
|
@@ -19,7 +19,6 @@ export const buildComboBox = ({ required, props, eGridCell }) => {
|
|
|
19
19
|
combo.options = options;
|
|
20
20
|
combo.stopPropagateEnterKeyEvent = true;
|
|
21
21
|
combo.listOptionsPosition = { verticalPosition: 29, bottomLimit: getViewPortHeight(eGridCell), hardPosition: true };
|
|
22
|
-
combo.autoFocus = true;
|
|
23
22
|
return combo;
|
|
24
23
|
};
|
|
25
24
|
export const buildSwitch = (fieldMetadata) => {
|
package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js
CHANGED
|
@@ -13,7 +13,6 @@ export const buildSearch = ({ name, required, readOnly, eGridCell, dataUnit }) =
|
|
|
13
13
|
ezSearch.suppressPreLoad = true;
|
|
14
14
|
ezSearch.listOptionsPosition = { verticalPosition: 29, bottomLimit: getViewPortHeight(eGridCell), hardPosition: true };
|
|
15
15
|
ezSearch.stopPropagateEnterKeyEvent = true;
|
|
16
|
-
ezSearch.autoFocus = true;
|
|
17
16
|
ezSearch.valueGetter = () => ezSearch.getValueAsync();
|
|
18
17
|
return ezSearch;
|
|
19
18
|
};
|