@sankhyalabs/ezui 5.21.0-dev.3 → 5.21.0-dev.31
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/README.md +1 -1
- package/dist/cjs/ICustomRender-6fafffce.js +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -0
- package/dist/cjs/ez-alert-list.cjs.entry.js +6 -4
- package/dist/cjs/ez-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-chart.cjs.entry.js +433 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -0
- package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +94 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +33 -3
- package/dist/cjs/ez-form.cjs.entry.js +77 -2
- package/dist/cjs/ez-grid.cjs.entry.js +360 -34
- package/dist/cjs/ez-list.cjs.entry.js +11 -3
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -2
- package/dist/cjs/ez-number-input.cjs.entry.js +37 -31
- package/dist/cjs/ez-search.cjs.entry.js +27 -5
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -0
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +34 -29
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
- package/dist/collection/components/ez-button/ez-button.css +7 -0
- package/dist/collection/components/ez-button/ez-button.js +1 -1
- package/dist/collection/components/ez-chart/components/BarChart.js +27 -0
- package/dist/collection/components/ez-chart/components/ColumnChart.js +27 -0
- package/dist/collection/components/ez-chart/components/DonutChart.js +42 -0
- package/dist/collection/components/ez-chart/components/LineChart.js +27 -0
- package/dist/collection/components/ez-chart/components/PieChart.js +45 -0
- package/dist/collection/components/ez-chart/components/index.js +5 -0
- package/dist/collection/components/ez-chart/ez-chart.css +5 -0
- package/dist/collection/components/ez-chart/ez-chart.js +284 -0
- package/dist/collection/components/ez-chart/interfaces/ChartAxis.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartContext.js +14 -0
- package/dist/collection/components/ez-chart/interfaces/ChartOptions.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartSerie.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartType.js +8 -0
- package/dist/collection/components/ez-chart/interfaces/index.js +5 -0
- package/dist/collection/components/ez-chart/test/mock-chart.js +137 -0
- package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js +146 -0
- package/dist/collection/components/ez-form/ez-form.js +130 -4
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +253 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +89 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +62 -5
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +9 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +58 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +6 -3
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/ez-grid.css +1 -0
- package/dist/collection/components/ez-grid/ez-grid.js +265 -13
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +22 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-list/ez-list.css +6 -2
- package/dist/collection/components/ez-list/ez-list.js +28 -2
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +46 -31
- package/dist/collection/components/ez-search/ez-search.js +26 -5
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +1 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +34 -29
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +26 -0
- package/dist/collection/utils/form/test/DataBinder.test.js +41 -4
- package/dist/collection/utils/form/test/resources/metadataTest.js +15 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +1131 -122
- package/dist/esm/ICustomRender-875b5a40.js +13 -0
- package/dist/esm/ez-actions-button.entry.js +1 -0
- package/dist/esm/ez-alert-list.entry.js +6 -4
- package/dist/esm/ez-button.entry.js +2 -2
- package/dist/esm/ez-chart.entry.js +429 -0
- package/dist/esm/ez-collapsible-box.entry.js +1 -0
- package/dist/esm/ez-combo-box.entry.js +1 -0
- package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +96 -3
- package/dist/esm/ez-form-view.entry.js +33 -3
- package/dist/esm/ez-form.entry.js +78 -3
- package/dist/esm/ez-grid.entry.js +360 -34
- package/dist/esm/ez-list.entry.js +11 -3
- package/dist/esm/ez-modal-container.entry.js +2 -2
- package/dist/esm/ez-number-input.entry.js +38 -32
- package/dist/esm/ez-search.entry.js +27 -5
- package/dist/esm/ez-split-item.entry.js +1 -0
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +34 -29
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +8 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-09de35a2.entry.js +1 -0
- package/dist/ezui/{p-af2ecb1b.entry.js → p-1285c902.entry.js} +1 -1
- package/dist/ezui/p-13d2fe2d.entry.js +1 -0
- package/dist/ezui/p-1a35324b.entry.js +1 -0
- package/dist/ezui/p-1ee2479b.entry.js +1 -0
- package/dist/ezui/p-2097d0cf.entry.js +1 -0
- package/dist/ezui/p-2dcb50d4.entry.js +1 -0
- package/dist/ezui/p-30775e7f.entry.js +1 -0
- package/dist/ezui/p-3b4eeeb6.entry.js +1 -0
- package/dist/ezui/p-3b56d2ef.entry.js +1 -0
- package/dist/ezui/p-42566f9e.entry.js +1 -0
- package/dist/ezui/p-4607fb89.js +1 -0
- package/dist/ezui/p-7922142b.entry.js +1 -0
- package/dist/ezui/p-84e439b9.entry.js +1 -0
- package/dist/ezui/p-922ac38b.entry.js +1 -0
- package/dist/ezui/{p-b44741b0.entry.js → p-97db197f.entry.js} +2 -2
- package/dist/ezui/p-bcb53f27.entry.js +1 -0
- package/dist/ezui/p-ffef392d.entry.js +1 -0
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
- package/dist/types/components/ez-chart/components/BarChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/ColumnChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/DonutChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/LineChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/PieChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/index.d.ts +5 -0
- package/dist/types/components/ez-chart/ez-chart.d.ts +58 -0
- package/dist/types/components/ez-chart/interfaces/ChartAxis.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartContext.d.ts +11 -0
- package/dist/types/components/ez-chart/interfaces/ChartOptions.d.ts +10 -0
- package/dist/types/components/ez-chart/interfaces/ChartSerie.d.ts +20 -0
- package/dist/types/components/ez-chart/interfaces/ChartStrategies.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartType.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/index.d.ts +5 -0
- package/dist/types/components/ez-chart/types/BaseHighChartsRender.d.ts +15 -0
- package/dist/types/components/ez-form/ez-form.d.ts +20 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +43 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +42 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +15 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +39 -1
- package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
- package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
- package/dist/types/components/ez-list/ez-list.d.ts +5 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -0
- package/dist/types/components/ez-search/ez-search.d.ts +3 -1
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +3 -2
- package/dist/types/components.d.ts +231 -4
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +29 -0
- package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
- package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
- package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -0
- package/dist/types/utils/form/test/resources/metadataTest.d.ts +2 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +2 -1
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-0447d17c.entry.js +0 -1
- package/dist/ezui/p-20ec22c0.entry.js +0 -1
- package/dist/ezui/p-2a1a0e04.entry.js +0 -1
- package/dist/ezui/p-44c5b6a5.entry.js +0 -1
- package/dist/ezui/p-5ef056ce.entry.js +0 -1
- package/dist/ezui/p-637f69f2.entry.js +0 -1
- package/dist/ezui/p-8defa6d3.entry.js +0 -1
- package/dist/ezui/p-99ead599.entry.js +0 -1
- package/dist/ezui/p-9aefaa52.entry.js +0 -1
- package/dist/ezui/p-b041333c.entry.js +0 -1
- package/dist/ezui/p-b567fa8c.entry.js +0 -1
- package/dist/ezui/p-bae3d0aa.entry.js +0 -1
- package/dist/ezui/p-cc2dc4f4.entry.js +0 -1
- package/dist/ezui/p-db77a984.entry.js +0 -1
|
@@ -8,6 +8,7 @@ const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
|
8
8
|
const ApplicationUtils = require('./ApplicationUtils-c9d1205c.js');
|
|
9
9
|
require('./DialogType-2114c337.js');
|
|
10
10
|
require('./CheckMode-ecb90b87.js');
|
|
11
|
+
const ICustomRender = require('./ICustomRender-6fafffce.js');
|
|
11
12
|
const constants = require('./constants-2714478b.js');
|
|
12
13
|
const RecordValidationProcessor = require('./RecordValidationProcessor-4c893e04.js');
|
|
13
14
|
|
|
@@ -118860,6 +118861,11 @@ class DataSource {
|
|
|
118860
118861
|
});
|
|
118861
118862
|
}
|
|
118862
118863
|
}
|
|
118864
|
+
handleFocusFirstRow() {
|
|
118865
|
+
if (this._options.autoFocus) {
|
|
118866
|
+
this._controller.setFocusFirstRow();
|
|
118867
|
+
}
|
|
118868
|
+
}
|
|
118863
118869
|
isSilentChange(action) {
|
|
118864
118870
|
//TODO: Provisorio p/ não atualizar a grade quando a alteração for apenas de campos transisntes
|
|
118865
118871
|
var _a, _b;
|
|
@@ -118891,6 +118897,7 @@ class DataSource {
|
|
|
118891
118897
|
this._options.onPaginationChange(this._dataUnit.getPaginationInfo(), action.payload.selectFirstRecord);
|
|
118892
118898
|
}
|
|
118893
118899
|
this.updateSelection();
|
|
118900
|
+
this.handleFocusFirstRow();
|
|
118894
118901
|
break;
|
|
118895
118902
|
case core.Action.PAGINATION_UPDATED:
|
|
118896
118903
|
if (this._options) {
|
|
@@ -118933,6 +118940,9 @@ class DataSource {
|
|
|
118933
118940
|
this._controller.selectRows(selectionInfo.recordIds, true);
|
|
118934
118941
|
}
|
|
118935
118942
|
}
|
|
118943
|
+
setAutoFocus(autoFocus) {
|
|
118944
|
+
this._options.autoFocus = autoFocus;
|
|
118945
|
+
}
|
|
118936
118946
|
getRows(params) {
|
|
118937
118947
|
if (this.needReload(params)) {
|
|
118938
118948
|
this._lastLoadingParams = params;
|
|
@@ -119318,8 +119328,9 @@ const buildDateTime = ({ readOnly }) => {
|
|
|
119318
119328
|
};
|
|
119319
119329
|
|
|
119320
119330
|
const buildDecimal = ({ readOnly, props }) => {
|
|
119321
|
-
|
|
119322
|
-
const
|
|
119331
|
+
var _a, _b;
|
|
119332
|
+
const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
|
|
119333
|
+
const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
|
|
119323
119334
|
return buildNumeric(readOnly, precision, prettyPrecision);
|
|
119324
119335
|
};
|
|
119325
119336
|
const buildInteger = ({ readOnly }) => {
|
|
@@ -119414,9 +119425,9 @@ class EzCellEditor {
|
|
|
119414
119425
|
init(params) {
|
|
119415
119426
|
const fieldName = params.column.getColId();
|
|
119416
119427
|
const dataUnit = params.context.dataUnit;
|
|
119417
|
-
|
|
119418
|
-
const builder = uiBuilders.get(
|
|
119419
|
-
this._gui = builder(
|
|
119428
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
119429
|
+
const builder = uiBuilders.get(this._fieldMetadata.userInterface) || buildTextInput;
|
|
119430
|
+
this._gui = builder(this._fieldMetadata);
|
|
119420
119431
|
if (this._gui.valueSetter != undefined) {
|
|
119421
119432
|
this._gui.valueSetter(params.value);
|
|
119422
119433
|
}
|
|
@@ -119440,10 +119451,147 @@ class EzCellEditor {
|
|
|
119440
119451
|
isPopup() {
|
|
119441
119452
|
return this._gui.isPopUp;
|
|
119442
119453
|
}
|
|
119454
|
+
getFieldMetadata() {
|
|
119455
|
+
return this._fieldMetadata;
|
|
119456
|
+
}
|
|
119457
|
+
}
|
|
119458
|
+
|
|
119459
|
+
class EzGridCustomCellEditor extends EzCellEditor {
|
|
119460
|
+
init(params) {
|
|
119461
|
+
var _a, _b;
|
|
119462
|
+
this._value = params.value;
|
|
119463
|
+
this._fieldName = params.column.getColId();
|
|
119464
|
+
this._customEditorInstance = params.customEditorsInfo.customEditor;
|
|
119465
|
+
super.init(params);
|
|
119466
|
+
this._defaultGui = this.getDefaultGui();
|
|
119467
|
+
const fieldMetadata = super.getFieldMetadata();
|
|
119468
|
+
this._params = {
|
|
119469
|
+
value: params.value,
|
|
119470
|
+
charPress: params.charPress,
|
|
119471
|
+
currentEditor: this._defaultGui,
|
|
119472
|
+
name: this._fieldName,
|
|
119473
|
+
source: ICustomRender.CustomEditorSource.GRID,
|
|
119474
|
+
detailContext: params.customEditorsInfo.detailContext,
|
|
119475
|
+
setValue: (value) => this.setValue(value),
|
|
119476
|
+
getValue: () => this.getValue(),
|
|
119477
|
+
editorMetadata: {
|
|
119478
|
+
hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
119479
|
+
label: fieldMetadata.label,
|
|
119480
|
+
userInterface: fieldMetadata.userInterface,
|
|
119481
|
+
props: fieldMetadata.props,
|
|
119482
|
+
optionLoader: fieldMetadata.optionLoader,
|
|
119483
|
+
options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
|
|
119484
|
+
}
|
|
119485
|
+
};
|
|
119486
|
+
}
|
|
119487
|
+
getDefaultGui() {
|
|
119488
|
+
const gui = super.getGui();
|
|
119489
|
+
gui.value = this._value;
|
|
119490
|
+
gui.onkeyup = (event) => {
|
|
119491
|
+
const value = event.target.value;
|
|
119492
|
+
this.setValue(value);
|
|
119493
|
+
};
|
|
119494
|
+
return gui;
|
|
119495
|
+
}
|
|
119496
|
+
getGui() {
|
|
119497
|
+
const editorElement = this._customEditorInstance.getEditorElement(this._params);
|
|
119498
|
+
if (!editorElement) {
|
|
119499
|
+
return this._defaultGui;
|
|
119500
|
+
}
|
|
119501
|
+
if (typeof editorElement === 'string') {
|
|
119502
|
+
const element = core.HTMLBuilder.parseElement(editorElement);
|
|
119503
|
+
return element;
|
|
119504
|
+
}
|
|
119505
|
+
return editorElement;
|
|
119506
|
+
}
|
|
119507
|
+
setValue(value) {
|
|
119508
|
+
this._value = value;
|
|
119509
|
+
}
|
|
119510
|
+
getValue() {
|
|
119511
|
+
return this._value;
|
|
119512
|
+
}
|
|
119513
|
+
}
|
|
119514
|
+
|
|
119515
|
+
class EzCellRender {
|
|
119516
|
+
init(params) {
|
|
119517
|
+
const span = document.createElement('span');
|
|
119518
|
+
this._currentParams = params;
|
|
119519
|
+
span.textContent = params.value;
|
|
119520
|
+
const fieldName = params.column.getColId();
|
|
119521
|
+
const dataUnit = params.context.dataUnit;
|
|
119522
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
119523
|
+
this._gui = span;
|
|
119524
|
+
}
|
|
119525
|
+
refresh() {
|
|
119526
|
+
try {
|
|
119527
|
+
this._currentParams.refreshCell();
|
|
119528
|
+
return true;
|
|
119529
|
+
}
|
|
119530
|
+
catch (_a) {
|
|
119531
|
+
return false;
|
|
119532
|
+
}
|
|
119533
|
+
}
|
|
119534
|
+
getGui() {
|
|
119535
|
+
return this._gui;
|
|
119536
|
+
}
|
|
119537
|
+
afterGuiAttached() {
|
|
119538
|
+
this.focusIn();
|
|
119539
|
+
}
|
|
119540
|
+
focusIn() {
|
|
119541
|
+
this._gui.focus();
|
|
119542
|
+
this._gui.setFocus({ selectText: true });
|
|
119543
|
+
}
|
|
119544
|
+
getValue() {
|
|
119545
|
+
return this._currentParams.getValue();
|
|
119546
|
+
}
|
|
119547
|
+
isPopup() {
|
|
119548
|
+
return this._gui.isPopUp;
|
|
119549
|
+
}
|
|
119550
|
+
getFieldMetadata() {
|
|
119551
|
+
return this._fieldMetadata;
|
|
119552
|
+
}
|
|
119553
|
+
}
|
|
119554
|
+
|
|
119555
|
+
class EzGridCustomCellRender extends EzCellRender {
|
|
119556
|
+
init(params) {
|
|
119557
|
+
var _a, _b;
|
|
119558
|
+
this._fieldName = params.column.getColId();
|
|
119559
|
+
this._customRenderInstance = params.customRendersInfo.customRender;
|
|
119560
|
+
super.init(params);
|
|
119561
|
+
const fieldMetadata = super.getFieldMetadata();
|
|
119562
|
+
this._params = {
|
|
119563
|
+
value: params.value,
|
|
119564
|
+
charPress: '',
|
|
119565
|
+
currentRender: super.getGui(),
|
|
119566
|
+
name: this._fieldName,
|
|
119567
|
+
source: ICustomRender.CustomRenderSource.GRID,
|
|
119568
|
+
getValue: () => params.getValue(),
|
|
119569
|
+
detailContext: params.customRendersInfo.detailContext,
|
|
119570
|
+
renderMetadata: {
|
|
119571
|
+
hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
119572
|
+
label: fieldMetadata.label,
|
|
119573
|
+
userInterface: fieldMetadata.userInterface,
|
|
119574
|
+
props: fieldMetadata.props,
|
|
119575
|
+
optionLoader: fieldMetadata.optionLoader,
|
|
119576
|
+
options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
|
|
119577
|
+
}
|
|
119578
|
+
};
|
|
119579
|
+
}
|
|
119580
|
+
getGui() {
|
|
119581
|
+
const editorElement = this._customRenderInstance.getRenderElement(this._params);
|
|
119582
|
+
if (!editorElement) {
|
|
119583
|
+
return super.getGui();
|
|
119584
|
+
}
|
|
119585
|
+
if (typeof editorElement === 'string') {
|
|
119586
|
+
const element = core.HTMLBuilder.parseElement(editorElement);
|
|
119587
|
+
return element;
|
|
119588
|
+
}
|
|
119589
|
+
return editorElement;
|
|
119590
|
+
}
|
|
119443
119591
|
}
|
|
119444
119592
|
|
|
119445
119593
|
class GridEditionManager {
|
|
119446
|
-
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled) {
|
|
119594
|
+
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
|
|
119447
119595
|
this._dataUnit = dataUnit;
|
|
119448
119596
|
this._recordValidationProcessor = new RecordValidationProcessor.RecordValidationProcessor(this._dataUnit, {
|
|
119449
119597
|
getRequiredFields: () => this.getRequiredFields(),
|
|
@@ -119452,6 +119600,8 @@ class GridEditionManager {
|
|
|
119452
119600
|
}, recordsValidator);
|
|
119453
119601
|
this._useEnterLikeTab = useEnterLikeTab;
|
|
119454
119602
|
this._editionIsDisabled = editionIsDisabled;
|
|
119603
|
+
this._customEditors = customEditors;
|
|
119604
|
+
this._customRenders = customRenders;
|
|
119455
119605
|
}
|
|
119456
119606
|
configureGrid(options) {
|
|
119457
119607
|
this._gridOptions = options;
|
|
@@ -119518,6 +119668,30 @@ class GridEditionManager {
|
|
|
119518
119668
|
col.suppressKeyboardEvent = (params) => {
|
|
119519
119669
|
return params.event.key === KeyCode.ENTER;
|
|
119520
119670
|
};
|
|
119671
|
+
col.cellEditorSelector = (params) => {
|
|
119672
|
+
var _a;
|
|
119673
|
+
if ((_a = this._customEditors) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
|
|
119674
|
+
const customEditor = this._customEditors.get(params.colDef.field);
|
|
119675
|
+
return {
|
|
119676
|
+
component: EzGridCustomCellEditor,
|
|
119677
|
+
params: {
|
|
119678
|
+
customEditorsInfo: customEditor,
|
|
119679
|
+
}
|
|
119680
|
+
};
|
|
119681
|
+
}
|
|
119682
|
+
};
|
|
119683
|
+
col.cellRendererSelector = (params) => {
|
|
119684
|
+
var _a;
|
|
119685
|
+
if ((_a = this._customRenders) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
|
|
119686
|
+
const customRender = this._customRenders.get(params.colDef.field);
|
|
119687
|
+
return {
|
|
119688
|
+
component: EzGridCustomCellRender,
|
|
119689
|
+
params: {
|
|
119690
|
+
customRendersInfo: customRender,
|
|
119691
|
+
}
|
|
119692
|
+
};
|
|
119693
|
+
}
|
|
119694
|
+
};
|
|
119521
119695
|
return col;
|
|
119522
119696
|
}
|
|
119523
119697
|
getRequiredFields() {
|
|
@@ -119659,6 +119833,12 @@ class GridEditionManager {
|
|
|
119659
119833
|
this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
|
|
119660
119834
|
}
|
|
119661
119835
|
}
|
|
119836
|
+
setCellEditors(customEditors) {
|
|
119837
|
+
this._customEditors = customEditors;
|
|
119838
|
+
}
|
|
119839
|
+
setCellRenders(customRenders) {
|
|
119840
|
+
this._customRenders = customRenders;
|
|
119841
|
+
}
|
|
119662
119842
|
}
|
|
119663
119843
|
class TargetEdition {
|
|
119664
119844
|
constructor(rowIndex, column, backwards) {
|
|
@@ -119703,6 +119883,7 @@ class AgGridController {
|
|
|
119703
119883
|
this._gridConfig = [];
|
|
119704
119884
|
this._filteredColumns = new Map();
|
|
119705
119885
|
this._filterColumnleftPosition = 0;
|
|
119886
|
+
this._customFormatters = new Map();
|
|
119706
119887
|
this._enterprise = enterprise;
|
|
119707
119888
|
}
|
|
119708
119889
|
getGridConfig() {
|
|
@@ -119779,6 +119960,8 @@ class AgGridController {
|
|
|
119779
119960
|
}
|
|
119780
119961
|
initDatagrid(container, options) {
|
|
119781
119962
|
var _a;
|
|
119963
|
+
this._options = options;
|
|
119964
|
+
this._container = container;
|
|
119782
119965
|
if (this._grid === undefined) {
|
|
119783
119966
|
LicenseManager.setLicenseKey(core.ApplicationContext.getContextValue('__EZUI__GRID_LICENSE__'));
|
|
119784
119967
|
this._columnStateChangeCallback = options.onColumnStateChange;
|
|
@@ -119786,7 +119969,7 @@ class AgGridController {
|
|
|
119786
119969
|
this._doubleClickCallBack = options.onDoubleClick;
|
|
119787
119970
|
this._multipleSelection = options.allowMultipleSelection;
|
|
119788
119971
|
this._dataUnit = options.dataUnit;
|
|
119789
|
-
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled);
|
|
119972
|
+
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders);
|
|
119790
119973
|
this._statusResolver = options.statusResolver;
|
|
119791
119974
|
if (this._dataUnit) {
|
|
119792
119975
|
this._dataUnit.sortingProvider = this;
|
|
@@ -119848,6 +120031,7 @@ class AgGridController {
|
|
|
119848
120031
|
this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
|
|
119849
120032
|
}
|
|
119850
120033
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
120034
|
+
this._customFormatters = options.customFormatters;
|
|
119851
120035
|
}
|
|
119852
120036
|
}
|
|
119853
120037
|
processFormatterCellCallback(params) {
|
|
@@ -120131,12 +120315,33 @@ class AgGridController {
|
|
|
120131
120315
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
120132
120316
|
}
|
|
120133
120317
|
this._gridOptions.api.refreshServerSide({ purge: true });
|
|
120318
|
+
this._options.onRefresh();
|
|
120319
|
+
}
|
|
120320
|
+
focusOnGridContainer() {
|
|
120321
|
+
this._container.setAttribute('tabindex', '-1');
|
|
120322
|
+
this._container.focus();
|
|
120323
|
+
}
|
|
120324
|
+
setFocus() {
|
|
120325
|
+
var _a, _b;
|
|
120326
|
+
if ((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) {
|
|
120327
|
+
this.setFocusFirstRow();
|
|
120328
|
+
}
|
|
120329
|
+
else {
|
|
120330
|
+
this.focusOnGridContainer();
|
|
120331
|
+
}
|
|
120332
|
+
}
|
|
120333
|
+
setAutoFocus(autoFocus) {
|
|
120334
|
+
var _a;
|
|
120335
|
+
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
|
|
120134
120336
|
}
|
|
120135
120337
|
setFocusFirstRow() {
|
|
120136
120338
|
const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
|
|
120137
120339
|
if (firstRow) {
|
|
120138
120340
|
this.setFocusOnRow(firstRow.rowIndex);
|
|
120139
120341
|
}
|
|
120342
|
+
else {
|
|
120343
|
+
this.focusOnGridContainer();
|
|
120344
|
+
}
|
|
120140
120345
|
}
|
|
120141
120346
|
setFocusLastRow() {
|
|
120142
120347
|
const lastRow = this._gridOptions.api.getDisplayedRowAtIndex(this._gridOptions.api.getLastDisplayedRow());
|
|
@@ -120215,7 +120420,7 @@ class AgGridController {
|
|
|
120215
120420
|
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
120216
120421
|
const columnsOffset = colDef.length - columns.length;
|
|
120217
120422
|
let sort = [];
|
|
120218
|
-
state.forEach((cfgColumn, index) => {
|
|
120423
|
+
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
120219
120424
|
const colWidth = this.getColumnWidth(cfgColumn);
|
|
120220
120425
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
120221
120426
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
@@ -120312,12 +120517,19 @@ class AgGridController {
|
|
|
120312
120517
|
showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
|
|
120313
120518
|
},
|
|
120314
120519
|
valueFormatter: params => {
|
|
120315
|
-
if (params.value === undefined) {
|
|
120520
|
+
if (params.value === undefined || params.value === null) {
|
|
120316
120521
|
return "";
|
|
120317
120522
|
}
|
|
120318
120523
|
if (params.value instanceof Promise) {
|
|
120319
120524
|
return "Carregando...";
|
|
120320
120525
|
}
|
|
120526
|
+
const customFormatter = this._customFormatters.get(source.name);
|
|
120527
|
+
if (customFormatter) {
|
|
120528
|
+
const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
|
|
120529
|
+
if (formattedValue) {
|
|
120530
|
+
return formattedValue;
|
|
120531
|
+
}
|
|
120532
|
+
}
|
|
120321
120533
|
if (this._dataUnit) {
|
|
120322
120534
|
return this._dataUnit.getFormattedValue(source.name, params.value);
|
|
120323
120535
|
}
|
|
@@ -120326,6 +120538,13 @@ class AgGridController {
|
|
|
120326
120538
|
cellStyle: this.getStyleByColumn(source),
|
|
120327
120539
|
});
|
|
120328
120540
|
}
|
|
120541
|
+
setCustomFormatters(customFormatters) {
|
|
120542
|
+
this._customFormatters = customFormatters;
|
|
120543
|
+
}
|
|
120544
|
+
refreshSelectedRows() {
|
|
120545
|
+
const selectedNodes = this._gridOptions.api.getSelectedNodes();
|
|
120546
|
+
this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
|
|
120547
|
+
}
|
|
120329
120548
|
getInitCellStyle() {
|
|
120330
120549
|
return {
|
|
120331
120550
|
'line-height': this.getRowHeight() - 1 + 'px',
|
|
@@ -120501,11 +120720,52 @@ class AgGridController {
|
|
|
120501
120720
|
const labelSize = (((_b = field === null || field === void 0 ? void 0 : field.label) === null || _b === void 0 ? void 0 : _b.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
|
|
120502
120721
|
return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
|
|
120503
120722
|
}
|
|
120723
|
+
setCellEditors(customEditors) {
|
|
120724
|
+
var _a;
|
|
120725
|
+
if (!this._editionManager) {
|
|
120726
|
+
this._customEditors = customEditors;
|
|
120727
|
+
return;
|
|
120728
|
+
}
|
|
120729
|
+
this._editionManager.setCellEditors(customEditors);
|
|
120730
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
120731
|
+
}
|
|
120732
|
+
setCellRenders(customRenders) {
|
|
120733
|
+
var _a;
|
|
120734
|
+
if (!this._editionManager) {
|
|
120735
|
+
this._customRenders = customRenders;
|
|
120736
|
+
return;
|
|
120737
|
+
}
|
|
120738
|
+
this._editionManager.setCellRenders(customRenders);
|
|
120739
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
120740
|
+
}
|
|
120741
|
+
}
|
|
120742
|
+
|
|
120743
|
+
function enableSelectAll(total) {
|
|
120744
|
+
return total !== undefined;
|
|
120745
|
+
}
|
|
120746
|
+
function buildSelectAllLabel(allRecordSelected, count, total) {
|
|
120747
|
+
if (allRecordSelected)
|
|
120748
|
+
return 'Selecionar apenas a página atual';
|
|
120749
|
+
if (total === undefined)
|
|
120750
|
+
return `Carregando todos os ${count} registros`;
|
|
120751
|
+
return `Selecionar todos os ${total} registros`;
|
|
120752
|
+
}
|
|
120753
|
+
function buildSelectAllTitle(total) {
|
|
120754
|
+
if (enableSelectAll(total))
|
|
120755
|
+
return '';
|
|
120756
|
+
return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
|
|
120757
|
+
}
|
|
120758
|
+
function getText(selectionCount, allSelectedRecords) {
|
|
120759
|
+
if (allSelectedRecords) {
|
|
120760
|
+
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
120761
|
+
}
|
|
120762
|
+
const pluralCharacter = selectionCount > 1 ? "s" : "";
|
|
120763
|
+
return `Há <strong>${selectionCount} registro${pluralCharacter}</strong> selecionado${pluralCharacter} na grade.`;
|
|
120504
120764
|
}
|
|
120505
120765
|
|
|
120506
120766
|
const SelectionCounter = (props) => {
|
|
120507
120767
|
const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
120508
|
-
const { total, hasMore } = paginationInfo || {};
|
|
120768
|
+
const { total, hasMore, count } = paginationInfo || {};
|
|
120509
120769
|
const shouldRenderSelectionButton = () => {
|
|
120510
120770
|
if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
|
|
120511
120771
|
return false;
|
|
@@ -120519,20 +120779,11 @@ const SelectionCounter = (props) => {
|
|
|
120519
120779
|
index.h("label", Object.assign({ innerHTML: getText(selectionCount, allRecordSelected), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))),
|
|
120520
120780
|
index.h("div", { class: "ez-flex ez-margin-right--medium" },
|
|
120521
120781
|
shouldRenderSelectionButton() &&
|
|
120522
|
-
index.h("ez-button", Object.assign({ class: "ez-margin-right--medium", label:
|
|
120523
|
-
index.h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
|
|
120782
|
+
index.h("ez-button", Object.assign({ title: buildSelectAllTitle(total), enabled: enableSelectAll(total), class: "ez-margin-right--medium", label: buildSelectAllLabel(allRecordSelected, count, total), mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))),
|
|
120783
|
+
index.h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
|
|
120524
120784
|
index.h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
|
|
120525
120785
|
index.h("ez-icon", { iconName: "close" })))));
|
|
120526
120786
|
};
|
|
120527
|
-
function getText(selectionCount, allSelectedRecords) {
|
|
120528
|
-
if (allSelectedRecords) {
|
|
120529
|
-
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
120530
|
-
}
|
|
120531
|
-
else {
|
|
120532
|
-
const pluralChar = selectionCount > 1 ? "s" : "";
|
|
120533
|
-
return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
|
|
120534
|
-
}
|
|
120535
|
-
}
|
|
120536
120787
|
function getElementID(sufix) {
|
|
120537
120788
|
return {
|
|
120538
120789
|
[core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(sufix)
|
|
@@ -120694,7 +120945,7 @@ class InMemoryFilterColumnDataSource {
|
|
|
120694
120945
|
}
|
|
120695
120946
|
}
|
|
120696
120947
|
|
|
120697
|
-
const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{width:30%;min-width:100px;justify-content:flex-end;flex-wrap:wrap}.grid-header__left-container.sc-ez-grid{width:70%}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}";
|
|
120948
|
+
const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%);--ez-grid--min-height:300px;min-height:var(--ez-grid--min-height)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;outline:none;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}.grid-header__pagination.sc-ez-grid{width:30%;min-width:100px;justify-content:flex-end;flex-wrap:wrap}.grid-header__left-container.sc-ez-grid{width:70%}.grid-header__pagination-label.sc-ez-grid{width:100%;white-space:nowrap}.overflowed.sc-ez-grid{display:none}";
|
|
120698
120949
|
|
|
120699
120950
|
const windowInstace = window;
|
|
120700
120951
|
const matches = (text, filter) => {
|
|
@@ -120712,6 +120963,8 @@ const EzGrid = class {
|
|
|
120712
120963
|
this.componentReady = index.createEvent(this, "componentReady", 7);
|
|
120713
120964
|
this._gridController = new AgGridController(false);
|
|
120714
120965
|
this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
|
|
120966
|
+
this._customEditor = new Map();
|
|
120967
|
+
this._customRenders = new Map();
|
|
120715
120968
|
this._paginationInfo = undefined;
|
|
120716
120969
|
this._paginationChangedByKeyboard = true;
|
|
120717
120970
|
this._showSelectionCounter = false;
|
|
@@ -120719,6 +120972,7 @@ const EzGrid = class {
|
|
|
120719
120972
|
this._currentPageSelected = undefined;
|
|
120720
120973
|
this._selectionCount = undefined;
|
|
120721
120974
|
this._hasLeftButtons = false;
|
|
120975
|
+
this._customFormatters = new Map();
|
|
120722
120976
|
this.multipleSelection = undefined;
|
|
120723
120977
|
this.config = undefined;
|
|
120724
120978
|
this.selectionToastConfig = undefined;
|
|
@@ -120729,6 +120983,7 @@ const EzGrid = class {
|
|
|
120729
120983
|
this.useEnterLikeTab = false;
|
|
120730
120984
|
this.recordsValidator = undefined;
|
|
120731
120985
|
this.canEdit = true;
|
|
120986
|
+
this.autoFocus = true;
|
|
120732
120987
|
}
|
|
120733
120988
|
/**
|
|
120734
120989
|
* Aplica a definição de colunas.
|
|
@@ -120790,6 +121045,69 @@ const EzGrid = class {
|
|
|
120790
121045
|
async filterColumns(search) {
|
|
120791
121046
|
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
120792
121047
|
}
|
|
121048
|
+
/**
|
|
121049
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
121050
|
+
*/
|
|
121051
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
|
121052
|
+
const newCustomEditor = new Map(this._customEditor);
|
|
121053
|
+
newCustomEditor.set(fieldName, {
|
|
121054
|
+
customEditor,
|
|
121055
|
+
detailContext,
|
|
121056
|
+
});
|
|
121057
|
+
this._customEditor = newCustomEditor;
|
|
121058
|
+
this._gridController.setCellEditors(newCustomEditor);
|
|
121059
|
+
}
|
|
121060
|
+
/**
|
|
121061
|
+
* Registra um render customizado para colunas da grid.
|
|
121062
|
+
*/
|
|
121063
|
+
async addGridCustomRender(fieldName, customRender, detailContext) {
|
|
121064
|
+
const newCustomRenders = new Map(this._customRenders);
|
|
121065
|
+
newCustomRenders.set(fieldName, { customRender, detailContext });
|
|
121066
|
+
this._customRenders = newCustomRenders;
|
|
121067
|
+
this._gridController.setCellRenders(newCustomRenders);
|
|
121068
|
+
}
|
|
121069
|
+
/**
|
|
121070
|
+
* Registra um formatador de valores para uma coluna da grid.
|
|
121071
|
+
*/
|
|
121072
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
|
121073
|
+
if (!columnName || !customFormatter) {
|
|
121074
|
+
return;
|
|
121075
|
+
}
|
|
121076
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
121077
|
+
newCustomFormatters.set(columnName, customFormatter);
|
|
121078
|
+
this._customFormatters = newCustomFormatters;
|
|
121079
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
121080
|
+
}
|
|
121081
|
+
/**
|
|
121082
|
+
* Remove o formatador de valores de uma coluna da grid.
|
|
121083
|
+
*/
|
|
121084
|
+
async removeCustomValueFormatter(columnName) {
|
|
121085
|
+
if (!columnName) {
|
|
121086
|
+
return;
|
|
121087
|
+
}
|
|
121088
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
121089
|
+
newCustomFormatters.delete(columnName);
|
|
121090
|
+
this._customFormatters = newCustomFormatters;
|
|
121091
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
121092
|
+
}
|
|
121093
|
+
/**
|
|
121094
|
+
* Atualiza linhas da grade.
|
|
121095
|
+
*/
|
|
121096
|
+
async refreshSelectedRows() {
|
|
121097
|
+
this._gridController.refreshSelectedRows();
|
|
121098
|
+
}
|
|
121099
|
+
/**
|
|
121100
|
+
* Retorna o formatador customizado da coluna caso exista.
|
|
121101
|
+
*/
|
|
121102
|
+
async getCustomValueFormatter(columnName) {
|
|
121103
|
+
return this._customFormatters.get(columnName);
|
|
121104
|
+
}
|
|
121105
|
+
/**
|
|
121106
|
+
* Atribui o foco para a grade.
|
|
121107
|
+
*/
|
|
121108
|
+
async setFocus() {
|
|
121109
|
+
this._gridController.setFocus();
|
|
121110
|
+
}
|
|
120793
121111
|
observeConfig(config) {
|
|
120794
121112
|
this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
|
|
120795
121113
|
}
|
|
@@ -120943,7 +121261,9 @@ const EzGrid = class {
|
|
|
120943
121261
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
120944
121262
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
120945
121263
|
const dtInfo = { id: 'ezGrid' };
|
|
120946
|
-
|
|
121264
|
+
if (this._refPaginationControl) {
|
|
121265
|
+
core.ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
|
|
121266
|
+
}
|
|
120947
121267
|
}
|
|
120948
121268
|
previousPage() {
|
|
120949
121269
|
if (this.dataUnit) {
|
|
@@ -120963,14 +121283,10 @@ const EzGrid = class {
|
|
|
120963
121283
|
(_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
|
|
120964
121284
|
}
|
|
120965
121285
|
getPaginationControl() {
|
|
120966
|
-
if (this._paginationInfo)
|
|
120967
|
-
|
|
120968
|
-
|
|
120969
|
-
|
|
120970
|
-
index.h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, index.h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), index.h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
|
|
120971
|
-
];
|
|
120972
|
-
}
|
|
120973
|
-
return null;
|
|
121286
|
+
if (!this._paginationInfo)
|
|
121287
|
+
return null;
|
|
121288
|
+
const { currentPage, hasMore } = this._paginationInfo;
|
|
121289
|
+
return (index.h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, index.h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, index.h("span", { class: "grid-header__pagination-label" }, index.h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())), index.h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, index.h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), index.h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
|
|
120974
121290
|
}
|
|
120975
121291
|
componentDidLoad() {
|
|
120976
121292
|
this._gridController.initDatagrid(this._container, {
|
|
@@ -120991,7 +121307,14 @@ const EzGrid = class {
|
|
|
120991
121307
|
statusResolver: this.statusResolver,
|
|
120992
121308
|
useEnterLikeTab: this.useEnterLikeTab,
|
|
120993
121309
|
recordsValidator: this.recordsValidator,
|
|
120994
|
-
editionIsDisabled: () => !this.canEdit
|
|
121310
|
+
editionIsDisabled: () => !this.canEdit,
|
|
121311
|
+
customFormatters: this._customFormatters,
|
|
121312
|
+
autoFocus: this.autoFocus,
|
|
121313
|
+
onRefresh: () => {
|
|
121314
|
+
if (this.dataUnit) {
|
|
121315
|
+
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
121316
|
+
}
|
|
121317
|
+
}
|
|
120995
121318
|
});
|
|
120996
121319
|
if (this.config) {
|
|
120997
121320
|
this.observeConfig(this.config);
|
|
@@ -121007,7 +121330,7 @@ const EzGrid = class {
|
|
|
121007
121330
|
}
|
|
121008
121331
|
handlePaginationChange(selectFirstRecord, paginationInfo) {
|
|
121009
121332
|
var _a;
|
|
121010
|
-
if (selectFirstRecord !== false) {
|
|
121333
|
+
if (selectFirstRecord !== false && this.autoFocus) {
|
|
121011
121334
|
if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
|
|
121012
121335
|
this._gridController.setFocusLastRow();
|
|
121013
121336
|
}
|
|
@@ -121077,6 +121400,9 @@ const EzGrid = class {
|
|
|
121077
121400
|
if (!this.dataUnit.name.includes("InMemoryDataUnit"))
|
|
121078
121401
|
return;
|
|
121079
121402
|
}
|
|
121403
|
+
componentDidUpdate() {
|
|
121404
|
+
this._gridController.setAutoFocus(this.autoFocus);
|
|
121405
|
+
}
|
|
121080
121406
|
getDataSource() {
|
|
121081
121407
|
var _a;
|
|
121082
121408
|
return (_a = this.columnfilterDataSource) !== null && _a !== void 0 ? _a : new InMemoryFilterColumnDataSource(this.dataUnit);
|
|
@@ -121086,7 +121412,7 @@ const EzGrid = class {
|
|
|
121086
121412
|
}
|
|
121087
121413
|
render() {
|
|
121088
121414
|
var _a;
|
|
121089
|
-
return (index.h(index.Host, { "no-header": this.hideHeader() }, index.h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), index.h("div", { class: "grid-header__position" }, index.h("div", { class: "grid-header__container grid-header__left-container" }, index.h("slot", { name: "leftButtons" })),
|
|
121415
|
+
return (index.h(index.Host, { "no-header": this.hideHeader() }, index.h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), index.h("div", { class: "grid-header__position" }, index.h("div", { class: "grid-header__container grid-header__left-container" }, index.h("slot", { name: "leftButtons" })), this.getPaginationControl())), index.h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
|
|
121090
121416
|
${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
|
|
121091
121417
|
` }, index.h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), index.h("div", { class: "grid__footer" }, index.h("slot", { name: "footer" }))));
|
|
121092
121418
|
}
|