@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-78812.3 → 0.0.0-bugfix-dev-KB-76362.1
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-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 +2 -2
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +20 -13
- package/dist/cjs/ez-chart.cjs.entry.js +2 -2
- 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 +11 -47
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +4 -5
- package/dist/cjs/ez-date-input.cjs.entry.js +3 -9
- package/dist/cjs/ez-date-time-input.cjs.entry.js +3 -9
- package/dist/cjs/ez-dialog.cjs.entry.js +3 -11
- package/dist/cjs/ez-dropdown_2.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 +3 -3
- package/dist/cjs/ez-form.cjs.entry.js +326 -6
- package/dist/cjs/ez-grid.cjs.entry.js +70519 -14637
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +2 -2
- package/dist/cjs/ez-list.cjs.entry.js +101 -152
- 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 +2 -2
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -8
- package/dist/cjs/ez-popover.cjs.entry.js +2 -2
- 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 +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +23 -72
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
- 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 +5 -67
- package/dist/cjs/ez-text-input.cjs.entry.js +8 -50
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -7
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- 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} +3 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-button/ez-button.css +2 -2
- 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/custom-input/ez-custom-form-input.js +2 -3
- 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 +27 -100
- 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 -164
- 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-icon/ez-icon.css +149 -153
- 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-modal/ez-modal.css +0 -4
- package/dist/collection/components/ez-modal/ez-modal.js +2 -2
- 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.css +7 -3
- package/dist/collection/components/ez-search/ez-search.css +1 -1
- package/dist/collection/components/ez-search/ez-search.js +24 -98
- package/dist/collection/components/ez-split-button/ez-split-button.css +2 -2
- 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/form/FormMetadata.js +1 -1
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/custom-elements/index.js +71095 -15526
- package/dist/esm/RecordValidationProcessor-9c6cc267.js +105 -0
- 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 +2 -2
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +20 -13
- package/dist/esm/ez-chart.entry.js +2 -2
- 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 +12 -48
- package/dist/esm/ez-custom-form-input_2.entry.js +4 -5
- package/dist/esm/ez-date-input.entry.js +3 -9
- package/dist/esm/ez-date-time-input.entry.js +3 -9
- package/dist/esm/ez-dialog.entry.js +3 -11
- package/dist/esm/ez-dropdown_2.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +3 -3
- package/dist/esm/ez-form.entry.js +325 -5
- package/dist/esm/ez-grid.entry.js +70546 -14664
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +102 -153
- 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 +2 -2
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -8
- package/dist/esm/ez-popover.entry.js +2 -2
- 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 +1 -1
- package/dist/esm/ez-search.entry.js +23 -72
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +2 -2
- 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 +5 -67
- package/dist/esm/ez-text-input.entry.js +8 -50
- package/dist/esm/ez-time-input.entry.js +1 -7
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- 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} +3 -1
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-00687830.entry.js +1 -0
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- package/dist/ezui/p-044d46d5.entry.js +1 -0
- 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-190c190f.entry.js +304 -0
- package/dist/ezui/{p-8888d9ed.entry.js → p-1b08bf3c.entry.js} +1 -1
- package/dist/ezui/p-2de9f0aa.entry.js +1 -0
- package/dist/ezui/{p-baf80b13.entry.js → p-30951bd7.entry.js} +1 -1
- package/dist/ezui/p-36180f4d.entry.js +1 -0
- package/dist/ezui/{p-7409eeaa.entry.js → p-3b546374.entry.js} +1 -1
- package/dist/ezui/p-3f8c33e0.entry.js +1 -0
- package/dist/ezui/p-52100a6e.entry.js +1 -0
- package/dist/ezui/{p-6d79930d.entry.js → p-554522db.entry.js} +1 -1
- package/dist/ezui/p-5a40c77a.entry.js +1 -0
- package/dist/ezui/p-61059f6b.entry.js +1 -0
- package/dist/ezui/p-68267f59.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-f9e551de.entry.js → p-70f1c812.entry.js} +1 -1
- 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-823cc11b.entry.js +1 -0
- package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
- package/dist/ezui/p-85b500bb.entry.js +1 -0
- package/dist/ezui/{p-bcb53f27.entry.js → p-868b56f7.entry.js} +1 -1
- package/dist/ezui/p-8ac13678.entry.js +1 -0
- package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
- package/dist/ezui/{p-c0d9c4f8.entry.js → p-92748142.entry.js} +1 -1
- package/dist/ezui/p-940760bf.entry.js +1 -0
- package/dist/ezui/p-9e08ddb0.entry.js +1 -0
- package/dist/ezui/{p-c4320a39.entry.js → p-a563df31.entry.js} +1 -1
- package/dist/ezui/{p-990b4318.entry.js → p-a921e3e7.entry.js} +1 -1
- package/dist/ezui/p-b2a1398f.entry.js +1 -0
- package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
- package/dist/ezui/{p-c3045972.entry.js → p-b858fc6e.entry.js} +1 -1
- package/dist/ezui/p-ba5f4ee7.entry.js +1 -0
- package/dist/ezui/{p-e347df9c.entry.js → p-bef7daac.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/p-d40b93a7.entry.js +1 -0
- package/dist/ezui/p-d4aba783.entry.js +1 -0
- package/dist/ezui/{p-7fdd479f.entry.js → p-e18d9e6a.entry.js} +1 -1
- package/dist/ezui/p-e3ec7422.entry.js +1 -0
- 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-90bcd2ba.entry.js → p-e7395eae.entry.js} +1 -1
- package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
- package/dist/ezui/p-f291db18.entry.js +1 -0
- package/dist/ezui/p-f42855b9.js +1 -0
- package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
- 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-modal/ez-modal.d.ts +1 -1
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +0 -4
- package/dist/types/components/ez-search/ez-search.d.ts +2 -10
- 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 +44 -109
- 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-15d7af92.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-2bb2a0c4.entry.js +0 -1
- package/dist/ezui/p-3175fe8c.entry.js +0 -1
- package/dist/ezui/p-43b41d3e.entry.js +0 -309
- package/dist/ezui/p-455e737c.js +0 -1
- package/dist/ezui/p-7ed30844.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-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-bfad39eb.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-d24a7b4c.entry.js +0 -1
- package/dist/ezui/p-dc628ed3.js +0 -1
- package/dist/ezui/p-dc8b36c3.entry.js +0 -1
- package/dist/ezui/p-e5e16038.entry.js +0 -1
- package/dist/ezui/p-fec696ab.entry.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) {
|
|
@@ -509,8 +501,6 @@ export default class AgGridController {
|
|
|
509
501
|
}
|
|
510
502
|
}
|
|
511
503
|
savingCanceled(fields, recordId) {
|
|
512
|
-
if (!this._gridShowDom)
|
|
513
|
-
return;
|
|
514
504
|
const displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
|
|
515
505
|
const rowIndex = this._gridOptions.api.getRowNode(recordId).rowIndex;
|
|
516
506
|
const columnFocus = displayedColumns.find(column => this.isColumnEditable(rowIndex, column) && fields.find(field => field.name === column.getColId()));
|
|
@@ -521,7 +511,6 @@ export default class AgGridController {
|
|
|
521
511
|
if (this._grid === undefined) {
|
|
522
512
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
523
513
|
}
|
|
524
|
-
this._gridOptions.api.clearRangeSelection();
|
|
525
514
|
this._gridOptions.api.refreshServerSide({ purge: true });
|
|
526
515
|
this._options.onRefresh();
|
|
527
516
|
if (scrollToSelectedRow)
|
|
@@ -544,15 +533,12 @@ export default class AgGridController {
|
|
|
544
533
|
}
|
|
545
534
|
setFocus() {
|
|
546
535
|
var _a, _b;
|
|
547
|
-
if (
|
|
548
|
-
this.focusOnGridContainer();
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
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) {
|
|
552
537
|
this.setFocusFirstRow();
|
|
553
|
-
return;
|
|
554
538
|
}
|
|
555
|
-
|
|
539
|
+
else {
|
|
540
|
+
this.focusOnGridContainer();
|
|
541
|
+
}
|
|
556
542
|
}
|
|
557
543
|
setAutoFocus(autoFocus) {
|
|
558
544
|
var _a;
|
|
@@ -596,26 +582,7 @@ export default class AgGridController {
|
|
|
596
582
|
this.startEditionOnRowByIndex(newRowIndex);
|
|
597
583
|
}
|
|
598
584
|
}
|
|
599
|
-
syncSelectWithDataUnit() {
|
|
600
|
-
const rowNode = this._gridOptions.api.getRowNode(this._dataUnit.getSelectedRecord().__record__id__);
|
|
601
|
-
if ((rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex) < 0)
|
|
602
|
-
return;
|
|
603
|
-
const rowRange = this._gridOptions.api.getCellRanges().find(row => row.startRow.rowIndex === rowNode.rowIndex);
|
|
604
|
-
if ((rowRange === null || rowRange === void 0 ? void 0 : rowRange.columns.length) > 0) {
|
|
605
|
-
if (this._dataUnit.hasNewRecord()) {
|
|
606
|
-
this.startEdition(rowNode.rowIndex, rowRange.columns[0]);
|
|
607
|
-
return;
|
|
608
|
-
}
|
|
609
|
-
this.focusByCollAndRow(rowRange.columns[0], rowNode.rowIndex);
|
|
610
|
-
this._gridOptions.api.addCellRange({ rowStartIndex: rowNode.rowIndex, rowEndIndex: rowNode.rowIndex, columns: rowRange.columns });
|
|
611
|
-
return;
|
|
612
|
-
}
|
|
613
|
-
this._gridOptions.api.clearRangeSelection();
|
|
614
|
-
this.setFocusOnRow(rowNode.rowIndex);
|
|
615
|
-
}
|
|
616
585
|
startEdition(rowIndex, firstCol) {
|
|
617
|
-
if (!this._gridShowDom)
|
|
618
|
-
return;
|
|
619
586
|
this._gridOptions.api.clearRangeSelection();
|
|
620
587
|
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstCol] });
|
|
621
588
|
this._gridOptions.api.setFocusedCell(rowIndex, firstCol);
|
|
@@ -645,7 +612,6 @@ export default class AgGridController {
|
|
|
645
612
|
let displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
|
|
646
613
|
let firstColl = displayedColumns.find(column => column.getColDef().headerName !== '');
|
|
647
614
|
this.focusByCollAndRow(firstColl, rowIndex);
|
|
648
|
-
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstColl] });
|
|
649
615
|
}
|
|
650
616
|
focusByCollAndRow(firstCell, rowIndex) {
|
|
651
617
|
this._gridOptions.api.ensureColumnVisible(firstCell);
|
|
@@ -685,14 +651,6 @@ export default class AgGridController {
|
|
|
685
651
|
this._gridOptions.api.setColumnDefs(this._colDefs);
|
|
686
652
|
}
|
|
687
653
|
}
|
|
688
|
-
hideSelectionColumn() {
|
|
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, false);
|
|
691
|
-
}
|
|
692
|
-
showSelectionColumn() {
|
|
693
|
-
var _a, _b;
|
|
694
|
-
(_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);
|
|
695
|
-
}
|
|
696
654
|
getColumnsDef() {
|
|
697
655
|
if (this._grid === undefined) {
|
|
698
656
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
@@ -977,24 +935,18 @@ export default class AgGridController {
|
|
|
977
935
|
return false;
|
|
978
936
|
}
|
|
979
937
|
onSelectionChange(event) {
|
|
980
|
-
var _a, _b;
|
|
981
|
-
const selectedRowId = (_b = (_a = event.api.getSelectedNodes()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id;
|
|
982
|
-
const isNewRecord = this._dataUnit.isNewRecord(selectedRowId);
|
|
983
938
|
if (!this._selectionChangeCallback)
|
|
984
939
|
return;
|
|
985
940
|
clearTimeout(this._selectionChangeDeboucing);
|
|
986
|
-
this._selectionChangeDeboucing = window.setTimeout(
|
|
987
|
-
|
|
988
|
-
if (!saveSuccess)
|
|
989
|
-
return;
|
|
941
|
+
this._selectionChangeDeboucing = window.setTimeout(() => {
|
|
942
|
+
this.handleExecuteProceedAutosave();
|
|
990
943
|
this.processBuildSelectionChangeCallback(event);
|
|
991
944
|
}, 0);
|
|
992
945
|
}
|
|
993
|
-
|
|
946
|
+
handleExecuteProceedAutosave() {
|
|
994
947
|
if (this._gridShowDom) {
|
|
995
|
-
|
|
948
|
+
this._editionManager.proceedAutoSave();
|
|
996
949
|
}
|
|
997
|
-
return true;
|
|
998
950
|
}
|
|
999
951
|
processBuildSelectionChangeCallback(event) {
|
|
1000
952
|
if (this._dataUnit) {
|
|
@@ -1019,12 +971,7 @@ export default class AgGridController {
|
|
|
1019
971
|
});
|
|
1020
972
|
}
|
|
1021
973
|
onRowDoubleClick(evt) {
|
|
1022
|
-
|
|
1023
|
-
if (this._doubleClickCallBack && (!this._options.enableGridInsert || !this._dataUnit.hasNewRecord())) {
|
|
1024
|
-
/**
|
|
1025
|
-
* Evita mudança de view e a grade permanecer no modo de edição.
|
|
1026
|
-
*/
|
|
1027
|
-
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.stopEditing();
|
|
974
|
+
if (this._doubleClickCallBack) {
|
|
1028
975
|
this._doubleClickCallBack(evt.data);
|
|
1029
976
|
}
|
|
1030
977
|
}
|
|
@@ -1040,29 +987,22 @@ export default class AgGridController {
|
|
|
1040
987
|
}
|
|
1041
988
|
}
|
|
1042
989
|
setCellEditors(customEditors) {
|
|
1043
|
-
var _a
|
|
990
|
+
var _a;
|
|
1044
991
|
if (!this._editionManager) {
|
|
1045
992
|
this._customEditors = customEditors;
|
|
1046
993
|
return;
|
|
1047
994
|
}
|
|
1048
|
-
const currentEditingCells = (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.getEditingCells();
|
|
1049
995
|
this._editionManager.setCellEditors(customEditors);
|
|
1050
|
-
|
|
1051
|
-
this._gridOptions.api.startEditingCell({ colKey: (_d = (_c = currentEditingCells[0]) === null || _c === void 0 ? void 0 : _c.column) === null || _d === void 0 ? void 0 : _d.getColId(), rowIndex: (_e = currentEditingCells[0]) === null || _e === void 0 ? void 0 : _e.rowIndex });
|
|
1052
|
-
}
|
|
996
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
1053
997
|
}
|
|
1054
998
|
setCellRenders(customRenders) {
|
|
1055
|
-
var _a
|
|
999
|
+
var _a;
|
|
1056
1000
|
if (!this._editionManager) {
|
|
1057
1001
|
this._customRenders = customRenders;
|
|
1058
1002
|
return;
|
|
1059
1003
|
}
|
|
1060
1004
|
this._editionManager.setCellRenders(customRenders);
|
|
1061
|
-
|
|
1062
|
-
(_c = this._gridOptions) === null || _c === void 0 ? void 0 : _c.api.redrawRows();
|
|
1063
|
-
if ((currentEditingCells === null || currentEditingCells === void 0 ? void 0 : currentEditingCells.length) > 0) {
|
|
1064
|
-
this._gridOptions.api.startEditingCell({ colKey: (_e = (_d = currentEditingCells[0]) === null || _d === void 0 ? void 0 : _d.column) === null || _e === void 0 ? void 0 : _e.getColId(), rowIndex: (_f = currentEditingCells[0]) === null || _f === void 0 ? void 0 : _f.rowIndex });
|
|
1065
|
-
}
|
|
1005
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
1066
1006
|
}
|
|
1067
1007
|
clearInvalidCells(stopEdition) {
|
|
1068
1008
|
if (!this._editionManager)
|
|
@@ -1074,19 +1014,6 @@ export default class AgGridController {
|
|
|
1074
1014
|
this._editionManager.processContinuousInsert();
|
|
1075
1015
|
}
|
|
1076
1016
|
destroy() {
|
|
1077
|
-
var _a;
|
|
1078
1017
|
this.observer.disconnect();
|
|
1079
|
-
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1080
|
-
}
|
|
1081
|
-
registryListeners() {
|
|
1082
|
-
var _a;
|
|
1083
|
-
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.registryListeners();
|
|
1084
|
-
}
|
|
1085
|
-
resetPaginationState() {
|
|
1086
|
-
var _a, _b;
|
|
1087
|
-
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.clearRangeSelection();
|
|
1088
|
-
}
|
|
1089
|
-
stopEdit() {
|
|
1090
|
-
this._gridOptions.api.stopEditing();
|
|
1091
1018
|
}
|
|
1092
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,63 +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
|
-
const fieldName = event.colDef.field;
|
|
370
|
-
const fieldDescriptor = this._dataUnit.getField(event.colDef.colId);
|
|
371
|
-
const initialValue = (fieldDescriptor === null || fieldDescriptor === void 0 ? void 0 : fieldDescriptor.userInterface) === UserInterface.SEARCH ? value : event.oldValue;
|
|
372
|
-
event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: initialValue }));
|
|
373
|
-
const resolved = await value;
|
|
374
|
-
return this.updateCellValue(event, resolved);
|
|
375
|
-
}
|
|
376
|
-
updateCellValue(event, newValue) {
|
|
377
|
-
var _a;
|
|
378
267
|
const fieldName = event.colDef.field;
|
|
379
|
-
|
|
380
|
-
(
|
|
381
|
-
|
|
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;
|
|
389
284
|
this._customEditors = customEditors;
|
|
390
|
-
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.stopEditing();
|
|
391
285
|
}
|
|
392
286
|
setCellRenders(customRenders) {
|
|
393
287
|
this._customRenders = customRenders;
|
|
394
288
|
}
|
|
395
|
-
|
|
396
|
-
this.
|
|
397
|
-
this._nextInvalidCell = this._invalidCells[0];
|
|
398
|
-
}
|
|
399
|
-
getInvalidCells() {
|
|
400
|
-
return this._invalidCells;
|
|
289
|
+
setInvalidCell(invalidCell, recordId) {
|
|
290
|
+
this._invalidCell = { field: invalidCell, recordId };
|
|
401
291
|
}
|
|
402
|
-
|
|
403
|
-
return this.
|
|
292
|
+
getInvalidCell() {
|
|
293
|
+
return this._invalidCell;
|
|
404
294
|
}
|
|
405
|
-
|
|
295
|
+
processContinuousInsert() {
|
|
406
296
|
if (!this.canContinuousInsert())
|
|
407
297
|
return;
|
|
408
298
|
this._dataUnit.addRecord();
|
|
409
299
|
}
|
|
410
300
|
clearInvalidCells(stopEdition) {
|
|
411
|
-
this.
|
|
412
|
-
this._nextInvalidCell = undefined;
|
|
301
|
+
this._invalidCell = undefined;
|
|
413
302
|
if (stopEdition) {
|
|
414
303
|
this._isGridEdition = false;
|
|
415
304
|
}
|
|
@@ -420,17 +309,10 @@ export default class GridEditionManager {
|
|
|
420
309
|
hasInvalidField(fieldName, recordId) {
|
|
421
310
|
if (!this.hasInvalidCell())
|
|
422
311
|
return false;
|
|
423
|
-
this.
|
|
424
|
-
const containsFieldName = this._nextInvalidCell.field.name === fieldName;
|
|
425
|
-
const containsRecordId = this._nextInvalidCell.recordId === recordId;
|
|
426
|
-
return containsFieldName && containsRecordId;
|
|
312
|
+
return this._invalidCell.field.name === fieldName && this._invalidCell.recordId === recordId;
|
|
427
313
|
}
|
|
428
314
|
hasInvalidCell() {
|
|
429
|
-
|
|
430
|
-
const hasInvalidCell = ((_a = this._invalidCells) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
431
|
-
const hasField = (_b = this._invalidCells) === null || _b === void 0 ? void 0 : _b.filter(invalidCell => { invalidCell.field; });
|
|
432
|
-
const hasRecordId = (_c = this._invalidCells) === null || _c === void 0 ? void 0 : _c.filter(invalidCell => { invalidCell.recordId; });
|
|
433
|
-
if (!hasInvalidCell || !hasField || !hasRecordId)
|
|
315
|
+
if (!this._invalidCell || !this._invalidCell.field || !this._invalidCell.recordId)
|
|
434
316
|
return false;
|
|
435
317
|
return true;
|
|
436
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) => {
|