@sankhyalabs/ezui 5.21.2 → 5.22.0-dev.2
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 +34 -3
- package/dist/cjs/ez-form.cjs.entry.js +77 -2
- package/dist/cjs/ez-grid.cjs.entry.js +313 -39
- package/dist/cjs/ez-list.cjs.entry.js +10 -2
- 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 +39 -32
- 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-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-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 +35 -1
- 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 +237 -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-number-input/ez-number-input.js +46 -31
- package/dist/collection/components/ez-search/ez-search.js +38 -32
- 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/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 +18 -0
- package/dist/custom-elements/index.js +1147 -117
- 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 +34 -3
- package/dist/esm/ez-form.entry.js +78 -3
- package/dist/esm/ez-grid.entry.js +313 -39
- package/dist/esm/ez-list.entry.js +10 -2
- 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 +39 -32
- package/dist/esm/ez-sidebar-navigator.entry.js +88 -0
- package/dist/esm/ez-split-item.entry.js +1 -0
- 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-12ae1104.entry.js +1 -0
- package/dist/ezui/p-2097d0cf.entry.js +1 -0
- package/dist/ezui/p-3b4eeeb6.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-5056284a.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-fbee26ec.entry.js → p-816cece6.entry.js} +2 -2
- 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-9ab22a07.entry.js +1 -0
- package/dist/ezui/p-a31b9c90.entry.js +1 -0
- package/dist/ezui/p-bcb53f27.entry.js +1 -0
- package/dist/ezui/p-ecc2c1ec.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-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 +35 -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-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.d.ts +334 -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 +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 +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-637f69f2.entry.js +0 -1
- package/dist/ezui/p-786559c5.entry.js +0 -1
- package/dist/ezui/p-7c770f14.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
|
@@ -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
|
|
|
@@ -118857,7 +118858,9 @@ class DataSource {
|
|
|
118857
118858
|
}
|
|
118858
118859
|
}
|
|
118859
118860
|
handleFocusFirstRow() {
|
|
118860
|
-
this.
|
|
118861
|
+
if (this._options.autoFocus) {
|
|
118862
|
+
this._controller.setFocusFirstRow();
|
|
118863
|
+
}
|
|
118861
118864
|
}
|
|
118862
118865
|
isSilentChange(action) {
|
|
118863
118866
|
//TODO: Provisorio p/ não atualizar a grade quando a alteração for apenas de campos transisntes
|
|
@@ -118933,6 +118936,9 @@ class DataSource {
|
|
|
118933
118936
|
this._controller.selectRows(selectionInfo.recordIds, true);
|
|
118934
118937
|
}
|
|
118935
118938
|
}
|
|
118939
|
+
setAutoFocus(autoFocus) {
|
|
118940
|
+
this._options.autoFocus = autoFocus;
|
|
118941
|
+
}
|
|
118936
118942
|
getRows(params) {
|
|
118937
118943
|
if (this.needReload(params)) {
|
|
118938
118944
|
this._lastLoadingParams = params;
|
|
@@ -119318,8 +119324,9 @@ const buildDateTime = ({ readOnly }) => {
|
|
|
119318
119324
|
};
|
|
119319
119325
|
|
|
119320
119326
|
const buildDecimal = ({ readOnly, props }) => {
|
|
119321
|
-
|
|
119322
|
-
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);
|
|
119323
119330
|
return buildNumeric(readOnly, precision, prettyPrecision);
|
|
119324
119331
|
};
|
|
119325
119332
|
const buildInteger = ({ readOnly }) => {
|
|
@@ -119412,11 +119419,12 @@ uiBuilders.set(UserInterface.LONGTEXT, buildTextAreaInput);
|
|
|
119412
119419
|
uiBuilders.set(UserInterface.SEARCH, buildSearch);
|
|
119413
119420
|
class EzCellEditor {
|
|
119414
119421
|
init(params) {
|
|
119422
|
+
this._rowData = params.data;
|
|
119415
119423
|
const fieldName = params.column.getColId();
|
|
119416
119424
|
const dataUnit = params.context.dataUnit;
|
|
119417
|
-
|
|
119418
|
-
const builder = uiBuilders.get(
|
|
119419
|
-
this._gui = builder(
|
|
119425
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
119426
|
+
const builder = uiBuilders.get(this._fieldMetadata.userInterface) || buildTextInput;
|
|
119427
|
+
this._gui = builder(this._fieldMetadata);
|
|
119420
119428
|
if (this._gui.valueSetter != undefined) {
|
|
119421
119429
|
this._gui.valueSetter(params.value);
|
|
119422
119430
|
}
|
|
@@ -119440,10 +119448,151 @@ class EzCellEditor {
|
|
|
119440
119448
|
isPopup() {
|
|
119441
119449
|
return this._gui.isPopUp;
|
|
119442
119450
|
}
|
|
119451
|
+
getFieldMetadata() {
|
|
119452
|
+
return this._fieldMetadata;
|
|
119453
|
+
}
|
|
119454
|
+
getRecord() {
|
|
119455
|
+
return this._rowData;
|
|
119456
|
+
}
|
|
119457
|
+
}
|
|
119458
|
+
|
|
119459
|
+
class EzGridCustomCellEditor extends EzCellEditor {
|
|
119460
|
+
init(params) {
|
|
119461
|
+
var _a, _b;
|
|
119462
|
+
this._value = params.value;
|
|
119463
|
+
this._fieldName = params.column.getColId();
|
|
119464
|
+
this._customEditorInstance = params.customEditorsInfo.customEditor;
|
|
119465
|
+
super.init(params);
|
|
119466
|
+
this._defaultGui = this.getDefaultGui();
|
|
119467
|
+
const fieldMetadata = super.getFieldMetadata();
|
|
119468
|
+
this._params = {
|
|
119469
|
+
value: params.value,
|
|
119470
|
+
charPress: params.charPress,
|
|
119471
|
+
currentEditor: this._defaultGui,
|
|
119472
|
+
name: this._fieldName,
|
|
119473
|
+
source: CustomEditorSource.GRID,
|
|
119474
|
+
detailContext: params.customEditorsInfo.detailContext,
|
|
119475
|
+
setValue: (value) => this.setValue(value),
|
|
119476
|
+
getValue: () => this.getValue(),
|
|
119477
|
+
record: super.getRecord(),
|
|
119478
|
+
editorMetadata: {
|
|
119479
|
+
hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
119480
|
+
label: fieldMetadata.label,
|
|
119481
|
+
userInterface: fieldMetadata.userInterface,
|
|
119482
|
+
props: fieldMetadata.props,
|
|
119483
|
+
optionLoader: fieldMetadata.optionLoader,
|
|
119484
|
+
options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
|
|
119485
|
+
},
|
|
119486
|
+
};
|
|
119487
|
+
}
|
|
119488
|
+
getDefaultGui() {
|
|
119489
|
+
const gui = super.getGui();
|
|
119490
|
+
gui.value = this._value;
|
|
119491
|
+
gui.onkeyup = (event) => {
|
|
119492
|
+
const value = event.target.value;
|
|
119493
|
+
this.setValue(value);
|
|
119494
|
+
};
|
|
119495
|
+
return gui;
|
|
119496
|
+
}
|
|
119497
|
+
getGui() {
|
|
119498
|
+
const editorElement = this._customEditorInstance.getEditorElement(this._params);
|
|
119499
|
+
if (!editorElement) {
|
|
119500
|
+
return this._defaultGui;
|
|
119501
|
+
}
|
|
119502
|
+
if (typeof editorElement === 'string') {
|
|
119503
|
+
const element = HTMLBuilder.parseElement(editorElement);
|
|
119504
|
+
return element;
|
|
119505
|
+
}
|
|
119506
|
+
return editorElement;
|
|
119507
|
+
}
|
|
119508
|
+
setValue(value) {
|
|
119509
|
+
this._value = value;
|
|
119510
|
+
}
|
|
119511
|
+
getValue() {
|
|
119512
|
+
return this._value;
|
|
119513
|
+
}
|
|
119514
|
+
}
|
|
119515
|
+
|
|
119516
|
+
class EzCellRender {
|
|
119517
|
+
init(params) {
|
|
119518
|
+
const span = document.createElement('span');
|
|
119519
|
+
this._currentParams = params;
|
|
119520
|
+
span.textContent = params.value;
|
|
119521
|
+
const fieldName = params.column.getColId();
|
|
119522
|
+
const dataUnit = params.context.dataUnit;
|
|
119523
|
+
this._fieldMetadata = buildEditorMetadata(dataUnit.getField(fieldName), params.eGridCell, dataUnit, params.context.editionManager);
|
|
119524
|
+
this._gui = span;
|
|
119525
|
+
}
|
|
119526
|
+
refresh() {
|
|
119527
|
+
try {
|
|
119528
|
+
this._currentParams.refreshCell();
|
|
119529
|
+
return true;
|
|
119530
|
+
}
|
|
119531
|
+
catch (_a) {
|
|
119532
|
+
return false;
|
|
119533
|
+
}
|
|
119534
|
+
}
|
|
119535
|
+
getGui() {
|
|
119536
|
+
return this._gui;
|
|
119537
|
+
}
|
|
119538
|
+
afterGuiAttached() {
|
|
119539
|
+
this.focusIn();
|
|
119540
|
+
}
|
|
119541
|
+
focusIn() {
|
|
119542
|
+
this._gui.focus();
|
|
119543
|
+
this._gui.setFocus({ selectText: true });
|
|
119544
|
+
}
|
|
119545
|
+
getValue() {
|
|
119546
|
+
return this._currentParams.getValue();
|
|
119547
|
+
}
|
|
119548
|
+
isPopup() {
|
|
119549
|
+
return this._gui.isPopUp;
|
|
119550
|
+
}
|
|
119551
|
+
getFieldMetadata() {
|
|
119552
|
+
return this._fieldMetadata;
|
|
119553
|
+
}
|
|
119554
|
+
}
|
|
119555
|
+
|
|
119556
|
+
class EzGridCustomCellRender extends EzCellRender {
|
|
119557
|
+
init(params) {
|
|
119558
|
+
var _a, _b;
|
|
119559
|
+
this._fieldName = params.column.getColId();
|
|
119560
|
+
this._customRenderInstance = params.customRendersInfo.customRender;
|
|
119561
|
+
super.init(params);
|
|
119562
|
+
const fieldMetadata = super.getFieldMetadata();
|
|
119563
|
+
this._params = {
|
|
119564
|
+
value: params.value,
|
|
119565
|
+
charPress: '',
|
|
119566
|
+
currentRender: super.getGui(),
|
|
119567
|
+
name: this._fieldName,
|
|
119568
|
+
source: CustomRenderSource.GRID,
|
|
119569
|
+
getValue: () => params.getValue(),
|
|
119570
|
+
detailContext: params.customRendersInfo.detailContext,
|
|
119571
|
+
renderMetadata: {
|
|
119572
|
+
hidden: ((_a = fieldMetadata.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
119573
|
+
label: fieldMetadata.label,
|
|
119574
|
+
userInterface: fieldMetadata.userInterface,
|
|
119575
|
+
props: fieldMetadata.props,
|
|
119576
|
+
optionLoader: fieldMetadata.optionLoader,
|
|
119577
|
+
options: ((_b = fieldMetadata.props) === null || _b === void 0 ? void 0 : _b.options) || {},
|
|
119578
|
+
}
|
|
119579
|
+
};
|
|
119580
|
+
}
|
|
119581
|
+
getGui() {
|
|
119582
|
+
const editorElement = this._customRenderInstance.getRenderElement(this._params);
|
|
119583
|
+
if (!editorElement) {
|
|
119584
|
+
return super.getGui();
|
|
119585
|
+
}
|
|
119586
|
+
if (typeof editorElement === 'string') {
|
|
119587
|
+
const element = HTMLBuilder.parseElement(editorElement);
|
|
119588
|
+
return element;
|
|
119589
|
+
}
|
|
119590
|
+
return editorElement;
|
|
119591
|
+
}
|
|
119443
119592
|
}
|
|
119444
119593
|
|
|
119445
119594
|
class GridEditionManager {
|
|
119446
|
-
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled) {
|
|
119595
|
+
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders) {
|
|
119447
119596
|
this._dataUnit = dataUnit;
|
|
119448
119597
|
this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
|
|
119449
119598
|
getRequiredFields: () => this.getRequiredFields(),
|
|
@@ -119452,6 +119601,8 @@ class GridEditionManager {
|
|
|
119452
119601
|
}, recordsValidator);
|
|
119453
119602
|
this._useEnterLikeTab = useEnterLikeTab;
|
|
119454
119603
|
this._editionIsDisabled = editionIsDisabled;
|
|
119604
|
+
this._customEditors = customEditors;
|
|
119605
|
+
this._customRenders = customRenders;
|
|
119455
119606
|
}
|
|
119456
119607
|
configureGrid(options) {
|
|
119457
119608
|
this._gridOptions = options;
|
|
@@ -119518,6 +119669,30 @@ class GridEditionManager {
|
|
|
119518
119669
|
col.suppressKeyboardEvent = (params) => {
|
|
119519
119670
|
return params.event.key === KeyCode.ENTER;
|
|
119520
119671
|
};
|
|
119672
|
+
col.cellEditorSelector = (params) => {
|
|
119673
|
+
var _a;
|
|
119674
|
+
if ((_a = this._customEditors) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
|
|
119675
|
+
const customEditor = this._customEditors.get(params.colDef.field);
|
|
119676
|
+
return {
|
|
119677
|
+
component: EzGridCustomCellEditor,
|
|
119678
|
+
params: {
|
|
119679
|
+
customEditorsInfo: customEditor,
|
|
119680
|
+
}
|
|
119681
|
+
};
|
|
119682
|
+
}
|
|
119683
|
+
};
|
|
119684
|
+
col.cellRendererSelector = (params) => {
|
|
119685
|
+
var _a;
|
|
119686
|
+
if ((_a = this._customRenders) === null || _a === void 0 ? void 0 : _a.has(params.colDef.field)) {
|
|
119687
|
+
const customRender = this._customRenders.get(params.colDef.field);
|
|
119688
|
+
return {
|
|
119689
|
+
component: EzGridCustomCellRender,
|
|
119690
|
+
params: {
|
|
119691
|
+
customRendersInfo: customRender,
|
|
119692
|
+
}
|
|
119693
|
+
};
|
|
119694
|
+
}
|
|
119695
|
+
};
|
|
119521
119696
|
return col;
|
|
119522
119697
|
}
|
|
119523
119698
|
getRequiredFields() {
|
|
@@ -119663,6 +119838,12 @@ class GridEditionManager {
|
|
|
119663
119838
|
this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
|
|
119664
119839
|
}
|
|
119665
119840
|
}
|
|
119841
|
+
setCellEditors(customEditors) {
|
|
119842
|
+
this._customEditors = customEditors;
|
|
119843
|
+
}
|
|
119844
|
+
setCellRenders(customRenders) {
|
|
119845
|
+
this._customRenders = customRenders;
|
|
119846
|
+
}
|
|
119666
119847
|
}
|
|
119667
119848
|
class TargetEdition {
|
|
119668
119849
|
constructor(rowIndex, column, backwards) {
|
|
@@ -119699,14 +119880,13 @@ class AgGridController {
|
|
|
119699
119880
|
this.STATUS_COL_ID = 'statusColumn';
|
|
119700
119881
|
this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
|
|
119701
119882
|
this.BLOCK_LOAD_DEBOUNCE = 100;
|
|
119702
|
-
this.
|
|
119703
|
-
this.DEFAULT_ICON_SIZE = 12;
|
|
119704
|
-
this.DEFAULT_MAX_SIZE = 200;
|
|
119883
|
+
this.DOC_WIDTH = 1150;
|
|
119705
119884
|
this._menuItems = [];
|
|
119706
119885
|
this._idAttribName = '__record__id__';
|
|
119707
119886
|
this._gridConfig = [];
|
|
119708
119887
|
this._filteredColumns = new Map();
|
|
119709
119888
|
this._filterColumnleftPosition = 0;
|
|
119889
|
+
this._customFormatters = new Map();
|
|
119710
119890
|
this._enterprise = enterprise;
|
|
119711
119891
|
}
|
|
119712
119892
|
getGridConfig() {
|
|
@@ -119792,7 +119972,7 @@ class AgGridController {
|
|
|
119792
119972
|
this._doubleClickCallBack = options.onDoubleClick;
|
|
119793
119973
|
this._multipleSelection = options.allowMultipleSelection;
|
|
119794
119974
|
this._dataUnit = options.dataUnit;
|
|
119795
|
-
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled);
|
|
119975
|
+
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders);
|
|
119796
119976
|
this._statusResolver = options.statusResolver;
|
|
119797
119977
|
if (this._dataUnit) {
|
|
119798
119978
|
this._dataUnit.sortingProvider = this;
|
|
@@ -119854,6 +120034,7 @@ class AgGridController {
|
|
|
119854
120034
|
this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
|
|
119855
120035
|
}
|
|
119856
120036
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
120037
|
+
this._customFormatters = options.customFormatters;
|
|
119857
120038
|
}
|
|
119858
120039
|
}
|
|
119859
120040
|
processFormatterCellCallback(params) {
|
|
@@ -120152,6 +120333,10 @@ class AgGridController {
|
|
|
120152
120333
|
this.focusOnGridContainer();
|
|
120153
120334
|
}
|
|
120154
120335
|
}
|
|
120336
|
+
setAutoFocus(autoFocus) {
|
|
120337
|
+
var _a;
|
|
120338
|
+
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.setAutoFocus(autoFocus);
|
|
120339
|
+
}
|
|
120155
120340
|
setFocusFirstRow() {
|
|
120156
120341
|
const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
|
|
120157
120342
|
if (firstRow) {
|
|
@@ -120237,9 +120422,11 @@ class AgGridController {
|
|
|
120237
120422
|
//Existem colunas implícitas que não tem estado, essas colunas são sempre as primeiras.
|
|
120238
120423
|
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
120239
120424
|
const columnsOffset = colDef.length - columns.length;
|
|
120425
|
+
this._gridConfig = state;
|
|
120240
120426
|
let sort = [];
|
|
120241
|
-
state.forEach((cfgColumn, index) => {
|
|
120242
|
-
|
|
120427
|
+
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
120428
|
+
var _a;
|
|
120429
|
+
const colWidth = (_a = this._gridOptions.columnApi.getColumn(cfgColumn.name)) === null || _a === void 0 ? void 0 : _a.getActualWidth();
|
|
120243
120430
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
120244
120431
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
120245
120432
|
visibleColumns.push(cfgColumn.name);
|
|
@@ -120254,7 +120441,11 @@ class AgGridController {
|
|
|
120254
120441
|
state: sort,
|
|
120255
120442
|
defaultState: { sort: null },
|
|
120256
120443
|
});
|
|
120257
|
-
|
|
120444
|
+
}
|
|
120445
|
+
getAdaptiveWidth(width) {
|
|
120446
|
+
const widthGrid = this._container.clientWidth;
|
|
120447
|
+
const adaptiveWidth = (this.DOC_WIDTH * width) / widthGrid;
|
|
120448
|
+
return Math.round(adaptiveWidth);
|
|
120258
120449
|
}
|
|
120259
120450
|
getColumnsState() {
|
|
120260
120451
|
if (this._grid === undefined) {
|
|
@@ -120263,13 +120454,15 @@ class AgGridController {
|
|
|
120263
120454
|
const colState = this._gridOptions.columnApi.getColumnState();
|
|
120264
120455
|
return colState
|
|
120265
120456
|
.map(s => {
|
|
120266
|
-
const
|
|
120457
|
+
const column = this._gridOptions.columnApi.getColumn(s.colId);
|
|
120458
|
+
const def = column.getColDef();
|
|
120459
|
+
const width = this.getAdaptiveWidth(column.getActualWidth());
|
|
120267
120460
|
const label = def.headerName;
|
|
120268
120461
|
const name = def.checkboxSelection ? '__SELECTION__' : s.colId;
|
|
120269
120462
|
const colState = { label, name };
|
|
120270
120463
|
this.conditionalSet(colState, 'sort', s.sort);
|
|
120271
120464
|
this.conditionalSet(colState, 'sortIndex', s.sortIndex);
|
|
120272
|
-
this.conditionalSet(colState, 'width',
|
|
120465
|
+
this.conditionalSet(colState, 'width', width);
|
|
120273
120466
|
this.conditionalSet(colState, 'pinned', s.pinned !== null);
|
|
120274
120467
|
this.conditionalSet(colState, 'hidden', s.hide);
|
|
120275
120468
|
const props = new Map();
|
|
@@ -120335,12 +120528,19 @@ class AgGridController {
|
|
|
120335
120528
|
showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
|
|
120336
120529
|
},
|
|
120337
120530
|
valueFormatter: params => {
|
|
120338
|
-
if (params.value === undefined) {
|
|
120531
|
+
if (params.value === undefined || params.value === null) {
|
|
120339
120532
|
return "";
|
|
120340
120533
|
}
|
|
120341
120534
|
if (params.value instanceof Promise) {
|
|
120342
120535
|
return "Carregando...";
|
|
120343
120536
|
}
|
|
120537
|
+
const customFormatter = this._customFormatters.get(source.name);
|
|
120538
|
+
if (customFormatter) {
|
|
120539
|
+
const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
|
|
120540
|
+
if (formattedValue) {
|
|
120541
|
+
return formattedValue;
|
|
120542
|
+
}
|
|
120543
|
+
}
|
|
120344
120544
|
if (this._dataUnit) {
|
|
120345
120545
|
return this._dataUnit.getFormattedValue(source.name, params.value);
|
|
120346
120546
|
}
|
|
@@ -120349,6 +120549,13 @@ class AgGridController {
|
|
|
120349
120549
|
cellStyle: this.getStyleByColumn(source),
|
|
120350
120550
|
});
|
|
120351
120551
|
}
|
|
120552
|
+
setCustomFormatters(customFormatters) {
|
|
120553
|
+
this._customFormatters = customFormatters;
|
|
120554
|
+
}
|
|
120555
|
+
refreshSelectedRows() {
|
|
120556
|
+
const selectedNodes = this._gridOptions.api.getSelectedNodes();
|
|
120557
|
+
this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
|
|
120558
|
+
}
|
|
120352
120559
|
getInitCellStyle() {
|
|
120353
120560
|
return {
|
|
120354
120561
|
'line-height': this.getRowHeight() - 1 + 'px',
|
|
@@ -120509,20 +120716,23 @@ class AgGridController {
|
|
|
120509
120716
|
host[attribute] = value;
|
|
120510
120717
|
}
|
|
120511
120718
|
}
|
|
120512
|
-
|
|
120513
|
-
var _a
|
|
120514
|
-
if (
|
|
120719
|
+
setCellEditors(customEditors) {
|
|
120720
|
+
var _a;
|
|
120721
|
+
if (!this._editionManager) {
|
|
120722
|
+
this._customEditors = customEditors;
|
|
120515
120723
|
return;
|
|
120516
120724
|
}
|
|
120517
|
-
|
|
120518
|
-
|
|
120519
|
-
|
|
120520
|
-
|
|
120521
|
-
|
|
120522
|
-
|
|
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;
|
|
120523
120733
|
}
|
|
120524
|
-
|
|
120525
|
-
|
|
120734
|
+
this._editionManager.setCellRenders(customRenders);
|
|
120735
|
+
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
120526
120736
|
}
|
|
120527
120737
|
}
|
|
120528
120738
|
|
|
@@ -120749,6 +120959,8 @@ const EzGrid = class {
|
|
|
120749
120959
|
this.componentReady = createEvent(this, "componentReady", 7);
|
|
120750
120960
|
this._gridController = new AgGridController(false);
|
|
120751
120961
|
this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
|
|
120962
|
+
this._customEditor = new Map();
|
|
120963
|
+
this._customRenders = new Map();
|
|
120752
120964
|
this._paginationInfo = undefined;
|
|
120753
120965
|
this._paginationChangedByKeyboard = true;
|
|
120754
120966
|
this._showSelectionCounter = false;
|
|
@@ -120756,6 +120968,7 @@ const EzGrid = class {
|
|
|
120756
120968
|
this._currentPageSelected = undefined;
|
|
120757
120969
|
this._selectionCount = undefined;
|
|
120758
120970
|
this._hasLeftButtons = false;
|
|
120971
|
+
this._customFormatters = new Map();
|
|
120759
120972
|
this.multipleSelection = undefined;
|
|
120760
120973
|
this.config = undefined;
|
|
120761
120974
|
this.selectionToastConfig = undefined;
|
|
@@ -120766,6 +120979,7 @@ const EzGrid = class {
|
|
|
120766
120979
|
this.useEnterLikeTab = false;
|
|
120767
120980
|
this.recordsValidator = undefined;
|
|
120768
120981
|
this.canEdit = true;
|
|
120982
|
+
this.autoFocus = true;
|
|
120769
120983
|
}
|
|
120770
120984
|
/**
|
|
120771
120985
|
* Aplica a definição de colunas.
|
|
@@ -120827,6 +121041,63 @@ const EzGrid = class {
|
|
|
120827
121041
|
async filterColumns(search) {
|
|
120828
121042
|
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
120829
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
|
+
}
|
|
120830
121101
|
/**
|
|
120831
121102
|
* Atribui o foco para a grade.
|
|
120832
121103
|
*/
|
|
@@ -120986,7 +121257,9 @@ const EzGrid = class {
|
|
|
120986
121257
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
120987
121258
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
120988
121259
|
const dtInfo = { id: 'ezGrid' };
|
|
120989
|
-
|
|
121260
|
+
if (this._refPaginationControl) {
|
|
121261
|
+
ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
|
|
121262
|
+
}
|
|
120990
121263
|
}
|
|
120991
121264
|
previousPage() {
|
|
120992
121265
|
if (this.dataUnit) {
|
|
@@ -121006,14 +121279,10 @@ const EzGrid = class {
|
|
|
121006
121279
|
(_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
|
|
121007
121280
|
}
|
|
121008
121281
|
getPaginationControl() {
|
|
121009
|
-
if (this._paginationInfo)
|
|
121010
|
-
|
|
121011
|
-
|
|
121012
|
-
|
|
121013
|
-
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" })),
|
|
121014
|
-
];
|
|
121015
|
-
}
|
|
121016
|
-
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" }))));
|
|
121017
121286
|
}
|
|
121018
121287
|
componentDidLoad() {
|
|
121019
121288
|
this._gridController.initDatagrid(this._container, {
|
|
@@ -121035,6 +121304,8 @@ const EzGrid = class {
|
|
|
121035
121304
|
useEnterLikeTab: this.useEnterLikeTab,
|
|
121036
121305
|
recordsValidator: this.recordsValidator,
|
|
121037
121306
|
editionIsDisabled: () => !this.canEdit,
|
|
121307
|
+
customFormatters: this._customFormatters,
|
|
121308
|
+
autoFocus: this.autoFocus,
|
|
121038
121309
|
onRefresh: () => {
|
|
121039
121310
|
if (this.dataUnit) {
|
|
121040
121311
|
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
@@ -121055,7 +121326,7 @@ const EzGrid = class {
|
|
|
121055
121326
|
}
|
|
121056
121327
|
handlePaginationChange(selectFirstRecord, paginationInfo) {
|
|
121057
121328
|
var _a;
|
|
121058
|
-
if (selectFirstRecord !== false) {
|
|
121329
|
+
if (selectFirstRecord !== false && this.autoFocus) {
|
|
121059
121330
|
if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
|
|
121060
121331
|
this._gridController.setFocusLastRow();
|
|
121061
121332
|
}
|
|
@@ -121125,6 +121396,9 @@ const EzGrid = class {
|
|
|
121125
121396
|
if (!this.dataUnit.name.includes("InMemoryDataUnit"))
|
|
121126
121397
|
return;
|
|
121127
121398
|
}
|
|
121399
|
+
componentDidUpdate() {
|
|
121400
|
+
this._gridController.setAutoFocus(this.autoFocus);
|
|
121401
|
+
}
|
|
121128
121402
|
getDataSource() {
|
|
121129
121403
|
var _a;
|
|
121130
121404
|
return (_a = this.columnfilterDataSource) !== null && _a !== void 0 ? _a : new InMemoryFilterColumnDataSource(this.dataUnit);
|
|
@@ -121134,7 +121408,7 @@ const EzGrid = class {
|
|
|
121134
121408
|
}
|
|
121135
121409
|
render() {
|
|
121136
121410
|
var _a;
|
|
121137
|
-
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
|
|
121138
121412
|
${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
|
|
121139
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" }))));
|
|
121140
121414
|
}
|
|
@@ -9,6 +9,7 @@ const EzList = class {
|
|
|
9
9
|
this.ezChange = createEvent(this, "ezChange", 7);
|
|
10
10
|
this.ezSelectItem = createEvent(this, "ezSelectItem", 7);
|
|
11
11
|
this.ezCheckChange = createEvent(this, "ezCheckChange", 7);
|
|
12
|
+
this.ezDoubleClick = createEvent(this, "ezDoubleClick", 7);
|
|
12
13
|
this._listItemsHistory = [];
|
|
13
14
|
this._listItems = [];
|
|
14
15
|
this._listGroupItems = [];
|
|
@@ -521,6 +522,9 @@ const EzList = class {
|
|
|
521
522
|
}
|
|
522
523
|
return h("div", { class: className, innerHTML: customContent });
|
|
523
524
|
}
|
|
525
|
+
doubleClickItem(item) {
|
|
526
|
+
this.ezDoubleClick.emit(item);
|
|
527
|
+
}
|
|
524
528
|
render() {
|
|
525
529
|
return (h(Host, { ref: el => (this._element = el) }, this.useGroups ? (h("div", { class: "group-container", ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => {
|
|
526
530
|
this.keyDownHandler(event);
|
|
@@ -530,7 +534,9 @@ const EzList = class {
|
|
|
530
534
|
'hover-feedback': this.hoverFeedback,
|
|
531
535
|
}, key: 'item_' + item.id }, {
|
|
532
536
|
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`),
|
|
533
|
-
}), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''),
|
|
537
|
+
}), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDblClick: () => {
|
|
538
|
+
this.doubleClickItem(item);
|
|
539
|
+
}, onClick: () => {
|
|
534
540
|
this.setSelection(item);
|
|
535
541
|
}, onDragLeave: () => {
|
|
536
542
|
group.sort ? undefined : this.removeOverClass();
|
|
@@ -544,7 +550,9 @@ const EzList = class {
|
|
|
544
550
|
} }, h("div", { class: "draggable-list" }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
|
|
545
551
|
'selectable-container': this.ezSelectable,
|
|
546
552
|
'hover-feedback': this.hoverFeedback,
|
|
547
|
-
}, key: 'item_' + item.id }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`) }), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDragStart: () => this.onDragStart({ item: item, index: index }),
|
|
553
|
+
}, key: 'item_' + item.id }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`) }), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDragStart: () => this.onDragStart({ item: item, index: index }), onDblClick: () => {
|
|
554
|
+
this.doubleClickItem(item);
|
|
555
|
+
}, onClick: () => {
|
|
548
556
|
this.setSelection(item);
|
|
549
557
|
}, onDragLeave: () => this.removeOverClass(), onDragOver: event => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDrop(event, { item: item, index: index }), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.listMode === 'regular' ? (h(Fragment, null, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item), h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label))) : (h(Fragment, null, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, 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))))), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
|
|
550
558
|
this.onDragOverLastIndex(event);
|