@sankhyalabs/ezui 5.21.0-dev.3 → 5.21.0-dev.30
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 +26 -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 +25 -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 +1130 -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 +26 -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-4607fb89.js +1 -0
- package/dist/ezui/p-6517c8c7.entry.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
|
@@ -4,6 +4,7 @@ import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
|
4
4
|
import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
|
|
5
5
|
import './DialogType-54a62731.js';
|
|
6
6
|
import './CheckMode-bdb2ec19.js';
|
|
7
|
+
import { C as CustomEditorSource, a as CustomRenderSource } from './ICustomRender-875b5a40.js';
|
|
7
8
|
import { D as DISTINCT_FILTER_NAME_PREFIX, E as EZ_GRID_LOADING_SOURCE } from './constants-4e0d35b7.js';
|
|
8
9
|
import { b as buildFieldMetadata, R as RecordValidationProcessor } from './RecordValidationProcessor-b00b8b77.js';
|
|
9
10
|
|
|
@@ -118856,6 +118857,11 @@ class DataSource {
|
|
|
118856
118857
|
});
|
|
118857
118858
|
}
|
|
118858
118859
|
}
|
|
118860
|
+
handleFocusFirstRow() {
|
|
118861
|
+
if (this._options.autoFocus) {
|
|
118862
|
+
this._controller.setFocusFirstRow();
|
|
118863
|
+
}
|
|
118864
|
+
}
|
|
118859
118865
|
isSilentChange(action) {
|
|
118860
118866
|
//TODO: Provisorio p/ não atualizar a grade quando a alteração for apenas de campos transisntes
|
|
118861
118867
|
var _a, _b;
|
|
@@ -118887,6 +118893,7 @@ class DataSource {
|
|
|
118887
118893
|
this._options.onPaginationChange(this._dataUnit.getPaginationInfo(), action.payload.selectFirstRecord);
|
|
118888
118894
|
}
|
|
118889
118895
|
this.updateSelection();
|
|
118896
|
+
this.handleFocusFirstRow();
|
|
118890
118897
|
break;
|
|
118891
118898
|
case Action.PAGINATION_UPDATED:
|
|
118892
118899
|
if (this._options) {
|
|
@@ -118929,6 +118936,9 @@ class DataSource {
|
|
|
118929
118936
|
this._controller.selectRows(selectionInfo.recordIds, true);
|
|
118930
118937
|
}
|
|
118931
118938
|
}
|
|
118939
|
+
setAutoFocus(autoFocus) {
|
|
118940
|
+
this._options.autoFocus = autoFocus;
|
|
118941
|
+
}
|
|
118932
118942
|
getRows(params) {
|
|
118933
118943
|
if (this.needReload(params)) {
|
|
118934
118944
|
this._lastLoadingParams = params;
|
|
@@ -119314,8 +119324,9 @@ const buildDateTime = ({ readOnly }) => {
|
|
|
119314
119324
|
};
|
|
119315
119325
|
|
|
119316
119326
|
const buildDecimal = ({ readOnly, props }) => {
|
|
119317
|
-
|
|
119318
|
-
const
|
|
119327
|
+
var _a, _b;
|
|
119328
|
+
const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
|
|
119329
|
+
const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
|
|
119319
119330
|
return buildNumeric(readOnly, precision, prettyPrecision);
|
|
119320
119331
|
};
|
|
119321
119332
|
const buildInteger = ({ readOnly }) => {
|
|
@@ -119410,9 +119421,9 @@ class EzCellEditor {
|
|
|
119410
119421
|
init(params) {
|
|
119411
119422
|
const fieldName = params.column.getColId();
|
|
119412
119423
|
const dataUnit = params.context.dataUnit;
|
|
119413
|
-
|
|
119414
|
-
const builder = uiBuilders.get(
|
|
119415
|
-
this._gui = builder(
|
|
119424
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
119425
|
+
const builder = uiBuilders.get(this._fieldMetadata.userInterface) || buildTextInput;
|
|
119426
|
+
this._gui = builder(this._fieldMetadata);
|
|
119416
119427
|
if (this._gui.valueSetter != undefined) {
|
|
119417
119428
|
this._gui.valueSetter(params.value);
|
|
119418
119429
|
}
|
|
@@ -119436,10 +119447,147 @@ class EzCellEditor {
|
|
|
119436
119447
|
isPopup() {
|
|
119437
119448
|
return this._gui.isPopUp;
|
|
119438
119449
|
}
|
|
119450
|
+
getFieldMetadata() {
|
|
119451
|
+
return this._fieldMetadata;
|
|
119452
|
+
}
|
|
119453
|
+
}
|
|
119454
|
+
|
|
119455
|
+
class EzGridCustomCellEditor extends EzCellEditor {
|
|
119456
|
+
init(params) {
|
|
119457
|
+
var _a, _b;
|
|
119458
|
+
this._value = params.value;
|
|
119459
|
+
this._fieldName = params.column.getColId();
|
|
119460
|
+
this._customEditorInstance = params.customEditorsInfo.customEditor;
|
|
119461
|
+
super.init(params);
|
|
119462
|
+
this._defaultGui = this.getDefaultGui();
|
|
119463
|
+
const fieldMetadata = super.getFieldMetadata();
|
|
119464
|
+
this._params = {
|
|
119465
|
+
value: params.value,
|
|
119466
|
+
charPress: params.charPress,
|
|
119467
|
+
currentEditor: this._defaultGui,
|
|
119468
|
+
name: this._fieldName,
|
|
119469
|
+
source: CustomEditorSource.GRID,
|
|
119470
|
+
detailContext: params.customEditorsInfo.detailContext,
|
|
119471
|
+
setValue: (value) => this.setValue(value),
|
|
119472
|
+
getValue: () => this.getValue(),
|
|
119473
|
+
editorMetadata: {
|
|
119474
|
+
hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
119475
|
+
label: fieldMetadata.label,
|
|
119476
|
+
userInterface: fieldMetadata.userInterface,
|
|
119477
|
+
props: fieldMetadata.props,
|
|
119478
|
+
optionLoader: fieldMetadata.optionLoader,
|
|
119479
|
+
options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
|
|
119480
|
+
}
|
|
119481
|
+
};
|
|
119482
|
+
}
|
|
119483
|
+
getDefaultGui() {
|
|
119484
|
+
const gui = super.getGui();
|
|
119485
|
+
gui.value = this._value;
|
|
119486
|
+
gui.onkeyup = (event) => {
|
|
119487
|
+
const value = event.target.value;
|
|
119488
|
+
this.setValue(value);
|
|
119489
|
+
};
|
|
119490
|
+
return gui;
|
|
119491
|
+
}
|
|
119492
|
+
getGui() {
|
|
119493
|
+
const editorElement = this._customEditorInstance.getEditorElement(this._params);
|
|
119494
|
+
if (!editorElement) {
|
|
119495
|
+
return this._defaultGui;
|
|
119496
|
+
}
|
|
119497
|
+
if (typeof editorElement === 'string') {
|
|
119498
|
+
const element = HTMLBuilder.parseElement(editorElement);
|
|
119499
|
+
return element;
|
|
119500
|
+
}
|
|
119501
|
+
return editorElement;
|
|
119502
|
+
}
|
|
119503
|
+
setValue(value) {
|
|
119504
|
+
this._value = value;
|
|
119505
|
+
}
|
|
119506
|
+
getValue() {
|
|
119507
|
+
return this._value;
|
|
119508
|
+
}
|
|
119509
|
+
}
|
|
119510
|
+
|
|
119511
|
+
class EzCellRender {
|
|
119512
|
+
init(params) {
|
|
119513
|
+
const span = document.createElement('span');
|
|
119514
|
+
this._currentParams = params;
|
|
119515
|
+
span.textContent = params.value;
|
|
119516
|
+
const fieldName = params.column.getColId();
|
|
119517
|
+
const dataUnit = params.context.dataUnit;
|
|
119518
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
119519
|
+
this._gui = span;
|
|
119520
|
+
}
|
|
119521
|
+
refresh() {
|
|
119522
|
+
try {
|
|
119523
|
+
this._currentParams.refreshCell();
|
|
119524
|
+
return true;
|
|
119525
|
+
}
|
|
119526
|
+
catch (_a) {
|
|
119527
|
+
return false;
|
|
119528
|
+
}
|
|
119529
|
+
}
|
|
119530
|
+
getGui() {
|
|
119531
|
+
return this._gui;
|
|
119532
|
+
}
|
|
119533
|
+
afterGuiAttached() {
|
|
119534
|
+
this.focusIn();
|
|
119535
|
+
}
|
|
119536
|
+
focusIn() {
|
|
119537
|
+
this._gui.focus();
|
|
119538
|
+
this._gui.setFocus({ selectText: true });
|
|
119539
|
+
}
|
|
119540
|
+
getValue() {
|
|
119541
|
+
return this._currentParams.getValue();
|
|
119542
|
+
}
|
|
119543
|
+
isPopup() {
|
|
119544
|
+
return this._gui.isPopUp;
|
|
119545
|
+
}
|
|
119546
|
+
getFieldMetadata() {
|
|
119547
|
+
return this._fieldMetadata;
|
|
119548
|
+
}
|
|
119549
|
+
}
|
|
119550
|
+
|
|
119551
|
+
class EzGridCustomCellRender extends EzCellRender {
|
|
119552
|
+
init(params) {
|
|
119553
|
+
var _a, _b;
|
|
119554
|
+
this._fieldName = params.column.getColId();
|
|
119555
|
+
this._customRenderInstance = params.customRendersInfo.customRender;
|
|
119556
|
+
super.init(params);
|
|
119557
|
+
const fieldMetadata = super.getFieldMetadata();
|
|
119558
|
+
this._params = {
|
|
119559
|
+
value: params.value,
|
|
119560
|
+
charPress: '',
|
|
119561
|
+
currentRender: super.getGui(),
|
|
119562
|
+
name: this._fieldName,
|
|
119563
|
+
source: CustomRenderSource.GRID,
|
|
119564
|
+
getValue: () => params.getValue(),
|
|
119565
|
+
detailContext: params.customRendersInfo.detailContext,
|
|
119566
|
+
renderMetadata: {
|
|
119567
|
+
hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
119568
|
+
label: fieldMetadata.label,
|
|
119569
|
+
userInterface: fieldMetadata.userInterface,
|
|
119570
|
+
props: fieldMetadata.props,
|
|
119571
|
+
optionLoader: fieldMetadata.optionLoader,
|
|
119572
|
+
options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
|
|
119573
|
+
}
|
|
119574
|
+
};
|
|
119575
|
+
}
|
|
119576
|
+
getGui() {
|
|
119577
|
+
const editorElement = this._customRenderInstance.getRenderElement(this._params);
|
|
119578
|
+
if (!editorElement) {
|
|
119579
|
+
return super.getGui();
|
|
119580
|
+
}
|
|
119581
|
+
if (typeof editorElement === 'string') {
|
|
119582
|
+
const element = HTMLBuilder.parseElement(editorElement);
|
|
119583
|
+
return element;
|
|
119584
|
+
}
|
|
119585
|
+
return editorElement;
|
|
119586
|
+
}
|
|
119439
119587
|
}
|
|
119440
119588
|
|
|
119441
119589
|
class GridEditionManager {
|
|
119442
|
-
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled) {
|
|
119590
|
+
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
|
|
119443
119591
|
this._dataUnit = dataUnit;
|
|
119444
119592
|
this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
|
|
119445
119593
|
getRequiredFields: () => this.getRequiredFields(),
|
|
@@ -119448,6 +119596,8 @@ class GridEditionManager {
|
|
|
119448
119596
|
}, recordsValidator);
|
|
119449
119597
|
this._useEnterLikeTab = useEnterLikeTab;
|
|
119450
119598
|
this._editionIsDisabled = editionIsDisabled;
|
|
119599
|
+
this._customEditors = customEditors;
|
|
119600
|
+
this._customRenders = customRenders;
|
|
119451
119601
|
}
|
|
119452
119602
|
configureGrid(options) {
|
|
119453
119603
|
this._gridOptions = options;
|
|
@@ -119514,6 +119664,30 @@ class GridEditionManager {
|
|
|
119514
119664
|
col.suppressKeyboardEvent = (params) => {
|
|
119515
119665
|
return params.event.key === KeyCode.ENTER;
|
|
119516
119666
|
};
|
|
119667
|
+
col.cellEditorSelector = (params) => {
|
|
119668
|
+
var _a;
|
|
119669
|
+
if ((_a = this._customEditors) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
|
|
119670
|
+
const customEditor = this._customEditors.get(params.colDef.field);
|
|
119671
|
+
return {
|
|
119672
|
+
component: EzGridCustomCellEditor,
|
|
119673
|
+
params: {
|
|
119674
|
+
customEditorsInfo: customEditor,
|
|
119675
|
+
}
|
|
119676
|
+
};
|
|
119677
|
+
}
|
|
119678
|
+
};
|
|
119679
|
+
col.cellRendererSelector = (params) => {
|
|
119680
|
+
var _a;
|
|
119681
|
+
if ((_a = this._customRenders) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
|
|
119682
|
+
const customRender = this._customRenders.get(params.colDef.field);
|
|
119683
|
+
return {
|
|
119684
|
+
component: EzGridCustomCellRender,
|
|
119685
|
+
params: {
|
|
119686
|
+
customRendersInfo: customRender,
|
|
119687
|
+
}
|
|
119688
|
+
};
|
|
119689
|
+
}
|
|
119690
|
+
};
|
|
119517
119691
|
return col;
|
|
119518
119692
|
}
|
|
119519
119693
|
getRequiredFields() {
|
|
@@ -119655,6 +119829,12 @@ class GridEditionManager {
|
|
|
119655
119829
|
this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
|
|
119656
119830
|
}
|
|
119657
119831
|
}
|
|
119832
|
+
setCellEditors(customEditors) {
|
|
119833
|
+
this._customEditors = customEditors;
|
|
119834
|
+
}
|
|
119835
|
+
setCellRenders(customRenders) {
|
|
119836
|
+
this._customRenders = customRenders;
|
|
119837
|
+
}
|
|
119658
119838
|
}
|
|
119659
119839
|
class TargetEdition {
|
|
119660
119840
|
constructor(rowIndex, column, backwards) {
|
|
@@ -119699,6 +119879,7 @@ class AgGridController {
|
|
|
119699
119879
|
this._gridConfig = [];
|
|
119700
119880
|
this._filteredColumns = new Map();
|
|
119701
119881
|
this._filterColumnleftPosition = 0;
|
|
119882
|
+
this._customFormatters = new Map();
|
|
119702
119883
|
this._enterprise = enterprise;
|
|
119703
119884
|
}
|
|
119704
119885
|
getGridConfig() {
|
|
@@ -119775,6 +119956,8 @@ class AgGridController {
|
|
|
119775
119956
|
}
|
|
119776
119957
|
initDatagrid(container, options) {
|
|
119777
119958
|
var _a;
|
|
119959
|
+
this._options = options;
|
|
119960
|
+
this._container = container;
|
|
119778
119961
|
if (this._grid === undefined) {
|
|
119779
119962
|
LicenseManager.setLicenseKey(ApplicationContext.getContextValue('__EZUI__GRID_LICENSE__'));
|
|
119780
119963
|
this._columnStateChangeCallback = options.onColumnStateChange;
|
|
@@ -119782,7 +119965,7 @@ class AgGridController {
|
|
|
119782
119965
|
this._doubleClickCallBack = options.onDoubleClick;
|
|
119783
119966
|
this._multipleSelection = options.allowMultipleSelection;
|
|
119784
119967
|
this._dataUnit = options.dataUnit;
|
|
119785
|
-
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled);
|
|
119968
|
+
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders);
|
|
119786
119969
|
this._statusResolver = options.statusResolver;
|
|
119787
119970
|
if (this._dataUnit) {
|
|
119788
119971
|
this._dataUnit.sortingProvider = this;
|
|
@@ -119844,6 +120027,7 @@ class AgGridController {
|
|
|
119844
120027
|
this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
|
|
119845
120028
|
}
|
|
119846
120029
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
120030
|
+
this._customFormatters = options.customFormatters;
|
|
119847
120031
|
}
|
|
119848
120032
|
}
|
|
119849
120033
|
processFormatterCellCallback(params) {
|
|
@@ -120127,12 +120311,33 @@ class AgGridController {
|
|
|
120127
120311
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
120128
120312
|
}
|
|
120129
120313
|
this._gridOptions.api.refreshServerSide({ purge: true });
|
|
120314
|
+
this._options.onRefresh();
|
|
120315
|
+
}
|
|
120316
|
+
focusOnGridContainer() {
|
|
120317
|
+
this._container.setAttribute('tabindex', '-1');
|
|
120318
|
+
this._container.focus();
|
|
120319
|
+
}
|
|
120320
|
+
setFocus() {
|
|
120321
|
+
var _a, _b;
|
|
120322
|
+
if ((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) {
|
|
120323
|
+
this.setFocusFirstRow();
|
|
120324
|
+
}
|
|
120325
|
+
else {
|
|
120326
|
+
this.focusOnGridContainer();
|
|
120327
|
+
}
|
|
120328
|
+
}
|
|
120329
|
+
setAutoFocus(autoFocus) {
|
|
120330
|
+
var _a;
|
|
120331
|
+
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
|
|
120130
120332
|
}
|
|
120131
120333
|
setFocusFirstRow() {
|
|
120132
120334
|
const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
|
|
120133
120335
|
if (firstRow) {
|
|
120134
120336
|
this.setFocusOnRow(firstRow.rowIndex);
|
|
120135
120337
|
}
|
|
120338
|
+
else {
|
|
120339
|
+
this.focusOnGridContainer();
|
|
120340
|
+
}
|
|
120136
120341
|
}
|
|
120137
120342
|
setFocusLastRow() {
|
|
120138
120343
|
const lastRow = this._gridOptions.api.getDisplayedRowAtIndex(this._gridOptions.api.getLastDisplayedRow());
|
|
@@ -120211,7 +120416,7 @@ class AgGridController {
|
|
|
120211
120416
|
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
120212
120417
|
const columnsOffset = colDef.length - columns.length;
|
|
120213
120418
|
let sort = [];
|
|
120214
|
-
state.forEach((cfgColumn, index) => {
|
|
120419
|
+
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
120215
120420
|
const colWidth = this.getColumnWidth(cfgColumn);
|
|
120216
120421
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
120217
120422
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
@@ -120308,12 +120513,19 @@ class AgGridController {
|
|
|
120308
120513
|
showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
|
|
120309
120514
|
},
|
|
120310
120515
|
valueFormatter: params => {
|
|
120311
|
-
if (params.value === undefined) {
|
|
120516
|
+
if (params.value === undefined || params.value === null) {
|
|
120312
120517
|
return "";
|
|
120313
120518
|
}
|
|
120314
120519
|
if (params.value instanceof Promise) {
|
|
120315
120520
|
return "Carregando...";
|
|
120316
120521
|
}
|
|
120522
|
+
const customFormatter = this._customFormatters.get(source.name);
|
|
120523
|
+
if (customFormatter) {
|
|
120524
|
+
const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
|
|
120525
|
+
if (formattedValue) {
|
|
120526
|
+
return formattedValue;
|
|
120527
|
+
}
|
|
120528
|
+
}
|
|
120317
120529
|
if (this._dataUnit) {
|
|
120318
120530
|
return this._dataUnit.getFormattedValue(source.name, params.value);
|
|
120319
120531
|
}
|
|
@@ -120322,6 +120534,13 @@ class AgGridController {
|
|
|
120322
120534
|
cellStyle: this.getStyleByColumn(source),
|
|
120323
120535
|
});
|
|
120324
120536
|
}
|
|
120537
|
+
setCustomFormatters(customFormatters) {
|
|
120538
|
+
this._customFormatters = customFormatters;
|
|
120539
|
+
}
|
|
120540
|
+
refreshSelectedRows() {
|
|
120541
|
+
const selectedNodes = this._gridOptions.api.getSelectedNodes();
|
|
120542
|
+
this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
|
|
120543
|
+
}
|
|
120325
120544
|
getInitCellStyle() {
|
|
120326
120545
|
return {
|
|
120327
120546
|
'line-height': this.getRowHeight() - 1 + 'px',
|
|
@@ -120497,11 +120716,52 @@ class AgGridController {
|
|
|
120497
120716
|
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;
|
|
120498
120717
|
return labelSize > this.DEFAULT_MAX_SIZE ? this.DEFAULT_MAX_SIZE : labelSize;
|
|
120499
120718
|
}
|
|
120719
|
+
setCellEditors(customEditors) {
|
|
120720
|
+
var _a;
|
|
120721
|
+
if (!this._editionManager) {
|
|
120722
|
+
this._customEditors = customEditors;
|
|
120723
|
+
return;
|
|
120724
|
+
}
|
|
120725
|
+
this._editionManager.setCellEditors(customEditors);
|
|
120726
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
120727
|
+
}
|
|
120728
|
+
setCellRenders(customRenders) {
|
|
120729
|
+
var _a;
|
|
120730
|
+
if (!this._editionManager) {
|
|
120731
|
+
this._customRenders = customRenders;
|
|
120732
|
+
return;
|
|
120733
|
+
}
|
|
120734
|
+
this._editionManager.setCellRenders(customRenders);
|
|
120735
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
120736
|
+
}
|
|
120737
|
+
}
|
|
120738
|
+
|
|
120739
|
+
function enableSelectAll(total) {
|
|
120740
|
+
return total !== undefined;
|
|
120741
|
+
}
|
|
120742
|
+
function buildSelectAllLabel(allRecordSelected, count, total) {
|
|
120743
|
+
if (allRecordSelected)
|
|
120744
|
+
return 'Selecionar apenas a página atual';
|
|
120745
|
+
if (total === undefined)
|
|
120746
|
+
return `Carregando todos os ${count} registros`;
|
|
120747
|
+
return `Selecionar todos os ${total} registros`;
|
|
120748
|
+
}
|
|
120749
|
+
function buildSelectAllTitle(total) {
|
|
120750
|
+
if (enableSelectAll(total))
|
|
120751
|
+
return '';
|
|
120752
|
+
return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
|
|
120753
|
+
}
|
|
120754
|
+
function getText(selectionCount, allSelectedRecords) {
|
|
120755
|
+
if (allSelectedRecords) {
|
|
120756
|
+
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
120757
|
+
}
|
|
120758
|
+
const pluralCharacter = selectionCount > 1 ? "s" : "";
|
|
120759
|
+
return `Há <strong>${selectionCount} registro${pluralCharacter}</strong> selecionado${pluralCharacter} na grade.`;
|
|
120500
120760
|
}
|
|
120501
120761
|
|
|
120502
120762
|
const SelectionCounter = (props) => {
|
|
120503
120763
|
const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
120504
|
-
const { total, hasMore } = paginationInfo || {};
|
|
120764
|
+
const { total, hasMore, count } = paginationInfo || {};
|
|
120505
120765
|
const shouldRenderSelectionButton = () => {
|
|
120506
120766
|
if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
|
|
120507
120767
|
return false;
|
|
@@ -120515,20 +120775,11 @@ const SelectionCounter = (props) => {
|
|
|
120515
120775
|
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"))),
|
|
120516
120776
|
h("div", { class: "ez-flex ez-margin-right--medium" },
|
|
120517
120777
|
shouldRenderSelectionButton() &&
|
|
120518
|
-
h("ez-button", Object.assign({ class: "ez-margin-right--medium", label:
|
|
120519
|
-
h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
|
|
120778
|
+
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"}`))),
|
|
120779
|
+
h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
|
|
120520
120780
|
h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
|
|
120521
120781
|
h("ez-icon", { iconName: "close" })))));
|
|
120522
120782
|
};
|
|
120523
|
-
function getText(selectionCount, allSelectedRecords) {
|
|
120524
|
-
if (allSelectedRecords) {
|
|
120525
|
-
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
120526
|
-
}
|
|
120527
|
-
else {
|
|
120528
|
-
const pluralChar = selectionCount > 1 ? "s" : "";
|
|
120529
|
-
return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
|
|
120530
|
-
}
|
|
120531
|
-
}
|
|
120532
120783
|
function getElementID(sufix) {
|
|
120533
120784
|
return {
|
|
120534
120785
|
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
|
|
@@ -120690,7 +120941,7 @@ class InMemoryFilterColumnDataSource {
|
|
|
120690
120941
|
}
|
|
120691
120942
|
}
|
|
120692
120943
|
|
|
120693
|
-
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}";
|
|
120944
|
+
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}";
|
|
120694
120945
|
|
|
120695
120946
|
const windowInstace = window;
|
|
120696
120947
|
const matches = (text, filter) => {
|
|
@@ -120708,6 +120959,8 @@ const EzGrid = class {
|
|
|
120708
120959
|
this.componentReady = createEvent(this, "componentReady", 7);
|
|
120709
120960
|
this._gridController = new AgGridController(false);
|
|
120710
120961
|
this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
|
|
120962
|
+
this._customEditor = new Map();
|
|
120963
|
+
this._customRenders = new Map();
|
|
120711
120964
|
this._paginationInfo = undefined;
|
|
120712
120965
|
this._paginationChangedByKeyboard = true;
|
|
120713
120966
|
this._showSelectionCounter = false;
|
|
@@ -120715,6 +120968,7 @@ const EzGrid = class {
|
|
|
120715
120968
|
this._currentPageSelected = undefined;
|
|
120716
120969
|
this._selectionCount = undefined;
|
|
120717
120970
|
this._hasLeftButtons = false;
|
|
120971
|
+
this._customFormatters = new Map();
|
|
120718
120972
|
this.multipleSelection = undefined;
|
|
120719
120973
|
this.config = undefined;
|
|
120720
120974
|
this.selectionToastConfig = undefined;
|
|
@@ -120725,6 +120979,7 @@ const EzGrid = class {
|
|
|
120725
120979
|
this.useEnterLikeTab = false;
|
|
120726
120980
|
this.recordsValidator = undefined;
|
|
120727
120981
|
this.canEdit = true;
|
|
120982
|
+
this.autoFocus = true;
|
|
120728
120983
|
}
|
|
120729
120984
|
/**
|
|
120730
120985
|
* Aplica a definição de colunas.
|
|
@@ -120786,6 +121041,69 @@ const EzGrid = class {
|
|
|
120786
121041
|
async filterColumns(search) {
|
|
120787
121042
|
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
120788
121043
|
}
|
|
121044
|
+
/**
|
|
121045
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
121046
|
+
*/
|
|
121047
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
|
121048
|
+
const newCustomEditor = new Map(this._customEditor);
|
|
121049
|
+
newCustomEditor.set(fieldName, {
|
|
121050
|
+
customEditor,
|
|
121051
|
+
detailContext,
|
|
121052
|
+
});
|
|
121053
|
+
this._customEditor = newCustomEditor;
|
|
121054
|
+
this._gridController.setCellEditors(newCustomEditor);
|
|
121055
|
+
}
|
|
121056
|
+
/**
|
|
121057
|
+
* Registra um render customizado para colunas da grid.
|
|
121058
|
+
*/
|
|
121059
|
+
async addGridCustomRender(fieldName, customRender, detailContext) {
|
|
121060
|
+
const newCustomRenders = new Map(this._customRenders);
|
|
121061
|
+
newCustomRenders.set(fieldName, { customRender, detailContext });
|
|
121062
|
+
this._customRenders = newCustomRenders;
|
|
121063
|
+
this._gridController.setCellRenders(newCustomRenders);
|
|
121064
|
+
}
|
|
121065
|
+
/**
|
|
121066
|
+
* Registra um formatador de valores para uma coluna da grid.
|
|
121067
|
+
*/
|
|
121068
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
|
121069
|
+
if (!columnName || !customFormatter) {
|
|
121070
|
+
return;
|
|
121071
|
+
}
|
|
121072
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
121073
|
+
newCustomFormatters.set(columnName, customFormatter);
|
|
121074
|
+
this._customFormatters = newCustomFormatters;
|
|
121075
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
121076
|
+
}
|
|
121077
|
+
/**
|
|
121078
|
+
* Remove o formatador de valores de uma coluna da grid.
|
|
121079
|
+
*/
|
|
121080
|
+
async removeCustomValueFormatter(columnName) {
|
|
121081
|
+
if (!columnName) {
|
|
121082
|
+
return;
|
|
121083
|
+
}
|
|
121084
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
121085
|
+
newCustomFormatters.delete(columnName);
|
|
121086
|
+
this._customFormatters = newCustomFormatters;
|
|
121087
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
121088
|
+
}
|
|
121089
|
+
/**
|
|
121090
|
+
* Atualiza linhas da grade.
|
|
121091
|
+
*/
|
|
121092
|
+
async refreshSelectedRows() {
|
|
121093
|
+
this._gridController.refreshSelectedRows();
|
|
121094
|
+
}
|
|
121095
|
+
/**
|
|
121096
|
+
* Retorna o formatador customizado da coluna caso exista.
|
|
121097
|
+
*/
|
|
121098
|
+
async getCustomValueFormatter(columnName) {
|
|
121099
|
+
return this._customFormatters.get(columnName);
|
|
121100
|
+
}
|
|
121101
|
+
/**
|
|
121102
|
+
* Atribui o foco para a grade.
|
|
121103
|
+
*/
|
|
121104
|
+
async setFocus() {
|
|
121105
|
+
this._gridController.setFocus();
|
|
121106
|
+
}
|
|
120789
121107
|
observeConfig(config) {
|
|
120790
121108
|
this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
|
|
120791
121109
|
}
|
|
@@ -120939,7 +121257,9 @@ const EzGrid = class {
|
|
|
120939
121257
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
120940
121258
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
120941
121259
|
const dtInfo = { id: 'ezGrid' };
|
|
120942
|
-
|
|
121260
|
+
if (this._refPaginationControl) {
|
|
121261
|
+
ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
|
|
121262
|
+
}
|
|
120943
121263
|
}
|
|
120944
121264
|
previousPage() {
|
|
120945
121265
|
if (this.dataUnit) {
|
|
@@ -120959,14 +121279,10 @@ const EzGrid = class {
|
|
|
120959
121279
|
(_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
|
|
120960
121280
|
}
|
|
120961
121281
|
getPaginationControl() {
|
|
120962
|
-
if (this._paginationInfo)
|
|
120963
|
-
|
|
120964
|
-
|
|
120965
|
-
|
|
120966
|
-
h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, 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" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
|
|
120967
|
-
];
|
|
120968
|
-
}
|
|
120969
|
-
return null;
|
|
121282
|
+
if (!this._paginationInfo)
|
|
121283
|
+
return null;
|
|
121284
|
+
const { currentPage, hasMore } = this._paginationInfo;
|
|
121285
|
+
return (h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())), h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, 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" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
|
|
120970
121286
|
}
|
|
120971
121287
|
componentDidLoad() {
|
|
120972
121288
|
this._gridController.initDatagrid(this._container, {
|
|
@@ -120987,7 +121303,14 @@ const EzGrid = class {
|
|
|
120987
121303
|
statusResolver: this.statusResolver,
|
|
120988
121304
|
useEnterLikeTab: this.useEnterLikeTab,
|
|
120989
121305
|
recordsValidator: this.recordsValidator,
|
|
120990
|
-
editionIsDisabled: () => !this.canEdit
|
|
121306
|
+
editionIsDisabled: () => !this.canEdit,
|
|
121307
|
+
customFormatters: this._customFormatters,
|
|
121308
|
+
autoFocus: this.autoFocus,
|
|
121309
|
+
onRefresh: () => {
|
|
121310
|
+
if (this.dataUnit) {
|
|
121311
|
+
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
121312
|
+
}
|
|
121313
|
+
}
|
|
120991
121314
|
});
|
|
120992
121315
|
if (this.config) {
|
|
120993
121316
|
this.observeConfig(this.config);
|
|
@@ -121003,7 +121326,7 @@ const EzGrid = class {
|
|
|
121003
121326
|
}
|
|
121004
121327
|
handlePaginationChange(selectFirstRecord, paginationInfo) {
|
|
121005
121328
|
var _a;
|
|
121006
|
-
if (selectFirstRecord !== false) {
|
|
121329
|
+
if (selectFirstRecord !== false && this.autoFocus) {
|
|
121007
121330
|
if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
|
|
121008
121331
|
this._gridController.setFocusLastRow();
|
|
121009
121332
|
}
|
|
@@ -121073,6 +121396,9 @@ const EzGrid = class {
|
|
|
121073
121396
|
if (!this.dataUnit.name.includes("InMemoryDataUnit"))
|
|
121074
121397
|
return;
|
|
121075
121398
|
}
|
|
121399
|
+
componentDidUpdate() {
|
|
121400
|
+
this._gridController.setAutoFocus(this.autoFocus);
|
|
121401
|
+
}
|
|
121076
121402
|
getDataSource() {
|
|
121077
121403
|
var _a;
|
|
121078
121404
|
return (_a = this.columnfilterDataSource) !== null && _a !== void 0 ? _a : new InMemoryFilterColumnDataSource(this.dataUnit);
|
|
@@ -121082,7 +121408,7 @@ const EzGrid = class {
|
|
|
121082
121408
|
}
|
|
121083
121409
|
render() {
|
|
121084
121410
|
var _a;
|
|
121085
|
-
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })),
|
|
121411
|
+
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })), this.getPaginationControl())), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
|
|
121086
121412
|
${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
|
|
121087
121413
|
` }, 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) })), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
|
|
121088
121414
|
}
|