@sankhyalabs/ezui 1.1.131 → 1.1.134
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-form.cjs.entry.js +14 -3
- package/dist/cjs/ez-grid.cjs.entry.js +215 -51
- package/dist/cjs/ez-list.cjs.entry.js +11 -0
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -2
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/grid-config.cjs.entry.js +64 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-form/DataBinder.js +13 -2
- package/dist/collection/components/ez-form/ez-form.js +1 -1
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +10 -5
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +128 -36
- package/dist/collection/components/ez-grid/ez-grid.js +253 -15
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +44 -2
- package/dist/collection/components/ez-list/ez-list.js +27 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js +1 -2
- package/dist/collection/utils/interfaces/PageableComponent.js +1 -0
- package/dist/custom-elements/index.js +305 -78
- package/dist/esm/ez-form.entry.js +14 -3
- package/dist/esm/ez-grid.entry.js +216 -52
- package/dist/esm/ez-list.entry.js +11 -0
- package/dist/esm/ez-time-input.entry.js +1 -2
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/grid-config.entry.js +64 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-2d165ca8.entry.js → p-80d863c2.entry.js} +7 -7
- package/dist/ezui/p-bb7ad4ae.entry.js +1 -0
- package/dist/ezui/{p-47fe4273.entry.js → p-cfa7378a.entry.js} +1 -1
- package/dist/ezui/p-d9bb2a96.entry.js +1 -0
- package/dist/ezui/p-f1a18697.entry.js +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +46 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +12 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +45 -4
- package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +1 -0
- package/dist/types/components/ez-list/ez-list.d.ts +4 -0
- package/dist/types/components.d.ts +45 -0
- package/dist/types/utils/interfaces/PageableComponent.d.ts +12 -0
- package/package.json +1 -1
- package/dist/cjs/AssetsUtils-78164781.js +0 -24
- package/dist/esm/AssetsUtils-aab9ca8f.js +0 -22
- package/dist/ezui/p-51b878f7.js +0 -1
- package/dist/ezui/p-6d39b7ea.entry.js +0 -1
- package/dist/ezui/p-7d5b2ebf.entry.js +0 -1
- package/dist/ezui/p-ed1e0331.entry.js +0 -1
|
@@ -641,7 +641,12 @@ class DataBinder {
|
|
|
641
641
|
const oldValue = field["value"];
|
|
642
642
|
const newValue = this._dataUnit.getFieldValue(fieldName);
|
|
643
643
|
if (oldValue != newValue) {
|
|
644
|
-
|
|
644
|
+
if (newValue === undefined) {
|
|
645
|
+
field.removeAttribute("value");
|
|
646
|
+
}
|
|
647
|
+
else {
|
|
648
|
+
field["value"] = newValue;
|
|
649
|
+
}
|
|
645
650
|
}
|
|
646
651
|
}
|
|
647
652
|
updateBind(fieldName, field) {
|
|
@@ -649,7 +654,13 @@ class DataBinder {
|
|
|
649
654
|
if (oldBind) {
|
|
650
655
|
oldBind.destroy();
|
|
651
656
|
}
|
|
652
|
-
|
|
657
|
+
const value = this._dataUnit.getFieldValue(fieldName);
|
|
658
|
+
if (value === undefined) {
|
|
659
|
+
field.removeAttribute("value");
|
|
660
|
+
}
|
|
661
|
+
else {
|
|
662
|
+
field["value"] = value;
|
|
663
|
+
}
|
|
653
664
|
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
654
665
|
this.bindSearchOptionsLoader(fieldName, field);
|
|
655
666
|
this.applyEzUploadContext(fieldName, field);
|
|
@@ -736,7 +747,7 @@ let EzForm = class {
|
|
|
736
747
|
.filter(f => f.dataset.required)
|
|
737
748
|
.map(f => f.dataset.fieldName)
|
|
738
749
|
.concat(metadata.getRequiredFields());
|
|
739
|
-
const records = this.dataUnit.
|
|
750
|
+
const records = this.dataUnit.getModifiedRecords();
|
|
740
751
|
for (let i = 0; i < records.length; i++) {
|
|
741
752
|
if (!this.validateRequired(requiredFields, records[i])) {
|
|
742
753
|
reject();
|
|
@@ -110063,8 +110063,11 @@ class DataSource {
|
|
|
110063
110063
|
|
|
110064
110064
|
class AgGridController {
|
|
110065
110065
|
constructor(enterprise) {
|
|
110066
|
+
this.DEFAULT_ROW_HEIGHT = 25;
|
|
110066
110067
|
this._menuItems = [];
|
|
110067
110068
|
this._idAttribName = "__record__id__";
|
|
110069
|
+
this._isFirstRecordOfPage = true;
|
|
110070
|
+
this._isLastRecordOfPage = false;
|
|
110068
110071
|
this._enterprise = enterprise;
|
|
110069
110072
|
}
|
|
110070
110073
|
getSort() {
|
|
@@ -110092,7 +110095,9 @@ class AgGridController {
|
|
|
110092
110095
|
this._pageSize = options.pageSize;
|
|
110093
110096
|
this._serverURL = options.serverURL;
|
|
110094
110097
|
this._dataUnit = options.dataUnit;
|
|
110095
|
-
this._dataUnit
|
|
110098
|
+
if (this._dataUnit) {
|
|
110099
|
+
this._dataUnit.sortingProvider = this;
|
|
110100
|
+
}
|
|
110096
110101
|
this._dataSource = new DataSource(this._dataUnit, this._serverURL);
|
|
110097
110102
|
this._gridOptions = {
|
|
110098
110103
|
localeText: gridTerms,
|
|
@@ -110101,7 +110106,7 @@ class AgGridController {
|
|
|
110101
110106
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
110102
110107
|
serverSideDatasource: this._dataSource,
|
|
110103
110108
|
sortingOrder: ['desc', 'asc', null],
|
|
110104
|
-
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
110109
|
+
getRowNodeId: this._dataUnit ? (params) => typeof params === "string" ? params : params[this._idAttribName] : undefined,
|
|
110105
110110
|
getMainMenuItems: (params) => {
|
|
110106
110111
|
const column = params.column;
|
|
110107
110112
|
const items = [column.isPinned() ? "clearPinned" : "pinLeft", "separator"];
|
|
@@ -110111,14 +110116,12 @@ class AgGridController {
|
|
|
110111
110116
|
}));
|
|
110112
110117
|
return items;
|
|
110113
110118
|
},
|
|
110114
|
-
|
|
110115
|
-
|
|
110116
|
-
|
|
110117
|
-
|
|
110118
|
-
|
|
110119
|
-
|
|
110120
|
-
return 25;
|
|
110121
|
-
}
|
|
110119
|
+
//FIXME: Existe um bug no PartialStore.prototype.destroyAllBlocks do ag-grid, pois
|
|
110120
|
+
//apesar de destruir os blocos, mantém a variável "blockHeights" com o tamanho antigo
|
|
110121
|
+
//dos blocos, então, quando removemos uma linha, a altura do bloco não é recalculada.
|
|
110122
|
+
//Descobri que setando manualmente a altura das linhas, apesar do bloco ficar com
|
|
110123
|
+
//tamanho errado, isso afeta menos o componente.
|
|
110124
|
+
rowHeight: this.DEFAULT_ROW_HEIGHT
|
|
110122
110125
|
};
|
|
110123
110126
|
this.setOptionsEvents(this._gridOptions);
|
|
110124
110127
|
this.setOptionsPagination(this._gridOptions);
|
|
@@ -110141,16 +110144,17 @@ class AgGridController {
|
|
|
110141
110144
|
opt.onPaginationChanged = () => this.onPaginationChange();
|
|
110142
110145
|
opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
|
|
110143
110146
|
opt.onDragStopped = evt => this.onCallStateChange("columnMovedEnd", evt);
|
|
110144
|
-
|
|
110145
|
-
|
|
110146
|
-
|
|
110147
|
-
|
|
110148
|
-
}
|
|
110147
|
+
}
|
|
110148
|
+
syncSelection() {
|
|
110149
|
+
if (this._dataUnit) {
|
|
110150
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
110151
|
+
}
|
|
110149
110152
|
}
|
|
110150
110153
|
setOptionsPagination(opt) {
|
|
110151
110154
|
opt.pagination = (this._pageSize > -1);
|
|
110152
110155
|
opt.paginationPageSize = this._pageSize;
|
|
110153
110156
|
opt.cacheBlockSize = this._pageSize;
|
|
110157
|
+
opt.maxBlocksInCache = 1;
|
|
110154
110158
|
}
|
|
110155
110159
|
setOptionsSupress(opt) {
|
|
110156
110160
|
opt.suppressDragLeaveHidesColumns = true;
|
|
@@ -110186,7 +110190,7 @@ class AgGridController {
|
|
|
110186
110190
|
if (this._grid === undefined) {
|
|
110187
110191
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110188
110192
|
}
|
|
110189
|
-
this._gridOptions.api.refreshServerSideStore({});
|
|
110193
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
110190
110194
|
}
|
|
110191
110195
|
changeValues(changes, rowIds) {
|
|
110192
110196
|
if (this._grid === undefined) {
|
|
@@ -110323,6 +110327,75 @@ class AgGridController {
|
|
|
110323
110327
|
this.goToPage(0);
|
|
110324
110328
|
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
110325
110329
|
}
|
|
110330
|
+
isLastOfPage() {
|
|
110331
|
+
return this._isLastRecordOfPage;
|
|
110332
|
+
}
|
|
110333
|
+
isFirstOfPage() {
|
|
110334
|
+
return this._isFirstRecordOfPage;
|
|
110335
|
+
}
|
|
110336
|
+
previousRecord() {
|
|
110337
|
+
const pagination = this.getPaginationStatus();
|
|
110338
|
+
if (this._isFirstRecordOfPage && pagination.hasPrevious) {
|
|
110339
|
+
this.previousPage();
|
|
110340
|
+
}
|
|
110341
|
+
else {
|
|
110342
|
+
if (this._dataUnit) {
|
|
110343
|
+
this._dataUnit.previousRecord();
|
|
110344
|
+
}
|
|
110345
|
+
else {
|
|
110346
|
+
const node = this._gridOptions.api.getSelectedNodes()[0];
|
|
110347
|
+
this.setSelectedIndex(node.rowIndex - 1);
|
|
110348
|
+
}
|
|
110349
|
+
}
|
|
110350
|
+
}
|
|
110351
|
+
nextRecord() {
|
|
110352
|
+
const pagination = this.getPaginationStatus();
|
|
110353
|
+
if (this._isLastRecordOfPage && pagination.hasNext) {
|
|
110354
|
+
this.nextPage();
|
|
110355
|
+
}
|
|
110356
|
+
else {
|
|
110357
|
+
if (this._dataUnit) {
|
|
110358
|
+
this._dataUnit.nextRecord();
|
|
110359
|
+
}
|
|
110360
|
+
else {
|
|
110361
|
+
const node = this._gridOptions.api.getSelectedNodes()[0];
|
|
110362
|
+
this.setSelectedIndex(node.rowIndex + 1);
|
|
110363
|
+
}
|
|
110364
|
+
}
|
|
110365
|
+
}
|
|
110366
|
+
setSelectedIndex(index) {
|
|
110367
|
+
var _a;
|
|
110368
|
+
(_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
|
|
110369
|
+
}
|
|
110370
|
+
hasPreviousRecord() {
|
|
110371
|
+
const pagination = this.getPaginationStatus();
|
|
110372
|
+
if (this._isFirstRecordOfPage) {
|
|
110373
|
+
return pagination.hasPrevious;
|
|
110374
|
+
}
|
|
110375
|
+
else {
|
|
110376
|
+
if (this._dataUnit) {
|
|
110377
|
+
return this._dataUnit.hasPrevious();
|
|
110378
|
+
}
|
|
110379
|
+
else {
|
|
110380
|
+
return pagination.hasPrevious || this._gridOptions.api.getSelectedRows()[0].rowIndex > 0;
|
|
110381
|
+
}
|
|
110382
|
+
}
|
|
110383
|
+
}
|
|
110384
|
+
hasNextRecord() {
|
|
110385
|
+
const pagination = this.getPaginationStatus();
|
|
110386
|
+
if (this._isLastRecordOfPage) {
|
|
110387
|
+
return pagination.hasNext;
|
|
110388
|
+
}
|
|
110389
|
+
else {
|
|
110390
|
+
if (this._dataUnit) {
|
|
110391
|
+
return this._dataUnit.hasNext() || this.getPaginationStatus().hasNext;
|
|
110392
|
+
}
|
|
110393
|
+
else {
|
|
110394
|
+
const api = this._gridOptions.api;
|
|
110395
|
+
return pagination.hasNext || api.getSelectedRows()[0].rowIndex < api.getDisplayedRowCount();
|
|
110396
|
+
}
|
|
110397
|
+
}
|
|
110398
|
+
}
|
|
110326
110399
|
buildColDef(source) {
|
|
110327
110400
|
return {
|
|
110328
110401
|
headerName: source.label,
|
|
@@ -110357,19 +110430,24 @@ class AgGridController {
|
|
|
110357
110430
|
});
|
|
110358
110431
|
return optionSelected === null || optionSelected === void 0 ? void 0 : optionSelected.label;
|
|
110359
110432
|
}
|
|
110360
|
-
if ((source === null || source === void 0 ? void 0 : source.userInterface) ===
|
|
110361
|
-
if ((params === null || params === void 0 ? void 0 : params.value) === "S" || (params === null || params === void 0 ? void 0 : params.value) === true) {
|
|
110433
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UnitMetadata.UserInterface.SWITCH) {
|
|
110434
|
+
if ((params === null || params === void 0 ? void 0 : params.value) === "S" || (params === null || params === void 0 ? void 0 : params.value) === true || (params === null || params === void 0 ? void 0 : params.value) === "true") {
|
|
110362
110435
|
return "Sim";
|
|
110363
110436
|
}
|
|
110364
|
-
else if ((params === null || params === void 0 ? void 0 : params.value) === "N" || (params === null || params === void 0 ? void 0 : params.value) === false) {
|
|
110437
|
+
else if ((params === null || params === void 0 ? void 0 : params.value) === "N" || (params === null || params === void 0 ? void 0 : params.value) === false || (params === null || params === void 0 ? void 0 : params.value) === "false") {
|
|
110365
110438
|
return "Não";
|
|
110366
110439
|
}
|
|
110367
110440
|
}
|
|
110368
|
-
if ((source === null || source === void 0 ? void 0 : source.userInterface) ===
|
|
110441
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UnitMetadata.UserInterface.SEARCH) {
|
|
110369
110442
|
if (params.value !== undefined) {
|
|
110370
110443
|
return ((_a = params === null || params === void 0 ? void 0 : params.value) === null || _a === void 0 ? void 0 : _a.value) + " - " + ((_b = params === null || params === void 0 ? void 0 : params.value) === null || _b === void 0 ? void 0 : _b.label);
|
|
110371
110444
|
}
|
|
110372
110445
|
}
|
|
110446
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UnitMetadata.UserInterface.DECIMALNUMBER) {
|
|
110447
|
+
if (params.value !== undefined) {
|
|
110448
|
+
return core.NumberUtils.format(params.value.toString(), 2, 2);
|
|
110449
|
+
}
|
|
110450
|
+
}
|
|
110373
110451
|
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UnitMetadata.UserInterface.DATE || (source === null || source === void 0 ? void 0 : source.userInterface) === UnitMetadata.UserInterface.DATETIME) {
|
|
110374
110452
|
if (params.value !== undefined) {
|
|
110375
110453
|
return params.value.toLocaleDateString();
|
|
@@ -110399,31 +110477,44 @@ class AgGridController {
|
|
|
110399
110477
|
return false;
|
|
110400
110478
|
}
|
|
110401
110479
|
onSelectionChange(e) {
|
|
110480
|
+
const selectedNodes = e.api.getSelectedNodes();
|
|
110481
|
+
if (selectedNodes.length > 0) {
|
|
110482
|
+
this._isFirstRecordOfPage = selectedNodes[0].rowIndex === e.api.getFirstDisplayedRow();
|
|
110483
|
+
this._isLastRecordOfPage = selectedNodes[0].rowIndex === e.api.getLastDisplayedRow();
|
|
110484
|
+
}
|
|
110402
110485
|
if (this._selectionChangeCallback) {
|
|
110403
|
-
this._selectionChangeCallback(
|
|
110486
|
+
this._selectionChangeCallback({
|
|
110487
|
+
selection: e.api.getSelectedRows(),
|
|
110488
|
+
isFirstOfPage: this._isFirstRecordOfPage,
|
|
110489
|
+
isLastOfPage: this._isLastRecordOfPage
|
|
110490
|
+
});
|
|
110404
110491
|
}
|
|
110405
110492
|
}
|
|
110406
110493
|
onPaginationChange() {
|
|
110494
|
+
this.syncSelection();
|
|
110407
110495
|
if (this._paginationChangeCallback) {
|
|
110408
110496
|
if (this._gridOptions.api) {
|
|
110409
|
-
|
|
110410
|
-
const currentPage = api.paginationGetCurrentPage();
|
|
110411
|
-
const isLastPage = api.paginationGetTotalPages() === (currentPage + 1);
|
|
110412
|
-
const pageSize = api.paginationGetPageSize();
|
|
110413
|
-
const totalRows = api.paginationGetRowCount();
|
|
110414
|
-
const pageStart = currentPage * pageSize + 1;
|
|
110415
|
-
const pageEnd = Math.min(totalRows, (currentPage + 1) * pageSize);
|
|
110416
|
-
this._paginationChangeCallback({
|
|
110417
|
-
hasPrevious: currentPage > 0,
|
|
110418
|
-
hasNext: !isLastPage,
|
|
110419
|
-
currentPage: currentPage + 1,
|
|
110420
|
-
pageStart,
|
|
110421
|
-
pageEnd,
|
|
110422
|
-
totalRows
|
|
110423
|
-
});
|
|
110497
|
+
this._paginationChangeCallback(this.getPaginationStatus());
|
|
110424
110498
|
}
|
|
110425
110499
|
}
|
|
110426
110500
|
}
|
|
110501
|
+
getPaginationStatus() {
|
|
110502
|
+
const api = this._gridOptions.api;
|
|
110503
|
+
const currentPage = api.paginationGetCurrentPage();
|
|
110504
|
+
const isLastPage = api.paginationGetTotalPages() === (currentPage + 1);
|
|
110505
|
+
const pageSize = api.paginationGetPageSize();
|
|
110506
|
+
const totalRows = api.paginationGetRowCount();
|
|
110507
|
+
const pageStart = currentPage * pageSize + 1;
|
|
110508
|
+
const pageEnd = Math.min(totalRows, (currentPage + 1) * pageSize);
|
|
110509
|
+
return {
|
|
110510
|
+
hasPrevious: currentPage > 0,
|
|
110511
|
+
hasNext: !isLastPage,
|
|
110512
|
+
currentPage: currentPage + 1,
|
|
110513
|
+
pageStart,
|
|
110514
|
+
pageEnd,
|
|
110515
|
+
totalRows
|
|
110516
|
+
};
|
|
110517
|
+
}
|
|
110427
110518
|
onRowDoubleClick(evt) {
|
|
110428
110519
|
if (this._doubleClickCallBack) {
|
|
110429
110520
|
this._doubleClickCallBack(evt.data);
|
|
@@ -110447,10 +110538,6 @@ class DataUnitBridge {
|
|
|
110447
110538
|
const { records } = action.payload;
|
|
110448
110539
|
this._gridController.removeRows(records);
|
|
110449
110540
|
break;
|
|
110450
|
-
case core.Action.RECORDS_ADDED:
|
|
110451
|
-
case core.Action.RECORDS_COPIED:
|
|
110452
|
-
this._gridController.addRows(action.payload);
|
|
110453
|
-
break;
|
|
110454
110541
|
case core.Action.EDITION_CANCELED:
|
|
110455
110542
|
case core.Action.DATA_SAVED:
|
|
110456
110543
|
this._gridController.refresh();
|
|
@@ -110459,6 +110546,10 @@ class DataUnitBridge {
|
|
|
110459
110546
|
const { selection } = action.payload;
|
|
110460
110547
|
this._gridController.selectRows(selection);
|
|
110461
110548
|
break;
|
|
110549
|
+
case core.Action.NEXT_SELECTED:
|
|
110550
|
+
case core.Action.PREVIOUS_SELECTED:
|
|
110551
|
+
this._gridController.selectRows(this._dataUnit.getSelection());
|
|
110552
|
+
break;
|
|
110462
110553
|
case core.Action.DATA_CHANGED:
|
|
110463
110554
|
const changes = Object.assign({}, action.payload);
|
|
110464
110555
|
delete changes.records;
|
|
@@ -110475,7 +110566,12 @@ class DataUnitBridge {
|
|
|
110475
110566
|
this._dataUnit.metadata.fields.forEach(f => {
|
|
110476
110567
|
var _a;
|
|
110477
110568
|
if (f.visible !== false) {
|
|
110478
|
-
|
|
110569
|
+
const props = new Map();
|
|
110570
|
+
const properties = this._dataUnit.getField(f.name).properties;
|
|
110571
|
+
for (const value in properties) {
|
|
110572
|
+
props.set(value, properties[value]);
|
|
110573
|
+
}
|
|
110574
|
+
columnDefs.push({ label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props });
|
|
110479
110575
|
}
|
|
110480
110576
|
});
|
|
110481
110577
|
}
|
|
@@ -110496,7 +110592,7 @@ let EzGrid = class {
|
|
|
110496
110592
|
this.ezDoubleClick = index.createEvent(this, "ezDoubleClick", 7);
|
|
110497
110593
|
this.configChange = index.createEvent(this, "configChange", 7);
|
|
110498
110594
|
this._gridController = new AgGridController(false);
|
|
110499
|
-
this.
|
|
110595
|
+
this._popUpGridConfig = false;
|
|
110500
110596
|
/**
|
|
110501
110597
|
* Determina o número de linhas de cada página. Caso informado o valor -1
|
|
110502
110598
|
* não haverá paginação.
|
|
@@ -110558,6 +110654,74 @@ let EzGrid = class {
|
|
|
110558
110654
|
async quickFilter(term) {
|
|
110559
110655
|
this._gridController.quickFilter(term);
|
|
110560
110656
|
}
|
|
110657
|
+
/**
|
|
110658
|
+
* Método para fazer um filtro rápido na grid.
|
|
110659
|
+
*/
|
|
110660
|
+
async nextPage() {
|
|
110661
|
+
this._gridController.nextPage();
|
|
110662
|
+
}
|
|
110663
|
+
/**
|
|
110664
|
+
* Método para fazer um filtro rápido na grid.
|
|
110665
|
+
*/
|
|
110666
|
+
async previousPage() {
|
|
110667
|
+
this._gridController.previousPage();
|
|
110668
|
+
}
|
|
110669
|
+
/**
|
|
110670
|
+
* Método para fazer um filtro rápido na grid.
|
|
110671
|
+
*/
|
|
110672
|
+
async hasNextPage() {
|
|
110673
|
+
return new Promise(resolve => {
|
|
110674
|
+
resolve(this._navigationHasNext);
|
|
110675
|
+
});
|
|
110676
|
+
}
|
|
110677
|
+
/**
|
|
110678
|
+
* Método para fazer um filtro rápido na grid.
|
|
110679
|
+
*/
|
|
110680
|
+
async hasPreviousPage() {
|
|
110681
|
+
return new Promise(resolve => {
|
|
110682
|
+
resolve(this._navigationHasPrevious);
|
|
110683
|
+
});
|
|
110684
|
+
}
|
|
110685
|
+
/**
|
|
110686
|
+
* Método para verificar se o registro selecionado é o ultimo da página.
|
|
110687
|
+
*/
|
|
110688
|
+
async isLastOfPage() {
|
|
110689
|
+
return new Promise(resolve => {
|
|
110690
|
+
resolve(this._gridController.isLastOfPage());
|
|
110691
|
+
});
|
|
110692
|
+
}
|
|
110693
|
+
/**
|
|
110694
|
+
* Método para verificar se o registro selecionado é o primeiro da página.
|
|
110695
|
+
*/
|
|
110696
|
+
async isFirstOfPage() {
|
|
110697
|
+
return new Promise(resolve => {
|
|
110698
|
+
resolve(this._gridController.isFirstOfPage());
|
|
110699
|
+
});
|
|
110700
|
+
}
|
|
110701
|
+
/**
|
|
110702
|
+
* Método para navegar para o proxímo registro da grid.
|
|
110703
|
+
*/
|
|
110704
|
+
async nextRecord() {
|
|
110705
|
+
this._gridController.nextRecord();
|
|
110706
|
+
}
|
|
110707
|
+
/**
|
|
110708
|
+
* Método para navegar para o registro anterior da grid.
|
|
110709
|
+
*/
|
|
110710
|
+
async previousRecord() {
|
|
110711
|
+
this._gridController.previousRecord();
|
|
110712
|
+
}
|
|
110713
|
+
/**
|
|
110714
|
+
* Método para verificar se existem proximos registros.
|
|
110715
|
+
*/
|
|
110716
|
+
async hasNextRecord() {
|
|
110717
|
+
return Promise.resolve(this._gridController.hasNextRecord());
|
|
110718
|
+
}
|
|
110719
|
+
/**
|
|
110720
|
+
* Método para verificar se existem registros anteriores.
|
|
110721
|
+
*/
|
|
110722
|
+
async hasPreviousRecord() {
|
|
110723
|
+
return Promise.resolve(this._gridController.hasPreviousRecord());
|
|
110724
|
+
}
|
|
110561
110725
|
componentWillLoad() {
|
|
110562
110726
|
if (this.dataUnit) {
|
|
110563
110727
|
this._dataUnitBridge = new DataUnitBridge(this._gridController, this.dataUnit);
|
|
@@ -110630,7 +110794,7 @@ let EzGrid = class {
|
|
|
110630
110794
|
componentDidLoad() {
|
|
110631
110795
|
this._gridController.initDatagrid(this._container, {
|
|
110632
110796
|
onColumnStateChange: (type, state, info) => this.onColumnStateChange(type, state, info),
|
|
110633
|
-
onSelectionChange: (
|
|
110797
|
+
onSelectionChange: (state) => this.ezSelectionChange.emit(state.selection),
|
|
110634
110798
|
onPaginationChange: (status) => {
|
|
110635
110799
|
this._navigationHasPrevious = status.hasPrevious;
|
|
110636
110800
|
this._navigationHasNext = status.hasNext;
|
|
@@ -110664,24 +110828,24 @@ let EzGrid = class {
|
|
|
110664
110828
|
}
|
|
110665
110829
|
return [
|
|
110666
110830
|
index.h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium" }, index.h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, `${this._navigationFirstRow}-${this._navigationLastRow}`), ` de ${this._navigationTotalRows}`),
|
|
110667
|
-
index.h("ez-button", { size: "small", iconName: "chevron-left", class: "ez-margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this.
|
|
110668
|
-
index.h("ez-button", { size: "small", iconName: "chevron-right", class: "ez-margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this.
|
|
110831
|
+
index.h("ez-button", { size: "small", iconName: "chevron-left", class: "ez-margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }),
|
|
110832
|
+
index.h("ez-button", { size: "small", iconName: "chevron-right", class: "ez-margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
|
|
110669
110833
|
];
|
|
110670
110834
|
}
|
|
110671
110835
|
applyConfig(config) {
|
|
110672
110836
|
this._gridController.setColumnsState(config.columns);
|
|
110673
|
-
this.
|
|
110837
|
+
this.closeGridConfig();
|
|
110674
110838
|
}
|
|
110675
|
-
|
|
110676
|
-
this.
|
|
110839
|
+
closeGridConfig() {
|
|
110840
|
+
this._popUpGridConfig = false;
|
|
110677
110841
|
}
|
|
110678
|
-
|
|
110842
|
+
openGridConfig() {
|
|
110679
110843
|
this._gridConfig.columns = this._gridController.getColumnsState().filter(c => c.name);
|
|
110680
110844
|
this._gridConfig.selectedTab = "Colunas";
|
|
110681
|
-
this.
|
|
110845
|
+
this._popUpGridConfig = true;
|
|
110682
110846
|
}
|
|
110683
110847
|
render() {
|
|
110684
|
-
return (index.h(index.Host, null, index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container" }, this.getPaginationControl()
|
|
110848
|
+
return (index.h(index.Host, null, index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container" }, this.getPaginationControl())), index.h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" }), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("grid-config", { ref: ref => this._gridConfig = ref, config: this.config, selectedTab: "Colunas", onConfigFinish: evt => { this.applyConfig(evt.detail); this.configChange.emit(evt.detail); }, onConfigCancel: _evt => this.closeGridConfig() }))));
|
|
110685
110849
|
}
|
|
110686
110850
|
static get assetsDirs() { return ["../assets"]; }
|
|
110687
110851
|
static get watchers() { return {
|
|
@@ -59,6 +59,17 @@ let EzList = class {
|
|
|
59
59
|
this._listItemsHistory = [];
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
+
* Responsável por dar um scroll top no componente da lista.
|
|
63
|
+
*/
|
|
64
|
+
async scrollToTop() {
|
|
65
|
+
if (this.useGroups) {
|
|
66
|
+
this._element.shadowRoot.querySelector('.group-container').scrollTop = 0;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this._element.shadowRoot.querySelector('.items-container').scrollTop = 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
62
73
|
* Recebe como argumento um ListItem {label: string} e um booleano que define se o componente deve fazer scroll para exibir o item específico (opcional).
|
|
63
74
|
*/
|
|
64
75
|
async setSelection(selectedItem, scrollToOption) {
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-0e284e03.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const CSSVarsUtils = require('./CSSVarsUtils-1034b7b6.js');
|
|
8
|
-
const AssetsUtils = require('./AssetsUtils-78164781.js');
|
|
9
8
|
|
|
10
9
|
const ezTimeInputCss = ":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";
|
|
11
10
|
|
|
@@ -109,7 +108,7 @@ let EzTimeInput = class {
|
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
render() {
|
|
112
|
-
return (index.h(index.Host, null, index.h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage, mode: this.mode }, index.h("ez-icon", { slot: "leftIcon",
|
|
111
|
+
return (index.h(index.Host, null, index.h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage, mode: this.mode }, index.h("ez-icon", { slot: "leftIcon", iconName: "timer-outline" }))));
|
|
113
112
|
}
|
|
114
113
|
static get assetsDirs() { return ["../assets"]; }
|
|
115
114
|
get _elem() { return index.getElement(this); }
|
package/dist/cjs/ezui.cjs.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"
|
|
18
|
+
return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpGridConfig":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"refresh":[64],"quickFilter":[64],"nextPage":[64],"previousPage":[64],"hasNextPage":[64],"hasPreviousPage":[64],"isLastOfPage":[64],"isFirstOfPage":[64],"nextRecord":[64],"previousRecord":[64],"hasNextRecord":[64],"hasPreviousRecord":[64],"openGridConfig":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-filter-input.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"loading":[516],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040],"config":[1040]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-search.cjs",[[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],"setFocus":[64],"setBlur":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"stretchTitle":[516,"stretch-title"],"showHide":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"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],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du.cjs",[[0,"test-du",{"isDirty":[32]}]]]], options);
|
|
19
19
|
});
|