@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-72892.1 → 0.0.0-bugfix-dev-KB-72911.0
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/ez-combo-box.cjs.entry.js +19 -2
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +3 -1
- package/dist/cjs/ez-date-input.cjs.entry.js +3 -0
- package/dist/cjs/ez-grid.cjs.entry.js +125 -60
- package/dist/cjs/ez-search.cjs.entry.js +20 -0
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +37 -2
- package/dist/collection/components/ez-date-input/ez-date-input.js +3 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +3 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +64 -34
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +24 -8
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +32 -24
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +8 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +1 -0
- package/dist/collection/components/ez-grid/ez-grid.js +2 -1
- package/dist/collection/components/ez-search/ez-search.js +38 -0
- package/dist/custom-elements/index.js +172 -65
- package/dist/esm/ez-combo-box.entry.js +19 -2
- package/dist/esm/ez-custom-form-input_2.entry.js +3 -1
- package/dist/esm/ez-date-input.entry.js +3 -0
- package/dist/esm/ez-grid.entry.js +125 -60
- package/dist/esm/ez-search.entry.js +20 -0
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-4b819b58.entry.js +1 -0
- package/dist/ezui/p-583e6dab.entry.js +1 -0
- package/dist/ezui/p-67e87fcf.entry.js +1 -0
- package/dist/ezui/{p-75669111.entry.js → p-c3c3d640.entry.js} +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +5 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +15 -3
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +9 -2
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +11 -8
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -0
- package/dist/types/components/ez-search/ez-search.d.ts +7 -0
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/dist/ezui/p-4c799a1b.entry.js +0 -1
- package/dist/ezui/p-7922142b.entry.js +0 -1
- package/dist/ezui/p-bae4e180.entry.js +0 -1
|
@@ -27,6 +27,7 @@ export class EzSearch {
|
|
|
27
27
|
this.showSelectedValue = true;
|
|
28
28
|
this.showOptionValue = true;
|
|
29
29
|
this.suppressEmptyOption = false;
|
|
30
|
+
this.stopPropagateEnterKeyEvent = false;
|
|
30
31
|
this.mode = "regular";
|
|
31
32
|
this.canShowError = true;
|
|
32
33
|
this.hideErrorOnFocusOut = true;
|
|
@@ -201,6 +202,9 @@ export class EzSearch {
|
|
|
201
202
|
getText() {
|
|
202
203
|
const currentValue = this.getSelectedOption(this._currentValue);
|
|
203
204
|
const text = this.getFormattedText(currentValue);
|
|
205
|
+
return this.replaceQuotes(text);
|
|
206
|
+
}
|
|
207
|
+
replaceQuotes(text) {
|
|
204
208
|
if (text == undefined) {
|
|
205
209
|
return;
|
|
206
210
|
}
|
|
@@ -489,6 +493,15 @@ export class EzSearch {
|
|
|
489
493
|
}
|
|
490
494
|
this._currentValue = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
491
495
|
this.value = this._currentValue;
|
|
496
|
+
this.setTextInputValue();
|
|
497
|
+
}
|
|
498
|
+
setTextInputValue() {
|
|
499
|
+
if (this._textInput && (this._textInput.value === null || this._textInput.value === undefined)) {
|
|
500
|
+
if (this.value === undefined || this.value === null)
|
|
501
|
+
return;
|
|
502
|
+
const textValue = (typeof this.value === 'string') ? this.value : this.getFormattedText(this.value);
|
|
503
|
+
this._textInput.value = this.replaceQuotes(textValue);
|
|
504
|
+
}
|
|
492
505
|
}
|
|
493
506
|
loadOptionValue(argument) {
|
|
494
507
|
var _a;
|
|
@@ -637,6 +650,7 @@ export class EzSearch {
|
|
|
637
650
|
event.stopPropagation();
|
|
638
651
|
break;
|
|
639
652
|
case "Enter":
|
|
653
|
+
this.handleEventPropagation(event);
|
|
640
654
|
this.selectCurrentOption();
|
|
641
655
|
break;
|
|
642
656
|
case "Escape":
|
|
@@ -653,6 +667,12 @@ export class EzSearch {
|
|
|
653
667
|
//e o contexto pode reagir (fechar um popup por exemplo).
|
|
654
668
|
//event.stopPropagation();
|
|
655
669
|
}
|
|
670
|
+
//O evento deve ter sua propagação interrompida, apenas se a lista de opções estiver sendo exibida.
|
|
671
|
+
handleEventPropagation(event) {
|
|
672
|
+
if (this._listContainer.hasChildNodes() && this.stopPropagateEnterKeyEvent) {
|
|
673
|
+
event.stopPropagation();
|
|
674
|
+
}
|
|
675
|
+
}
|
|
656
676
|
onTextInputFocusOutHandler() {
|
|
657
677
|
if (this.hideErrorOnFocusOut)
|
|
658
678
|
this.cancelPreselection();
|
|
@@ -839,6 +859,24 @@ export class EzSearch {
|
|
|
839
859
|
"reflect": false,
|
|
840
860
|
"defaultValue": "false"
|
|
841
861
|
},
|
|
862
|
+
"stopPropagateEnterKeyEvent": {
|
|
863
|
+
"type": "boolean",
|
|
864
|
+
"mutable": false,
|
|
865
|
+
"complexType": {
|
|
866
|
+
"original": "boolean",
|
|
867
|
+
"resolved": "boolean",
|
|
868
|
+
"references": {}
|
|
869
|
+
},
|
|
870
|
+
"required": false,
|
|
871
|
+
"optional": false,
|
|
872
|
+
"docs": {
|
|
873
|
+
"tags": [],
|
|
874
|
+
"text": "Se true, ineterrompe a propaga\u00E7\u00E3o do evento de KeyDown da tecla enter"
|
|
875
|
+
},
|
|
876
|
+
"attribute": "stop-propagate-enter-key-event",
|
|
877
|
+
"reflect": false,
|
|
878
|
+
"defaultValue": "false"
|
|
879
|
+
},
|
|
842
880
|
"mode": {
|
|
843
881
|
"type": "string",
|
|
844
882
|
"mutable": false,
|
|
@@ -2903,6 +2903,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2903
2903
|
this.suppressSearch = false;
|
|
2904
2904
|
this.optionLoader = undefined;
|
|
2905
2905
|
this.suppressEmptyOption = false;
|
|
2906
|
+
this.stopPropagateEnterKeyEvent = false;
|
|
2906
2907
|
this.canShowError = true;
|
|
2907
2908
|
this.mode = "regular";
|
|
2908
2909
|
this.hideErrorOnFocusOut = true;
|
|
@@ -3240,7 +3241,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
3240
3241
|
this.setInputValue(false);
|
|
3241
3242
|
}, this._deboucingTime);
|
|
3242
3243
|
}
|
|
3243
|
-
this.resetOptions();
|
|
3244
3244
|
}
|
|
3245
3245
|
setInputValue(clearError = true) {
|
|
3246
3246
|
const textValue = this.getText();
|
|
@@ -3329,7 +3329,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
3329
3329
|
this.showOptions();
|
|
3330
3330
|
}
|
|
3331
3331
|
else {
|
|
3332
|
-
this.
|
|
3332
|
+
this._preSelection = undefined;
|
|
3333
3333
|
this.updateVisibleOptions();
|
|
3334
3334
|
}
|
|
3335
3335
|
}
|
|
@@ -3357,21 +3357,32 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
3357
3357
|
}
|
|
3358
3358
|
switch (event.key) {
|
|
3359
3359
|
case "ArrowDown":
|
|
3360
|
+
this.showOptions();
|
|
3360
3361
|
this.nextOption();
|
|
3361
3362
|
event.stopPropagation();
|
|
3362
3363
|
break;
|
|
3363
3364
|
case "ArrowUp":
|
|
3365
|
+
this.showOptions();
|
|
3364
3366
|
this.previousOption();
|
|
3365
3367
|
event.stopPropagation();
|
|
3366
3368
|
break;
|
|
3367
3369
|
case "Enter":
|
|
3370
|
+
this.handleEventPropagation(event);
|
|
3368
3371
|
this.selectCurrentOption();
|
|
3369
3372
|
break;
|
|
3370
3373
|
case "Escape":
|
|
3374
|
+
if (this.isOptionsVisible()) {
|
|
3375
|
+
event.stopPropagation();
|
|
3376
|
+
}
|
|
3371
3377
|
this.cancelPreselection();
|
|
3378
|
+
this.resetOptions();
|
|
3372
3379
|
break;
|
|
3373
3380
|
case "Tab":
|
|
3374
3381
|
this._tabPressed = true;
|
|
3382
|
+
if (this.isOptionsVisible()) {
|
|
3383
|
+
this.selectCurrentOption();
|
|
3384
|
+
}
|
|
3385
|
+
this.resetOptions();
|
|
3375
3386
|
break;
|
|
3376
3387
|
}
|
|
3377
3388
|
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
@@ -3380,6 +3391,12 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
3380
3391
|
//e o contexto pode reagir (fechar um popup por exemplo).
|
|
3381
3392
|
//event.stopPropagation();
|
|
3382
3393
|
}
|
|
3394
|
+
//O evento deve ter sua propagação interrompida, apenas se a lista de opções estiver sendo exibida.
|
|
3395
|
+
handleEventPropagation(event) {
|
|
3396
|
+
if (this._listContainer.hasChildNodes() && this.stopPropagateEnterKeyEvent) {
|
|
3397
|
+
event.stopPropagation();
|
|
3398
|
+
}
|
|
3399
|
+
}
|
|
3383
3400
|
onTextInputFocusOutHandler() {
|
|
3384
3401
|
if (this.hideErrorOnFocusOut)
|
|
3385
3402
|
this.cancelPreselection();
|
|
@@ -3461,7 +3478,9 @@ const EzCustomFormInput$1 = class extends HTMLElement$1 {
|
|
|
3461
3478
|
this.getContent();
|
|
3462
3479
|
}
|
|
3463
3480
|
watchSelectedRecord(newValue, oldValue) {
|
|
3464
|
-
|
|
3481
|
+
const newRecordId = newValue === null || newValue === void 0 ? void 0 : newValue['__record__id__'];
|
|
3482
|
+
const oldRecordId = oldValue === null || oldValue === void 0 ? void 0 : oldValue['__record__id__'];
|
|
3483
|
+
if (newRecordId !== oldRecordId) {
|
|
3465
3484
|
this.getContent();
|
|
3466
3485
|
}
|
|
3467
3486
|
}
|
|
@@ -3624,6 +3643,9 @@ const EzDateInput$1 = class extends HTMLElement$1 {
|
|
|
3624
3643
|
if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.getTime()) !== (newValueValidated === null || newValueValidated === void 0 ? void 0 : newValueValidated.getTime())) {
|
|
3625
3644
|
this.value = newValueValidated;
|
|
3626
3645
|
}
|
|
3646
|
+
else {
|
|
3647
|
+
this._changePending = false;
|
|
3648
|
+
}
|
|
3627
3649
|
}
|
|
3628
3650
|
showCalendar() {
|
|
3629
3651
|
this.handleBlur();
|
|
@@ -124477,6 +124499,17 @@ class DataSourceInterceptor {
|
|
|
124477
124499
|
}
|
|
124478
124500
|
|
|
124479
124501
|
class DataSource {
|
|
124502
|
+
handleDataSaved(action) {
|
|
124503
|
+
this._controller.clearInvalidCells();
|
|
124504
|
+
this.handleRefreshOrReload(action);
|
|
124505
|
+
this._controller.processContinuousInsert();
|
|
124506
|
+
}
|
|
124507
|
+
handleEditionCanceled(action) {
|
|
124508
|
+
if (this._options.enableGridInsert) {
|
|
124509
|
+
this._controller.processEditionCanceled();
|
|
124510
|
+
}
|
|
124511
|
+
this.handleRefreshOrReload(action);
|
|
124512
|
+
}
|
|
124480
124513
|
handleSavingCanceled(action) {
|
|
124481
124514
|
var _a, _b, _c, _d;
|
|
124482
124515
|
if (!((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fields) || !((_b = action.payload) === null || _b === void 0 ? void 0 : _b.recordId))
|
|
@@ -124484,12 +124517,17 @@ class DataSource {
|
|
|
124484
124517
|
this._controller.savingCanceled((_c = action.payload) === null || _c === void 0 ? void 0 : _c.fields, (_d = action.payload) === null || _d === void 0 ? void 0 : _d.recordId);
|
|
124485
124518
|
}
|
|
124486
124519
|
handleDataChanged(action) {
|
|
124487
|
-
var _a, _b;
|
|
124488
124520
|
if (!this._options.enableGridInsert) {
|
|
124489
124521
|
this.handleRefresh(action);
|
|
124490
124522
|
return;
|
|
124491
124523
|
}
|
|
124492
|
-
this.updateGridRowNodes((
|
|
124524
|
+
this.updateGridRowNodes(this.createRecordIdList(action));
|
|
124525
|
+
}
|
|
124526
|
+
createRecordIdList(action) {
|
|
124527
|
+
var _a, _b;
|
|
124528
|
+
if ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.records)
|
|
124529
|
+
return (_b = action.payload) === null || _b === void 0 ? void 0 : _b.records;
|
|
124530
|
+
return this._dataUnit.getSelectedRecord() ? [this._dataUnit.getSelectedRecord().__record__id__] : [];
|
|
124493
124531
|
}
|
|
124494
124532
|
/**
|
|
124495
124533
|
* Nesse ponto, o registro já se encontra atualizado no DU,
|
|
@@ -124539,10 +124577,8 @@ class DataSource {
|
|
|
124539
124577
|
* e callbacks implementados no AgGridController e GridEditionManager.
|
|
124540
124578
|
*/
|
|
124541
124579
|
setTimeout(() => {
|
|
124542
|
-
|
|
124543
|
-
|
|
124544
|
-
this._controller.startEditionOnRowByIndex(newRowIndex);
|
|
124545
|
-
}, 500);
|
|
124580
|
+
this._controller.startEditionOnLastRow();
|
|
124581
|
+
}, 1000);
|
|
124546
124582
|
}
|
|
124547
124583
|
updateLoadedRecords(action) {
|
|
124548
124584
|
const records = action.payload;
|
|
@@ -124596,12 +124632,14 @@ class DataSource {
|
|
|
124596
124632
|
}
|
|
124597
124633
|
break;
|
|
124598
124634
|
case Action.RECORDS_ADDED:
|
|
124635
|
+
case Action.RECORDS_COPIED:
|
|
124599
124636
|
this.handleRecordsAdded();
|
|
124600
124637
|
break;
|
|
124601
124638
|
case Action.DATA_SAVED:
|
|
124639
|
+
this.handleDataSaved(action);
|
|
124640
|
+
break;
|
|
124602
124641
|
case Action.EDITION_CANCELED:
|
|
124603
|
-
this.
|
|
124604
|
-
this.handleRefreshOrReload(action);
|
|
124642
|
+
this.handleEditionCanceled(action);
|
|
124605
124643
|
break;
|
|
124606
124644
|
case Action.DATA_CHANGED:
|
|
124607
124645
|
case Action.DATA_RESOLVED:
|
|
@@ -125078,6 +125116,7 @@ const buildComboBox = ({ required, props, eGridCell }) => {
|
|
|
125078
125116
|
mode="slim"
|
|
125079
125117
|
/>`);
|
|
125080
125118
|
combo.options = options;
|
|
125119
|
+
combo.stopPropagateEnterKeyEvent = true;
|
|
125081
125120
|
combo.listOptionsPosition = { verticalPosition: 29, bottomLimit: getViewPortHeight(eGridCell), hardPosition: true };
|
|
125082
125121
|
return combo;
|
|
125083
125122
|
};
|
|
@@ -125110,6 +125149,7 @@ const buildSearch = ({ name, required, readOnly, eGridCell, dataUnit }) => {
|
|
|
125110
125149
|
ezSearch.ensureClearButtonVisible = true;
|
|
125111
125150
|
ezSearch.suppressPreLoad = true;
|
|
125112
125151
|
ezSearch.listOptionsPosition = { verticalPosition: 29, bottomLimit: getViewPortHeight(eGridCell), hardPosition: true };
|
|
125152
|
+
ezSearch.stopPropagateEnterKeyEvent = true;
|
|
125113
125153
|
ezSearch.valueGetter = () => ezSearch.getValueAsync();
|
|
125114
125154
|
return ezSearch;
|
|
125115
125155
|
};
|
|
@@ -125153,6 +125193,14 @@ class EzCellEditor {
|
|
|
125153
125193
|
getValue() {
|
|
125154
125194
|
return this._gui.valueGetter != undefined ? this._gui.valueGetter() : this._gui.value;
|
|
125155
125195
|
}
|
|
125196
|
+
setGuiValue(value) {
|
|
125197
|
+
if (this._gui.valueSetter != undefined) {
|
|
125198
|
+
this._gui.valueSetter(value);
|
|
125199
|
+
}
|
|
125200
|
+
else {
|
|
125201
|
+
this._gui.value = value;
|
|
125202
|
+
}
|
|
125203
|
+
}
|
|
125156
125204
|
isPopup() {
|
|
125157
125205
|
return this._gui.isPopUp;
|
|
125158
125206
|
}
|
|
@@ -125308,7 +125356,7 @@ class EzGridCustomCellRender extends EzCellRender {
|
|
|
125308
125356
|
}
|
|
125309
125357
|
|
|
125310
125358
|
class GridEditionManager {
|
|
125311
|
-
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders, enableContinuousInsert) {
|
|
125359
|
+
constructor(dataUnit, useEnterLikeTab, recordsValidator, editionIsDisabled, customEditors, customRenders, enableContinuousInsert, enableGridInsert) {
|
|
125312
125360
|
this._dataUnit = dataUnit;
|
|
125313
125361
|
this._recordValidationProcessor = new RecordValidationProcessor(this._dataUnit, {
|
|
125314
125362
|
getRequiredFields: () => this.getRequiredFields(),
|
|
@@ -125318,6 +125366,7 @@ class GridEditionManager {
|
|
|
125318
125366
|
this._useEnterLikeTab = useEnterLikeTab;
|
|
125319
125367
|
this._editionIsDisabled = editionIsDisabled;
|
|
125320
125368
|
this._enableContinuousInsert = enableContinuousInsert;
|
|
125369
|
+
this._enableGridInsert = enableGridInsert;
|
|
125321
125370
|
this._customEditors = customEditors;
|
|
125322
125371
|
this._customRenders = customRenders;
|
|
125323
125372
|
}
|
|
@@ -125332,6 +125381,16 @@ class GridEditionManager {
|
|
|
125332
125381
|
};
|
|
125333
125382
|
return options;
|
|
125334
125383
|
}
|
|
125384
|
+
updateCurrentEditorGuiValue(updatedRowValue) {
|
|
125385
|
+
const editorInstances = this._gridOptions.api.getCellEditorInstances();
|
|
125386
|
+
if (!editorInstances || !editorInstances.length)
|
|
125387
|
+
return;
|
|
125388
|
+
const currentEditor = editorInstances[0];
|
|
125389
|
+
const fieldMetadata = currentEditor.getFieldMetadata();
|
|
125390
|
+
const fieldName = fieldMetadata.name;
|
|
125391
|
+
const value = updatedRowValue[fieldName];
|
|
125392
|
+
currentEditor.setGuiValue(value);
|
|
125393
|
+
}
|
|
125335
125394
|
canContinuousInsert() {
|
|
125336
125395
|
var _a;
|
|
125337
125396
|
return this._enableContinuousInsert && (this._dataUnit.records.length - 1) === ((_a = this._lastCellEdited) === null || _a === void 0 ? void 0 : _a.rowIndex);
|
|
@@ -125341,7 +125400,7 @@ class GridEditionManager {
|
|
|
125341
125400
|
this.saveSuccess();
|
|
125342
125401
|
return;
|
|
125343
125402
|
}
|
|
125344
|
-
if (!this._isGridEdition
|
|
125403
|
+
if (!this._isGridEdition) {
|
|
125345
125404
|
return;
|
|
125346
125405
|
}
|
|
125347
125406
|
const currentRercord = this._dataUnit.getSelectedRecord();
|
|
@@ -125353,14 +125412,7 @@ class GridEditionManager {
|
|
|
125353
125412
|
.validate(true)
|
|
125354
125413
|
.then(() => {
|
|
125355
125414
|
this._dataUnit.saveData()
|
|
125356
|
-
.then(() =>
|
|
125357
|
-
if (this.canContinuousInsert()) {
|
|
125358
|
-
this._dataUnit.addRecord();
|
|
125359
|
-
}
|
|
125360
|
-
else {
|
|
125361
|
-
this.saveSuccess();
|
|
125362
|
-
}
|
|
125363
|
-
})
|
|
125415
|
+
.then(() => this.saveSuccess())
|
|
125364
125416
|
.catch(reason => this.saveFail(reason));
|
|
125365
125417
|
})
|
|
125366
125418
|
.catch(reason => this.saveFail(reason));
|
|
@@ -125458,11 +125510,12 @@ class GridEditionManager {
|
|
|
125458
125510
|
}
|
|
125459
125511
|
}
|
|
125460
125512
|
focusOnCell(cell) {
|
|
125513
|
+
var _a;
|
|
125461
125514
|
if (cell == undefined) {
|
|
125462
125515
|
return;
|
|
125463
125516
|
}
|
|
125464
125517
|
const { rowIndex, column } = cell;
|
|
125465
|
-
this._gridOptions.api.getDisplayedRowAtIndex(rowIndex).setSelected(true, true);
|
|
125518
|
+
(_a = this._gridOptions.api.getDisplayedRowAtIndex(rowIndex)) === null || _a === void 0 ? void 0 : _a.setSelected(true, true);
|
|
125466
125519
|
this._gridOptions.api.clearRangeSelection();
|
|
125467
125520
|
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [column] });
|
|
125468
125521
|
this._gridOptions.api.startEditingCell({ colKey: column.getColId(), rowIndex });
|
|
@@ -125502,9 +125555,10 @@ class GridEditionManager {
|
|
|
125502
125555
|
}
|
|
125503
125556
|
}
|
|
125504
125557
|
else {
|
|
125558
|
+
const actualRowIndex = rowIndex;
|
|
125505
125559
|
rowIndex = rowIndex + 1;
|
|
125506
125560
|
if (rowIndex >= this._dataUnit.records.length) {
|
|
125507
|
-
rowIndex = 0;
|
|
125561
|
+
rowIndex = !this._enableGridInsert ? 0 : actualRowIndex;
|
|
125508
125562
|
}
|
|
125509
125563
|
}
|
|
125510
125564
|
this._targetEditionCell = new TargetEdition(rowIndex, column, true);
|
|
@@ -125573,7 +125627,7 @@ class GridEditionManager {
|
|
|
125573
125627
|
event.node.setData(Object.assign(Object.assign({}, event.data), { [fieldName]: value }));
|
|
125574
125628
|
}
|
|
125575
125629
|
this._isGridEdition = true;
|
|
125576
|
-
this._dataUnit.setFieldValue(fieldName, value, [event.data.__record__id__]);
|
|
125630
|
+
this._dataUnit.setFieldValue(fieldName, value, [event.data.__record__id__], { suppressCreateNewRecord: true });
|
|
125577
125631
|
this._lastCellEdited = { rowIndex: event.rowIndex, column: event.column, rowPinned: undefined };
|
|
125578
125632
|
}
|
|
125579
125633
|
}
|
|
@@ -125589,14 +125643,16 @@ class GridEditionManager {
|
|
|
125589
125643
|
getInvalidCell() {
|
|
125590
125644
|
return this._invalidCell;
|
|
125591
125645
|
}
|
|
125592
|
-
|
|
125646
|
+
processContinuousInsert() {
|
|
125647
|
+
if (!this.canContinuousInsert())
|
|
125648
|
+
return;
|
|
125649
|
+
this._dataUnit.addRecord();
|
|
125650
|
+
}
|
|
125651
|
+
clearInvalidCells(stopEdition) {
|
|
125593
125652
|
this._invalidCell = undefined;
|
|
125594
|
-
if (
|
|
125653
|
+
if (stopEdition) {
|
|
125595
125654
|
this._isGridEdition = false;
|
|
125596
125655
|
}
|
|
125597
|
-
else if (action === Action.DATA_SAVED && this.canContinuousInsert()) {
|
|
125598
|
-
this._dataUnit.addRecord();
|
|
125599
|
-
}
|
|
125600
125656
|
}
|
|
125601
125657
|
setEnableContinuousInsert(enable) {
|
|
125602
125658
|
this._enableContinuousInsert = enable;
|
|
@@ -125741,7 +125797,7 @@ class AgGridController {
|
|
|
125741
125797
|
this._doubleClickCallBack = options.onDoubleClick;
|
|
125742
125798
|
this._multipleSelection = options.allowMultipleSelection;
|
|
125743
125799
|
this._dataUnit = options.dataUnit;
|
|
125744
|
-
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders, options.enableContinuousInsert);
|
|
125800
|
+
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders, options.enableContinuousInsert, options.enableGridInsert);
|
|
125745
125801
|
this._statusResolver = options.statusResolver;
|
|
125746
125802
|
if (this._dataUnit) {
|
|
125747
125803
|
this._dataUnit.sortingProvider = this;
|
|
@@ -126019,6 +126075,7 @@ class AgGridController {
|
|
|
126019
126075
|
updateRowData(row) {
|
|
126020
126076
|
const node = this._gridOptions.api.getRowNode(row[this._idAttribName]);
|
|
126021
126077
|
node.setData(Object.assign({}, row));
|
|
126078
|
+
this._editionManager.updateCurrentEditorGuiValue(row);
|
|
126022
126079
|
this._editionManager.recordValidate();
|
|
126023
126080
|
}
|
|
126024
126081
|
selectAll(quietly = false) {
|
|
@@ -126180,10 +126237,20 @@ class AgGridController {
|
|
|
126180
126237
|
}
|
|
126181
126238
|
}
|
|
126182
126239
|
startEditionOnRowByIndex(rowIndex) {
|
|
126240
|
+
this._dataUnit.setSelectionByIndex([rowIndex]);
|
|
126183
126241
|
const firstCol = this.getFirstEditableColl(rowIndex);
|
|
126242
|
+
if (!firstCol)
|
|
126243
|
+
return;
|
|
126184
126244
|
this.focusByCollAndRow(firstCol, rowIndex);
|
|
126185
126245
|
this.startEdition(rowIndex, firstCol);
|
|
126186
126246
|
}
|
|
126247
|
+
startEditionOnLastRow() {
|
|
126248
|
+
var _a;
|
|
126249
|
+
if (this._gridShowDom) {
|
|
126250
|
+
const newRowIndex = ((_a = this._dataUnit.records) === null || _a === void 0 ? void 0 : _a.length) - 1;
|
|
126251
|
+
this.startEditionOnRowByIndex(newRowIndex);
|
|
126252
|
+
}
|
|
126253
|
+
}
|
|
126187
126254
|
startEdition(rowIndex, firstCol) {
|
|
126188
126255
|
this._gridOptions.api.clearRangeSelection();
|
|
126189
126256
|
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstCol] });
|
|
@@ -126195,8 +126262,13 @@ class AgGridController {
|
|
|
126195
126262
|
}
|
|
126196
126263
|
}
|
|
126197
126264
|
getFirstEditableColl(rowIndex) {
|
|
126198
|
-
|
|
126199
|
-
|
|
126265
|
+
try {
|
|
126266
|
+
const displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
|
|
126267
|
+
return displayedColumns.find(column => this.isColumnEditable(rowIndex, column));
|
|
126268
|
+
}
|
|
126269
|
+
catch (e) {
|
|
126270
|
+
console.warn(e);
|
|
126271
|
+
}
|
|
126200
126272
|
}
|
|
126201
126273
|
isColumnEditable(rowIndex, column) {
|
|
126202
126274
|
if (column.getColDef().headerName === '' || rowIndex === -1)
|
|
@@ -126532,35 +126604,40 @@ class AgGridController {
|
|
|
126532
126604
|
return false;
|
|
126533
126605
|
}
|
|
126534
126606
|
onSelectionChange(event) {
|
|
126535
|
-
if (this._selectionChangeCallback)
|
|
126536
|
-
|
|
126537
|
-
|
|
126538
|
-
|
|
126539
|
-
|
|
126540
|
-
|
|
126541
|
-
|
|
126542
|
-
|
|
126543
|
-
|
|
126544
|
-
|
|
126545
|
-
|
|
126546
|
-
|
|
126547
|
-
|
|
126548
|
-
|
|
126549
|
-
|
|
126550
|
-
|
|
126551
|
-
|
|
126552
|
-
});
|
|
126553
|
-
});
|
|
126554
|
-
}
|
|
126555
|
-
}
|
|
126556
|
-
else {
|
|
126557
|
-
this._selectionChangeCallback({
|
|
126558
|
-
selection: this._gridOptions.api.getSelectedRows(),
|
|
126559
|
-
selectionHeaderStatus: this.getSelectionHeaderStatus(),
|
|
126560
|
-
});
|
|
126561
|
-
}
|
|
126562
|
-
}, 0);
|
|
126607
|
+
if (!this._selectionChangeCallback)
|
|
126608
|
+
return;
|
|
126609
|
+
clearTimeout(this._selectionChangeDeboucing);
|
|
126610
|
+
this._selectionChangeDeboucing = window.setTimeout(() => {
|
|
126611
|
+
this.handleExecuteProceedAutosave();
|
|
126612
|
+
this.processBuildSelectionChangeCallback(event);
|
|
126613
|
+
}, 0);
|
|
126614
|
+
}
|
|
126615
|
+
handleExecuteProceedAutosave() {
|
|
126616
|
+
if (this._gridShowDom) {
|
|
126617
|
+
this._editionManager.proceedAutoSave();
|
|
126618
|
+
}
|
|
126619
|
+
}
|
|
126620
|
+
processBuildSelectionChangeCallback(event) {
|
|
126621
|
+
if (this._dataUnit) {
|
|
126622
|
+
this.handleBuildSelectionChangeWithDU(event.context.selectionChangeQuietly);
|
|
126623
|
+
return;
|
|
126563
126624
|
}
|
|
126625
|
+
this.buildSelectionChangeCallback(this._gridOptions.api.getSelectedRows());
|
|
126626
|
+
}
|
|
126627
|
+
handleBuildSelectionChangeWithDU(quietly) {
|
|
126628
|
+
if (quietly) {
|
|
126629
|
+
this.buildSelectionChangeCallback(this._dataUnit.records);
|
|
126630
|
+
return;
|
|
126631
|
+
}
|
|
126632
|
+
this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows()
|
|
126633
|
+
.map((r) => r.__record__id__))
|
|
126634
|
+
.then(selectionInfo => this.buildSelectionChangeCallback(selectionInfo.records));
|
|
126635
|
+
}
|
|
126636
|
+
buildSelectionChangeCallback(records) {
|
|
126637
|
+
this._selectionChangeCallback({
|
|
126638
|
+
selection: records,
|
|
126639
|
+
selectionHeaderStatus: this.getSelectionHeaderStatus(),
|
|
126640
|
+
});
|
|
126564
126641
|
}
|
|
126565
126642
|
onRowDoubleClick(evt) {
|
|
126566
126643
|
if (this._doubleClickCallBack) {
|
|
@@ -126572,6 +126649,12 @@ class AgGridController {
|
|
|
126572
126649
|
host[attribute] = value;
|
|
126573
126650
|
}
|
|
126574
126651
|
}
|
|
126652
|
+
processEditionCanceled() {
|
|
126653
|
+
this.clearInvalidCells(true);
|
|
126654
|
+
if (this._gridShowDom) {
|
|
126655
|
+
this._dataUnit.clearSelection();
|
|
126656
|
+
}
|
|
126657
|
+
}
|
|
126575
126658
|
setCellEditors(customEditors) {
|
|
126576
126659
|
var _a;
|
|
126577
126660
|
if (!this._editionManager) {
|
|
@@ -126590,12 +126673,15 @@ class AgGridController {
|
|
|
126590
126673
|
this._editionManager.setCellRenders(customRenders);
|
|
126591
126674
|
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.redrawRows();
|
|
126592
126675
|
}
|
|
126593
|
-
clearInvalidCells(
|
|
126676
|
+
clearInvalidCells(stopEdition) {
|
|
126594
126677
|
if (!this._editionManager)
|
|
126595
126678
|
return;
|
|
126596
|
-
this._editionManager.clearInvalidCells(
|
|
126679
|
+
this._editionManager.clearInvalidCells(stopEdition);
|
|
126597
126680
|
this._gridOptions.api.refreshCells({ force: true });
|
|
126598
126681
|
}
|
|
126682
|
+
processContinuousInsert() {
|
|
126683
|
+
this._editionManager.processContinuousInsert();
|
|
126684
|
+
}
|
|
126599
126685
|
destroy() {
|
|
126600
126686
|
this.observer.disconnect();
|
|
126601
126687
|
}
|
|
@@ -127234,7 +127320,8 @@ const EzGrid$1 = class extends HTMLElement$1 {
|
|
|
127234
127320
|
return this._getActualPageLabel() + this._getRemainingPageLabel();
|
|
127235
127321
|
}
|
|
127236
127322
|
_initHeaderOverflowWatcher() {
|
|
127237
|
-
|
|
127323
|
+
if (this._refPaginationControl)
|
|
127324
|
+
this._headerOverflowWatcher = new OverflowWatcher(this.buildOverFlowWatcherParams());
|
|
127238
127325
|
}
|
|
127239
127326
|
buildOverFlowWatcherParams() {
|
|
127240
127327
|
return {
|
|
@@ -129046,6 +129133,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129046
129133
|
this.showSelectedValue = true;
|
|
129047
129134
|
this.showOptionValue = true;
|
|
129048
129135
|
this.suppressEmptyOption = false;
|
|
129136
|
+
this.stopPropagateEnterKeyEvent = false;
|
|
129049
129137
|
this.mode = "regular";
|
|
129050
129138
|
this.canShowError = true;
|
|
129051
129139
|
this.hideErrorOnFocusOut = true;
|
|
@@ -129220,6 +129308,9 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129220
129308
|
getText() {
|
|
129221
129309
|
const currentValue = this.getSelectedOption(this._currentValue);
|
|
129222
129310
|
const text = this.getFormattedText(currentValue);
|
|
129311
|
+
return this.replaceQuotes(text);
|
|
129312
|
+
}
|
|
129313
|
+
replaceQuotes(text) {
|
|
129223
129314
|
if (text == undefined) {
|
|
129224
129315
|
return;
|
|
129225
129316
|
}
|
|
@@ -129508,6 +129599,15 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129508
129599
|
}
|
|
129509
129600
|
this._currentValue = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
129510
129601
|
this.value = this._currentValue;
|
|
129602
|
+
this.setTextInputValue();
|
|
129603
|
+
}
|
|
129604
|
+
setTextInputValue() {
|
|
129605
|
+
if (this._textInput && (this._textInput.value === null || this._textInput.value === undefined)) {
|
|
129606
|
+
if (this.value === undefined || this.value === null)
|
|
129607
|
+
return;
|
|
129608
|
+
const textValue = (typeof this.value === 'string') ? this.value : this.getFormattedText(this.value);
|
|
129609
|
+
this._textInput.value = this.replaceQuotes(textValue);
|
|
129610
|
+
}
|
|
129511
129611
|
}
|
|
129512
129612
|
loadOptionValue(argument) {
|
|
129513
129613
|
var _a;
|
|
@@ -129656,6 +129756,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129656
129756
|
event.stopPropagation();
|
|
129657
129757
|
break;
|
|
129658
129758
|
case "Enter":
|
|
129759
|
+
this.handleEventPropagation(event);
|
|
129659
129760
|
this.selectCurrentOption();
|
|
129660
129761
|
break;
|
|
129661
129762
|
case "Escape":
|
|
@@ -129672,6 +129773,12 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129672
129773
|
//e o contexto pode reagir (fechar um popup por exemplo).
|
|
129673
129774
|
//event.stopPropagation();
|
|
129674
129775
|
}
|
|
129776
|
+
//O evento deve ter sua propagação interrompida, apenas se a lista de opções estiver sendo exibida.
|
|
129777
|
+
handleEventPropagation(event) {
|
|
129778
|
+
if (this._listContainer.hasChildNodes() && this.stopPropagateEnterKeyEvent) {
|
|
129779
|
+
event.stopPropagation();
|
|
129780
|
+
}
|
|
129781
|
+
}
|
|
129675
129782
|
onTextInputFocusOutHandler() {
|
|
129676
129783
|
if (this.hideErrorOnFocusOut)
|
|
129677
129784
|
this.cancelPreselection();
|
|
@@ -133133,7 +133240,7 @@ const EzChart = /*@__PURE__*/proxyCustomElement(EzChart$1, [1,"ez-chart",{"type"
|
|
|
133133
133240
|
const EzCheck = /*@__PURE__*/proxyCustomElement(EzCheck$1, [1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4]}]);
|
|
133134
133241
|
const EzChip = /*@__PURE__*/proxyCustomElement(EzChip$1, [1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"]}]);
|
|
133135
133242
|
const EzCollapsibleBox = /*@__PURE__*/proxyCustomElement(EzCollapsibleBox$1, [1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32]}]);
|
|
133136
|
-
const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32]},[[11,"scroll","scrollListener"]]]);
|
|
133243
|
+
const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"stopPropagateEnterKeyEvent":[4,"stop-propagate-enter-key-event"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32]},[[11,"scroll","scrollListener"]]]);
|
|
133137
133244
|
const EzCustomFormInput = /*@__PURE__*/proxyCustomElement(EzCustomFormInput$1, [2,"ez-custom-form-input",{"customEditor":[16],"formViewField":[16],"value":[1032],"detailContext":[1,"detail-context"],"builderFallback":[16],"selectedRecord":[16],"gui":[32]}]);
|
|
133138
133245
|
const EzDateInput = /*@__PURE__*/proxyCustomElement(EzDateInput$1, [1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"]}]);
|
|
133139
133246
|
const EzDateTimeInput = /*@__PURE__*/proxyCustomElement(EzDateTimeInput$1, [1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"]}]);
|
|
@@ -133156,7 +133263,7 @@ const EzPopover = /*@__PURE__*/proxyCustomElement(EzPopover$1, [1,"ez-popover",{
|
|
|
133156
133263
|
const EzPopup = /*@__PURE__*/proxyCustomElement(EzPopup$1, [1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"],"enabledScroll":[4,"enabled-scroll"]}]);
|
|
133157
133264
|
const EzRadioButton = /*@__PURE__*/proxyCustomElement(EzRadioButton$1, [1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]);
|
|
133158
133265
|
const EzScroller = /*@__PURE__*/proxyCustomElement(EzScroller$1, [1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]]);
|
|
133159
|
-
const EzSearch = /*@__PURE__*/proxyCustomElement(EzSearch$1, [1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"ensureClearButtonVisible":[4,"ensure-clear-button-visible"],"suppressPreLoad":[4,"suppress-pre-load"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32]},[[11,"scroll","scrollListener"]]]);
|
|
133266
|
+
const EzSearch = /*@__PURE__*/proxyCustomElement(EzSearch$1, [1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"stopPropagateEnterKeyEvent":[4,"stop-propagate-enter-key-event"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"ensureClearButtonVisible":[4,"ensure-clear-button-visible"],"suppressPreLoad":[4,"suppress-pre-load"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32]},[[11,"scroll","scrollListener"]]]);
|
|
133160
133267
|
const EzSidebarButton = /*@__PURE__*/proxyCustomElement(EzSidebarButton$1, [1,"ez-sidebar-button"]);
|
|
133161
133268
|
const EzSidebarNavigator = /*@__PURE__*/proxyCustomElement(EzSidebarNavigator$1, [1,"ez-sidebar-navigator",{"type":[1],"mode":[1025],"size":[1],"isResponsive":[4,"is-responsive"],"titleMenu":[1,"title-menu"],"showCollapseMenu":[4,"show-collapse-menu"],"showFixedButton":[4,"show-fixed-button"],"open":[32]}]);
|
|
133162
133269
|
const EzSkeleton = /*@__PURE__*/proxyCustomElement(EzSkeleton$1, [0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]);
|