@sankhyalabs/ezui 5.21.4 → 5.22.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ICustomRender-6fafffce.js +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -0
- package/dist/cjs/ez-chart.cjs.entry.js +435 -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} +99 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +37 -5
- package/dist/cjs/ez-form.cjs.entry.js +81 -2
- package/dist/cjs/ez-grid.cjs.entry.js +312 -40
- package/dist/cjs/ez-list.cjs.entry.js +10 -2
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -1
- package/dist/cjs/ez-modal.cjs.entry.js +7 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +37 -31
- package/dist/cjs/ez-scroller_2.cjs.entry.js +222 -0
- package/dist/cjs/ez-search.cjs.entry.js +40 -33
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +92 -0
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -0
- package/dist/cjs/ez-tabselector.cjs.entry.js +8 -2
- package/dist/cjs/{ez-scroller_3.cjs.entry.js → ez-tree.cjs.entry.js} +0 -215
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +16 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- 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 +286 -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 +278 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +110 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +51 -22
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +6 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +36 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +59 -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 +10 -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/controller/ag-grid/test/constants/GridEditionMock.js +40 -0
- package/dist/collection/components/ez-grid/ez-grid.js +235 -12
- 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/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-list/ez-list.js +28 -2
- package/dist/collection/components/ez-modal/ez-modal.js +25 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +20 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +46 -31
- package/dist/collection/components/ez-search/ez-search.js +39 -33
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +6 -2
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +180 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js +293 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js +5 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js +3 -0
- package/dist/collection/components/ez-sidebar-navigator/messages/constants.js +5 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +34 -2
- 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 +31 -1
- 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 +18 -0
- package/dist/custom-elements/index.js +1173 -127
- package/dist/esm/ICustomRender-875b5a40.js +13 -0
- package/dist/esm/ez-actions-button.entry.js +1 -0
- package/dist/esm/ez-chart.entry.js +431 -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} +101 -3
- package/dist/esm/ez-form-view.entry.js +37 -5
- package/dist/esm/ez-form.entry.js +82 -3
- package/dist/esm/ez-grid.entry.js +312 -40
- package/dist/esm/ez-list.entry.js +10 -2
- package/dist/esm/ez-modal-container.entry.js +2 -1
- package/dist/esm/ez-modal.entry.js +7 -1
- package/dist/esm/ez-number-input.entry.js +38 -32
- package/dist/esm/ez-scroller_2.entry.js +217 -0
- package/dist/esm/ez-search.entry.js +40 -33
- package/dist/esm/ez-sidebar-navigator.entry.js +88 -0
- package/dist/esm/ez-split-item.entry.js +1 -0
- package/dist/esm/ez-tabselector.entry.js +8 -2
- package/dist/esm/{ez-scroller_3.entry.js → ez-tree.entry.js} +3 -216
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +16 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-2097d0cf.entry.js +1 -0
- package/dist/ezui/{p-9fbb0f01.entry.js → p-32e553e5.entry.js} +2 -2
- package/dist/ezui/p-34b6916c.entry.js +1 -0
- package/dist/ezui/p-3b4eeeb6.entry.js +1 -0
- package/dist/ezui/p-42533ea4.entry.js +1 -0
- package/dist/ezui/p-4607fb89.js +1 -0
- package/dist/ezui/p-4d5235f1.entry.js +1 -0
- package/dist/ezui/p-5b205c80.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-8888d9ed.entry.js +1 -0
- package/dist/ezui/p-922ac38b.entry.js +1 -0
- package/dist/ezui/p-a31b9c90.entry.js +1 -0
- package/dist/ezui/p-aba3da00.entry.js +1 -0
- package/dist/ezui/p-bcb53f27.entry.js +1 -0
- package/dist/ezui/p-c0d9c4f8.entry.js +1 -0
- package/dist/ezui/p-cdc472cc.entry.js +1 -0
- package/dist/ezui/p-ecc2c1ec.entry.js +1 -0
- package/dist/ezui/p-fcf0acce.entry.js +1 -0
- 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 +48 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +16 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +37 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +13 -4
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -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 +6 -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/controller/ag-grid/test/constants/GridEditionMock.d.ts +6 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +34 -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/test/resources/gridDataUnit.d.ts +2 -0
- package/dist/types/components/ez-list/ez-list.d.ts +5 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +5 -0
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -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 +4 -2
- package/dist/types/components/ez-sidebar-navigator/ez-sidebar-navigator.d.ts +57 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.d.ts +4 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/index.d.ts +3 -0
- package/dist/types/components/ez-sidebar-navigator/messages/constants.d.ts +5 -0
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -1
- package/dist/types/components.d.ts +351 -5
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +31 -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 +5 -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 +3 -0
- package/react/components.js +3 -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-2dcb50d4.entry.js +0 -1
- package/dist/ezui/p-30775e7f.entry.js +0 -1
- package/dist/ezui/p-41ac6cd9.entry.js +0 -1
- package/dist/ezui/p-637f69f2.entry.js +0 -1
- package/dist/ezui/p-786559c5.entry.js +0 -1
- package/dist/ezui/p-91f626d3.entry.js +0 -1
- package/dist/ezui/p-99ead599.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-db77a984.entry.js +0 -1
- package/dist/ezui/p-f3c526cc.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
|
|
|
@@ -118861,7 +118862,9 @@ class DataSource {
|
|
|
118861
118862
|
}
|
|
118862
118863
|
}
|
|
118863
118864
|
handleFocusFirstRow() {
|
|
118864
|
-
this.
|
|
118865
|
+
if (this._options.autoFocus) {
|
|
118866
|
+
this._controller.setFocusFirstRow();
|
|
118867
|
+
}
|
|
118865
118868
|
}
|
|
118866
118869
|
isSilentChange(action) {
|
|
118867
118870
|
//TODO: Provisorio p/ não atualizar a grade quando a alteração for apenas de campos transisntes
|
|
@@ -118937,6 +118940,9 @@ class DataSource {
|
|
|
118937
118940
|
this._controller.selectRows(selectionInfo.recordIds, true);
|
|
118938
118941
|
}
|
|
118939
118942
|
}
|
|
118943
|
+
setAutoFocus(autoFocus) {
|
|
118944
|
+
this._options.autoFocus = autoFocus;
|
|
118945
|
+
}
|
|
118940
118946
|
getRows(params) {
|
|
118941
118947
|
if (this.needReload(params)) {
|
|
118942
118948
|
this._lastLoadingParams = params;
|
|
@@ -119322,8 +119328,9 @@ const buildDateTime = ({ readOnly }) => {
|
|
|
119322
119328
|
};
|
|
119323
119329
|
|
|
119324
119330
|
const buildDecimal = ({ readOnly, props }) => {
|
|
119325
|
-
|
|
119326
|
-
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);
|
|
119327
119334
|
return buildNumeric(readOnly, precision, prettyPrecision);
|
|
119328
119335
|
};
|
|
119329
119336
|
const buildInteger = ({ readOnly }) => {
|
|
@@ -119417,11 +119424,12 @@ uiBuilders.set(core.UserInterface.LONGTEXT, buildTextAreaInput);
|
|
|
119417
119424
|
uiBuilders.set(core.UserInterface.SEARCH, buildSearch);
|
|
119418
119425
|
class EzCellEditor {
|
|
119419
119426
|
init(params) {
|
|
119427
|
+
this._rowData = params.data;
|
|
119420
119428
|
const fieldName = params.column.getColId();
|
|
119421
119429
|
const dataUnit = params.context.dataUnit;
|
|
119422
|
-
|
|
119423
|
-
const builder = uiBuilders.get(
|
|
119424
|
-
this._gui = builder(
|
|
119430
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
119431
|
+
const builder = uiBuilders.get(this._fieldMetadata.userInterface) || buildTextInput;
|
|
119432
|
+
this._gui = builder(this._fieldMetadata);
|
|
119425
119433
|
if (this._gui.valueSetter != undefined) {
|
|
119426
119434
|
this._gui.valueSetter(params.value);
|
|
119427
119435
|
}
|
|
@@ -119445,10 +119453,151 @@ class EzCellEditor {
|
|
|
119445
119453
|
isPopup() {
|
|
119446
119454
|
return this._gui.isPopUp;
|
|
119447
119455
|
}
|
|
119456
|
+
getFieldMetadata() {
|
|
119457
|
+
return this._fieldMetadata;
|
|
119458
|
+
}
|
|
119459
|
+
getRecord() {
|
|
119460
|
+
return this._rowData;
|
|
119461
|
+
}
|
|
119462
|
+
}
|
|
119463
|
+
|
|
119464
|
+
class EzGridCustomCellEditor extends EzCellEditor {
|
|
119465
|
+
init(params) {
|
|
119466
|
+
var _a, _b;
|
|
119467
|
+
this._value = params.value;
|
|
119468
|
+
this._fieldName = params.column.getColId();
|
|
119469
|
+
this._customEditorInstance = params.customEditorsInfo.customEditor;
|
|
119470
|
+
super.init(params);
|
|
119471
|
+
this._defaultGui = this.getDefaultGui();
|
|
119472
|
+
const fieldMetadata = super.getFieldMetadata();
|
|
119473
|
+
this._params = {
|
|
119474
|
+
value: params.value,
|
|
119475
|
+
charPress: params.charPress,
|
|
119476
|
+
currentEditor: this._defaultGui,
|
|
119477
|
+
name: this._fieldName,
|
|
119478
|
+
source: ICustomRender.CustomEditorSource.GRID,
|
|
119479
|
+
detailContext: params.customEditorsInfo.detailContext,
|
|
119480
|
+
setValue: (value) => this.setValue(value),
|
|
119481
|
+
getValue: () => this.getValue(),
|
|
119482
|
+
record: super.getRecord(),
|
|
119483
|
+
editorMetadata: {
|
|
119484
|
+
hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
119485
|
+
label: fieldMetadata.label,
|
|
119486
|
+
userInterface: fieldMetadata.userInterface,
|
|
119487
|
+
props: fieldMetadata.props,
|
|
119488
|
+
optionLoader: fieldMetadata.optionLoader,
|
|
119489
|
+
options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
|
|
119490
|
+
},
|
|
119491
|
+
};
|
|
119492
|
+
}
|
|
119493
|
+
getDefaultGui() {
|
|
119494
|
+
const gui = super.getGui();
|
|
119495
|
+
gui.value = this._value;
|
|
119496
|
+
gui.onkeyup = (event) => {
|
|
119497
|
+
const value = event.target.value;
|
|
119498
|
+
this.setValue(value);
|
|
119499
|
+
};
|
|
119500
|
+
return gui;
|
|
119501
|
+
}
|
|
119502
|
+
getGui() {
|
|
119503
|
+
const editorElement = this._customEditorInstance.getEditorElement(this._params);
|
|
119504
|
+
if (!editorElement) {
|
|
119505
|
+
return this._defaultGui;
|
|
119506
|
+
}
|
|
119507
|
+
if (typeof editorElement === 'string') {
|
|
119508
|
+
const element = core.HTMLBuilder.parseElement(editorElement);
|
|
119509
|
+
return element;
|
|
119510
|
+
}
|
|
119511
|
+
return editorElement;
|
|
119512
|
+
}
|
|
119513
|
+
setValue(value) {
|
|
119514
|
+
this._value = value;
|
|
119515
|
+
}
|
|
119516
|
+
getValue() {
|
|
119517
|
+
return this._value;
|
|
119518
|
+
}
|
|
119519
|
+
}
|
|
119520
|
+
|
|
119521
|
+
class EzCellRender {
|
|
119522
|
+
init(params) {
|
|
119523
|
+
const span = document.createElement('span');
|
|
119524
|
+
this._currentParams = params;
|
|
119525
|
+
span.textContent = params.value;
|
|
119526
|
+
const fieldName = params.column.getColId();
|
|
119527
|
+
const dataUnit = params.context.dataUnit;
|
|
119528
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
119529
|
+
this._gui = span;
|
|
119530
|
+
}
|
|
119531
|
+
refresh() {
|
|
119532
|
+
try {
|
|
119533
|
+
this._currentParams.refreshCell();
|
|
119534
|
+
return true;
|
|
119535
|
+
}
|
|
119536
|
+
catch (_a) {
|
|
119537
|
+
return false;
|
|
119538
|
+
}
|
|
119539
|
+
}
|
|
119540
|
+
getGui() {
|
|
119541
|
+
return this._gui;
|
|
119542
|
+
}
|
|
119543
|
+
afterGuiAttached() {
|
|
119544
|
+
this.focusIn();
|
|
119545
|
+
}
|
|
119546
|
+
focusIn() {
|
|
119547
|
+
this._gui.focus();
|
|
119548
|
+
this._gui.setFocus({ selectText: true });
|
|
119549
|
+
}
|
|
119550
|
+
getValue() {
|
|
119551
|
+
return this._currentParams.getValue();
|
|
119552
|
+
}
|
|
119553
|
+
isPopup() {
|
|
119554
|
+
return this._gui.isPopUp;
|
|
119555
|
+
}
|
|
119556
|
+
getFieldMetadata() {
|
|
119557
|
+
return this._fieldMetadata;
|
|
119558
|
+
}
|
|
119559
|
+
}
|
|
119560
|
+
|
|
119561
|
+
class EzGridCustomCellRender extends EzCellRender {
|
|
119562
|
+
init(params) {
|
|
119563
|
+
var _a, _b;
|
|
119564
|
+
this._fieldName = params.column.getColId();
|
|
119565
|
+
this._customRenderInstance = params.customRendersInfo.customRender;
|
|
119566
|
+
super.init(params);
|
|
119567
|
+
const fieldMetadata = super.getFieldMetadata();
|
|
119568
|
+
this._params = {
|
|
119569
|
+
value: params.value,
|
|
119570
|
+
charPress: '',
|
|
119571
|
+
currentRender: super.getGui(),
|
|
119572
|
+
name: this._fieldName,
|
|
119573
|
+
source: ICustomRender.CustomRenderSource.GRID,
|
|
119574
|
+
getValue: () => params.getValue(),
|
|
119575
|
+
detailContext: params.customRendersInfo.detailContext,
|
|
119576
|
+
renderMetadata: {
|
|
119577
|
+
hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
119578
|
+
label: fieldMetadata.label,
|
|
119579
|
+
userInterface: fieldMetadata.userInterface,
|
|
119580
|
+
props: fieldMetadata.props,
|
|
119581
|
+
optionLoader: fieldMetadata.optionLoader,
|
|
119582
|
+
options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
|
|
119583
|
+
}
|
|
119584
|
+
};
|
|
119585
|
+
}
|
|
119586
|
+
getGui() {
|
|
119587
|
+
const editorElement = this._customRenderInstance.getRenderElement(this._params);
|
|
119588
|
+
if (!editorElement) {
|
|
119589
|
+
return super.getGui();
|
|
119590
|
+
}
|
|
119591
|
+
if (typeof editorElement === 'string') {
|
|
119592
|
+
const element = core.HTMLBuilder.parseElement(editorElement);
|
|
119593
|
+
return element;
|
|
119594
|
+
}
|
|
119595
|
+
return editorElement;
|
|
119596
|
+
}
|
|
119448
119597
|
}
|
|
119449
119598
|
|
|
119450
119599
|
class GridEditionManager {
|
|
119451
|
-
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled) {
|
|
119600
|
+
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
|
|
119452
119601
|
this._dataUnit = dataUnit;
|
|
119453
119602
|
this._recordValidationProcessor = new RecordValidationProcessor.RecordValidationProcessor(this._dataUnit, {
|
|
119454
119603
|
getRequiredFields: () => this.getRequiredFields(),
|
|
@@ -119457,6 +119606,8 @@ class GridEditionManager {
|
|
|
119457
119606
|
}, recordsValidator);
|
|
119458
119607
|
this._useEnterLikeTab = useEnterLikeTab;
|
|
119459
119608
|
this._editionIsDisabled = editionIsDisabled;
|
|
119609
|
+
this._customEditors = customEditors;
|
|
119610
|
+
this._customRenders = customRenders;
|
|
119460
119611
|
}
|
|
119461
119612
|
configureGrid(options) {
|
|
119462
119613
|
this._gridOptions = options;
|
|
@@ -119474,7 +119625,7 @@ class GridEditionManager {
|
|
|
119474
119625
|
this.saveSuccess();
|
|
119475
119626
|
return;
|
|
119476
119627
|
}
|
|
119477
|
-
if (!this._isGridEdition) {
|
|
119628
|
+
if (!this._isGridEdition || this._dataUnit.hasNewRecord()) {
|
|
119478
119629
|
return;
|
|
119479
119630
|
}
|
|
119480
119631
|
const currentRercord = this._dataUnit.getSelectedRecord();
|
|
@@ -119523,6 +119674,30 @@ class GridEditionManager {
|
|
|
119523
119674
|
col.suppressKeyboardEvent = (params) => {
|
|
119524
119675
|
return params.event.key === KeyCode.ENTER;
|
|
119525
119676
|
};
|
|
119677
|
+
col.cellEditorSelector = (params) => {
|
|
119678
|
+
var _a;
|
|
119679
|
+
if ((_a = this._customEditors) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
|
|
119680
|
+
const customEditor = this._customEditors.get(params.colDef.field);
|
|
119681
|
+
return {
|
|
119682
|
+
component: EzGridCustomCellEditor,
|
|
119683
|
+
params: {
|
|
119684
|
+
customEditorsInfo: customEditor,
|
|
119685
|
+
}
|
|
119686
|
+
};
|
|
119687
|
+
}
|
|
119688
|
+
};
|
|
119689
|
+
col.cellRendererSelector = (params) => {
|
|
119690
|
+
var _a;
|
|
119691
|
+
if ((_a = this._customRenders) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
|
|
119692
|
+
const customRender = this._customRenders.get(params.colDef.field);
|
|
119693
|
+
return {
|
|
119694
|
+
component: EzGridCustomCellRender,
|
|
119695
|
+
params: {
|
|
119696
|
+
customRendersInfo: customRender,
|
|
119697
|
+
}
|
|
119698
|
+
};
|
|
119699
|
+
}
|
|
119700
|
+
};
|
|
119526
119701
|
return col;
|
|
119527
119702
|
}
|
|
119528
119703
|
getRequiredFields() {
|
|
@@ -119668,6 +119843,12 @@ class GridEditionManager {
|
|
|
119668
119843
|
this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
|
|
119669
119844
|
}
|
|
119670
119845
|
}
|
|
119846
|
+
setCellEditors(customEditors) {
|
|
119847
|
+
this._customEditors = customEditors;
|
|
119848
|
+
}
|
|
119849
|
+
setCellRenders(customRenders) {
|
|
119850
|
+
this._customRenders = customRenders;
|
|
119851
|
+
}
|
|
119671
119852
|
}
|
|
119672
119853
|
class TargetEdition {
|
|
119673
119854
|
constructor(rowIndex, column, backwards) {
|
|
@@ -119704,14 +119885,13 @@ class AgGridController {
|
|
|
119704
119885
|
this.STATUS_COL_ID = 'statusColumn';
|
|
119705
119886
|
this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
|
|
119706
119887
|
this.BLOCK_LOAD_DEBOUNCE = 100;
|
|
119707
|
-
this.
|
|
119708
|
-
this.DEFAULT_ICON_SIZE = 12;
|
|
119709
|
-
this.DEFAULT_MAX_SIZE = 200;
|
|
119888
|
+
this.DOC_WIDTH = 1150;
|
|
119710
119889
|
this._menuItems = [];
|
|
119711
119890
|
this._idAttribName = '__record__id__';
|
|
119712
119891
|
this._gridConfig = [];
|
|
119713
119892
|
this._filteredColumns = new Map();
|
|
119714
119893
|
this._filterColumnleftPosition = 0;
|
|
119894
|
+
this._customFormatters = new Map();
|
|
119715
119895
|
this._enterprise = enterprise;
|
|
119716
119896
|
}
|
|
119717
119897
|
getGridConfig() {
|
|
@@ -119797,7 +119977,7 @@ class AgGridController {
|
|
|
119797
119977
|
this._doubleClickCallBack = options.onDoubleClick;
|
|
119798
119978
|
this._multipleSelection = options.allowMultipleSelection;
|
|
119799
119979
|
this._dataUnit = options.dataUnit;
|
|
119800
|
-
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled);
|
|
119980
|
+
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders);
|
|
119801
119981
|
this._statusResolver = options.statusResolver;
|
|
119802
119982
|
if (this._dataUnit) {
|
|
119803
119983
|
this._dataUnit.sortingProvider = this;
|
|
@@ -119855,6 +120035,7 @@ class AgGridController {
|
|
|
119855
120035
|
this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
|
|
119856
120036
|
}
|
|
119857
120037
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
120038
|
+
this._customFormatters = options.customFormatters;
|
|
119858
120039
|
}
|
|
119859
120040
|
}
|
|
119860
120041
|
processFormatterCellCallback(params) {
|
|
@@ -120153,6 +120334,10 @@ class AgGridController {
|
|
|
120153
120334
|
this.focusOnGridContainer();
|
|
120154
120335
|
}
|
|
120155
120336
|
}
|
|
120337
|
+
setAutoFocus(autoFocus) {
|
|
120338
|
+
var _a;
|
|
120339
|
+
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
|
|
120340
|
+
}
|
|
120156
120341
|
setFocusFirstRow() {
|
|
120157
120342
|
const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
|
|
120158
120343
|
if (firstRow) {
|
|
@@ -120238,9 +120423,11 @@ class AgGridController {
|
|
|
120238
120423
|
//Existem colunas implícitas que não tem estado, essas colunas são sempre as primeiras.
|
|
120239
120424
|
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
120240
120425
|
const columnsOffset = colDef.length - columns.length;
|
|
120426
|
+
this._gridConfig = state;
|
|
120241
120427
|
let sort = [];
|
|
120242
|
-
state.forEach((cfgColumn, index) => {
|
|
120243
|
-
|
|
120428
|
+
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
120429
|
+
var _a;
|
|
120430
|
+
const colWidth = (_a = this._gridOptions.columnApi.getColumn(cfgColumn.name)) === null || _a === void 0 ? void 0 : _a.getActualWidth();
|
|
120244
120431
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
120245
120432
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
120246
120433
|
visibleColumns.push(cfgColumn.name);
|
|
@@ -120255,7 +120442,11 @@ class AgGridController {
|
|
|
120255
120442
|
state: sort,
|
|
120256
120443
|
defaultState: { sort: null },
|
|
120257
120444
|
});
|
|
120258
|
-
|
|
120445
|
+
}
|
|
120446
|
+
getAdaptiveWidth(width) {
|
|
120447
|
+
const widthGrid = this._container.clientWidth;
|
|
120448
|
+
const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
|
|
120449
|
+
return Math.round(adaptiveWidth);
|
|
120259
120450
|
}
|
|
120260
120451
|
getColumnsState() {
|
|
120261
120452
|
if (this._grid === undefined) {
|
|
@@ -120264,13 +120455,15 @@ class AgGridController {
|
|
|
120264
120455
|
const colState = this._gridOptions.columnApi.getColumnState();
|
|
120265
120456
|
return colState
|
|
120266
120457
|
.map(s => {
|
|
120267
|
-
const
|
|
120458
|
+
const column = this._gridOptions.columnApi.getColumn(s.colId);
|
|
120459
|
+
const def = column.getColDef();
|
|
120460
|
+
const width = this.getAdaptiveWidth(column.getActualWidth());
|
|
120268
120461
|
const label = def.headerName;
|
|
120269
120462
|
const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
|
|
120270
120463
|
const colState = { label, name };
|
|
120271
120464
|
this.conditionalSet(colState, 'sort', s.sort);
|
|
120272
120465
|
this.conditionalSet(colState, 'sortIndex', s.sortIndex);
|
|
120273
|
-
this.conditionalSet(colState, 'width',
|
|
120466
|
+
this.conditionalSet(colState, 'width', width);
|
|
120274
120467
|
this.conditionalSet(colState, 'pinned', s.pinned !== null);
|
|
120275
120468
|
this.conditionalSet(colState, 'hidden', s.hide);
|
|
120276
120469
|
const props = new Map();
|
|
@@ -120336,12 +120529,19 @@ class AgGridController {
|
|
|
120336
120529
|
showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
|
|
120337
120530
|
},
|
|
120338
120531
|
valueFormatter: params => {
|
|
120339
|
-
if (params.value === undefined) {
|
|
120532
|
+
if (params.value === undefined || params.value === null) {
|
|
120340
120533
|
return "";
|
|
120341
120534
|
}
|
|
120342
120535
|
if (params.value instanceof Promise) {
|
|
120343
120536
|
return "Carregando...";
|
|
120344
120537
|
}
|
|
120538
|
+
const customFormatter = this._customFormatters.get(source.name);
|
|
120539
|
+
if (customFormatter) {
|
|
120540
|
+
const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
|
|
120541
|
+
if (formattedValue) {
|
|
120542
|
+
return formattedValue;
|
|
120543
|
+
}
|
|
120544
|
+
}
|
|
120345
120545
|
if (this._dataUnit) {
|
|
120346
120546
|
return this._dataUnit.getFormattedValue(source.name, params.value);
|
|
120347
120547
|
}
|
|
@@ -120350,6 +120550,13 @@ class AgGridController {
|
|
|
120350
120550
|
cellStyle: this.getStyleByColumn(source),
|
|
120351
120551
|
});
|
|
120352
120552
|
}
|
|
120553
|
+
setCustomFormatters(customFormatters) {
|
|
120554
|
+
this._customFormatters = customFormatters;
|
|
120555
|
+
}
|
|
120556
|
+
refreshSelectedRows() {
|
|
120557
|
+
const selectedNodes = this._gridOptions.api.getSelectedNodes();
|
|
120558
|
+
this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
|
|
120559
|
+
}
|
|
120353
120560
|
getInitCellStyle() {
|
|
120354
120561
|
return {
|
|
120355
120562
|
'line-height': this.getRowHeight() - 1 + 'px',
|
|
@@ -120510,20 +120717,23 @@ class AgGridController {
|
|
|
120510
120717
|
host[attribute] = value;
|
|
120511
120718
|
}
|
|
120512
120719
|
}
|
|
120513
|
-
|
|
120514
|
-
var _a
|
|
120515
|
-
if (
|
|
120720
|
+
setCellEditors(customEditors) {
|
|
120721
|
+
var _a;
|
|
120722
|
+
if (!this._editionManager) {
|
|
120723
|
+
this._customEditors = customEditors;
|
|
120516
120724
|
return;
|
|
120517
120725
|
}
|
|
120518
|
-
|
|
120519
|
-
|
|
120520
|
-
|
|
120521
|
-
|
|
120522
|
-
|
|
120523
|
-
|
|
120726
|
+
this._editionManager.setCellEditors(customEditors);
|
|
120727
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
120728
|
+
}
|
|
120729
|
+
setCellRenders(customRenders) {
|
|
120730
|
+
var _a;
|
|
120731
|
+
if (!this._editionManager) {
|
|
120732
|
+
this._customRenders = customRenders;
|
|
120733
|
+
return;
|
|
120524
120734
|
}
|
|
120525
|
-
|
|
120526
|
-
|
|
120735
|
+
this._editionManager.setCellRenders(customRenders);
|
|
120736
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
120527
120737
|
}
|
|
120528
120738
|
}
|
|
120529
120739
|
|
|
@@ -120750,6 +120960,8 @@ const EzGrid = class {
|
|
|
120750
120960
|
this.componentReady = index.createEvent(this, "componentReady", 7);
|
|
120751
120961
|
this._gridController = new AgGridController(false);
|
|
120752
120962
|
this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
|
|
120963
|
+
this._customEditor = new Map();
|
|
120964
|
+
this._customRenders = new Map();
|
|
120753
120965
|
this._paginationInfo = undefined;
|
|
120754
120966
|
this._paginationChangedByKeyboard = true;
|
|
120755
120967
|
this._showSelectionCounter = false;
|
|
@@ -120757,6 +120969,7 @@ const EzGrid = class {
|
|
|
120757
120969
|
this._currentPageSelected = undefined;
|
|
120758
120970
|
this._selectionCount = undefined;
|
|
120759
120971
|
this._hasLeftButtons = false;
|
|
120972
|
+
this._customFormatters = new Map();
|
|
120760
120973
|
this.multipleSelection = undefined;
|
|
120761
120974
|
this.config = undefined;
|
|
120762
120975
|
this.selectionToastConfig = undefined;
|
|
@@ -120767,6 +120980,7 @@ const EzGrid = class {
|
|
|
120767
120980
|
this.useEnterLikeTab = false;
|
|
120768
120981
|
this.recordsValidator = undefined;
|
|
120769
120982
|
this.canEdit = true;
|
|
120983
|
+
this.autoFocus = true;
|
|
120770
120984
|
}
|
|
120771
120985
|
/**
|
|
120772
120986
|
* Aplica a definição de colunas.
|
|
@@ -120828,6 +121042,63 @@ const EzGrid = class {
|
|
|
120828
121042
|
async filterColumns(search) {
|
|
120829
121043
|
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
120830
121044
|
}
|
|
121045
|
+
/**
|
|
121046
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
121047
|
+
*/
|
|
121048
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
|
121049
|
+
const newCustomEditor = new Map(this._customEditor);
|
|
121050
|
+
newCustomEditor.set(fieldName, {
|
|
121051
|
+
customEditor,
|
|
121052
|
+
detailContext,
|
|
121053
|
+
});
|
|
121054
|
+
this._customEditor = newCustomEditor;
|
|
121055
|
+
this._gridController.setCellEditors(newCustomEditor);
|
|
121056
|
+
}
|
|
121057
|
+
/**
|
|
121058
|
+
* Registra um render customizado para colunas da grid.
|
|
121059
|
+
*/
|
|
121060
|
+
async addGridCustomRender(fieldName, customRender, detailContext) {
|
|
121061
|
+
const newCustomRenders = new Map(this._customRenders);
|
|
121062
|
+
newCustomRenders.set(fieldName, { customRender, detailContext });
|
|
121063
|
+
this._customRenders = newCustomRenders;
|
|
121064
|
+
this._gridController.setCellRenders(newCustomRenders);
|
|
121065
|
+
}
|
|
121066
|
+
/**
|
|
121067
|
+
* Registra um formatador de valores para uma coluna da grid.
|
|
121068
|
+
*/
|
|
121069
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
|
121070
|
+
if (!columnName || !customFormatter) {
|
|
121071
|
+
return;
|
|
121072
|
+
}
|
|
121073
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
121074
|
+
newCustomFormatters.set(columnName, customFormatter);
|
|
121075
|
+
this._customFormatters = newCustomFormatters;
|
|
121076
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
121077
|
+
}
|
|
121078
|
+
/**
|
|
121079
|
+
* Remove o formatador de valores de uma coluna da grid.
|
|
121080
|
+
*/
|
|
121081
|
+
async removeCustomValueFormatter(columnName) {
|
|
121082
|
+
if (!columnName) {
|
|
121083
|
+
return;
|
|
121084
|
+
}
|
|
121085
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
121086
|
+
newCustomFormatters.delete(columnName);
|
|
121087
|
+
this._customFormatters = newCustomFormatters;
|
|
121088
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
121089
|
+
}
|
|
121090
|
+
/**
|
|
121091
|
+
* Atualiza linhas da grade.
|
|
121092
|
+
*/
|
|
121093
|
+
async refreshSelectedRows() {
|
|
121094
|
+
this._gridController.refreshSelectedRows();
|
|
121095
|
+
}
|
|
121096
|
+
/**
|
|
121097
|
+
* Retorna o formatador customizado da coluna caso exista.
|
|
121098
|
+
*/
|
|
121099
|
+
async getCustomValueFormatter(columnName) {
|
|
121100
|
+
return this._customFormatters.get(columnName);
|
|
121101
|
+
}
|
|
120831
121102
|
/**
|
|
120832
121103
|
* Atribui o foco para a grade.
|
|
120833
121104
|
*/
|
|
@@ -120987,7 +121258,9 @@ const EzGrid = class {
|
|
|
120987
121258
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
120988
121259
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
120989
121260
|
const dtInfo = { id: 'ezGrid' };
|
|
120990
|
-
|
|
121261
|
+
if (this._refPaginationControl) {
|
|
121262
|
+
core.ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
|
|
121263
|
+
}
|
|
120991
121264
|
}
|
|
120992
121265
|
previousPage() {
|
|
120993
121266
|
if (this.dataUnit) {
|
|
@@ -121007,14 +121280,10 @@ const EzGrid = class {
|
|
|
121007
121280
|
(_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
|
|
121008
121281
|
}
|
|
121009
121282
|
getPaginationControl() {
|
|
121010
|
-
if (this._paginationInfo)
|
|
121011
|
-
|
|
121012
|
-
|
|
121013
|
-
|
|
121014
|
-
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" })),
|
|
121015
|
-
];
|
|
121016
|
-
}
|
|
121017
|
-
return null;
|
|
121283
|
+
if (!this._paginationInfo)
|
|
121284
|
+
return null;
|
|
121285
|
+
const { currentPage, hasMore } = this._paginationInfo;
|
|
121286
|
+
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" }))));
|
|
121018
121287
|
}
|
|
121019
121288
|
componentDidLoad() {
|
|
121020
121289
|
this._gridController.initDatagrid(this._container, {
|
|
@@ -121036,6 +121305,8 @@ const EzGrid = class {
|
|
|
121036
121305
|
useEnterLikeTab: this.useEnterLikeTab,
|
|
121037
121306
|
recordsValidator: this.recordsValidator,
|
|
121038
121307
|
editionIsDisabled: () => !this.canEdit,
|
|
121308
|
+
customFormatters: this._customFormatters,
|
|
121309
|
+
autoFocus: this.autoFocus,
|
|
121039
121310
|
onRefresh: () => {
|
|
121040
121311
|
if (this.dataUnit) {
|
|
121041
121312
|
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
@@ -121056,7 +121327,7 @@ const EzGrid = class {
|
|
|
121056
121327
|
}
|
|
121057
121328
|
handlePaginationChange(selectFirstRecord, paginationInfo) {
|
|
121058
121329
|
var _a;
|
|
121059
|
-
if (selectFirstRecord !== false) {
|
|
121330
|
+
if (selectFirstRecord !== false && this.autoFocus) {
|
|
121060
121331
|
if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
|
|
121061
121332
|
this._gridController.setFocusLastRow();
|
|
121062
121333
|
}
|
|
@@ -121127,6 +121398,7 @@ const EzGrid = class {
|
|
|
121127
121398
|
return;
|
|
121128
121399
|
}
|
|
121129
121400
|
componentDidUpdate() {
|
|
121401
|
+
this._gridController.setAutoFocus(this.autoFocus);
|
|
121130
121402
|
if (this.dataUnit) {
|
|
121131
121403
|
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
121132
121404
|
}
|
|
@@ -121140,7 +121412,7 @@ const EzGrid = class {
|
|
|
121140
121412
|
}
|
|
121141
121413
|
render() {
|
|
121142
121414
|
var _a;
|
|
121143
|
-
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
|
|
121144
121416
|
${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
|
|
121145
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" }))));
|
|
121146
121418
|
}
|
|
@@ -13,6 +13,7 @@ const EzList = class {
|
|
|
13
13
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
14
14
|
this.ezSelectItem = index.createEvent(this, "ezSelectItem", 7);
|
|
15
15
|
this.ezCheckChange = index.createEvent(this, "ezCheckChange", 7);
|
|
16
|
+
this.ezDoubleClick = index.createEvent(this, "ezDoubleClick", 7);
|
|
16
17
|
this._listItemsHistory = [];
|
|
17
18
|
this._listItems = [];
|
|
18
19
|
this._listGroupItems = [];
|
|
@@ -525,6 +526,9 @@ const EzList = class {
|
|
|
525
526
|
}
|
|
526
527
|
return index.h("div", { class: className, innerHTML: customContent });
|
|
527
528
|
}
|
|
529
|
+
doubleClickItem(item) {
|
|
530
|
+
this.ezDoubleClick.emit(item);
|
|
531
|
+
}
|
|
528
532
|
render() {
|
|
529
533
|
return (index.h(index.Host, { ref: el => (this._element = el) }, this.useGroups ? (index.h("div", { class: "group-container", ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => {
|
|
530
534
|
this.keyDownHandler(event);
|
|
@@ -534,7 +538,9 @@ const EzList = class {
|
|
|
534
538
|
'hover-feedback': this.hoverFeedback,
|
|
535
539
|
}, key: 'item_' + item.id }, {
|
|
536
540
|
[core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(`ezListItem__${core.StringUtils.replaceAccentuatedChars(item.label)}`),
|
|
537
|
-
}), index.h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''),
|
|
541
|
+
}), index.h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDblClick: () => {
|
|
542
|
+
this.doubleClickItem(item);
|
|
543
|
+
}, onClick: () => {
|
|
538
544
|
this.setSelection(item);
|
|
539
545
|
}, onDragLeave: () => {
|
|
540
546
|
group.sort ? undefined : this.removeOverClass();
|
|
@@ -548,7 +554,9 @@ const EzList = class {
|
|
|
548
554
|
} }, index.h("div", { class: "draggable-list" }, this._listItems.map((item, index$1) => (index.h("li", Object.assign({ id: 'item_' + item.id, class: {
|
|
549
555
|
'selectable-container': this.ezSelectable,
|
|
550
556
|
'hover-feedback': this.hoverFeedback,
|
|
551
|
-
}, key: 'item_' + item.id }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(`ezListItem__${core.StringUtils.replaceAccentuatedChars(item.label)}`) }), index.h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDragStart: () => this.onDragStart({ item: item, index: index$1 }),
|
|
557
|
+
}, key: 'item_' + item.id }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: core.ElementIDUtils.getInternalIDInfo(`ezListItem__${core.StringUtils.replaceAccentuatedChars(item.label)}`) }), index.h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDragStart: () => this.onDragStart({ item: item, index: index$1 }), onDblClick: () => {
|
|
558
|
+
this.doubleClickItem(item);
|
|
559
|
+
}, onClick: () => {
|
|
552
560
|
this.setSelection(item);
|
|
553
561
|
}, onDragLeave: () => this.removeOverClass(), onDragOver: event => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDrop(event, { item: item, index: index$1 }), draggable: this.ezDraggable }, index.h("div", { class: "item-content" }, this.listMode === 'regular' ? (index.h(index.Fragment, null, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item), index.h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label))) : (index.h(index.Fragment, null, this.ezDraggable ? index.h("span", { class: "draggable-icon" }) : undefined, index.h("ez-check", { label: item.label, value: item.check, onEzChange: evt => this.ezCheckChange.emit({ id: item.id, label: item.label, check: evt.detail }) })))), !!this.itemSlotBuilder && this.getContainerItemBuilder('right', item))))), index.h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
|
|
554
562
|
this.onDragOverLastIndex(event);
|
|
@@ -35,6 +35,7 @@ const EzModalContainer = class {
|
|
|
35
35
|
this.okButtonLabel = undefined;
|
|
36
36
|
this.cancelButtonStatus = undefined;
|
|
37
37
|
this.okButtonStatus = undefined;
|
|
38
|
+
this.showCloseButton = true;
|
|
38
39
|
}
|
|
39
40
|
async handleEzModalAction(event) {
|
|
40
41
|
var _a;
|
|
@@ -71,7 +72,7 @@ const EzModalContainer = class {
|
|
|
71
72
|
this._closeButton.focus();
|
|
72
73
|
}
|
|
73
74
|
render() {
|
|
74
|
-
return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), index.h("div", { class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
75
|
+
return (index.h(index.Host, null, index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), index.h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), index.h("div", { class: "ez-modal-container__content" }, index.h("slot", null)), index.h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), index.h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
75
76
|
}
|
|
76
77
|
get _element() { return index.getElement(this); }
|
|
77
78
|
};
|