@sankhyalabs/ezui 1.1.119 → 1.1.120
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-grid.cjs.entry.js +45 -12
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/test-du.cjs.entry.js +14 -10
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +27 -9
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +6 -3
- package/dist/collection/components/ez-grid/ez-grid.js +47 -0
- package/dist/collection/components/test-du/test-du.js +14 -10
- package/dist/custom-elements/index.js +59 -22
- package/dist/esm/ez-grid.entry.js +45 -12
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/test-du.entry.js +14 -10
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-149a8241.entry.js +1 -0
- package/dist/ezui/{p-3cd17150.entry.js → p-c86cd69e.entry.js} +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +6 -2
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -2
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +8 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/ezui/p-73d3f767.entry.js +0 -1
|
@@ -110037,15 +110037,15 @@ class DataSource {
|
|
|
110037
110037
|
}
|
|
110038
110038
|
}
|
|
110039
110039
|
else {
|
|
110040
|
-
this.loadData()
|
|
110040
|
+
this.loadData({ limit: params.api.paginationGetPageSize(), offset: params.request.startRow, quickFilter: this._quickFilterTerm })
|
|
110041
110041
|
.then(data => params.success(data))
|
|
110042
110042
|
.catch(() => params.fail());
|
|
110043
110043
|
}
|
|
110044
110044
|
}
|
|
110045
|
-
loadData() {
|
|
110045
|
+
loadData(page) {
|
|
110046
110046
|
return new Promise((resolve, reject) => {
|
|
110047
110047
|
if (this._dataUnit) {
|
|
110048
|
-
this._dataUnit.loadData().then(
|
|
110048
|
+
this._dataUnit.loadData(page).then(pageRes => resolve({ rowData: this._dataUnit.records, rowCount: pageRes.total }));
|
|
110049
110049
|
}
|
|
110050
110050
|
else {
|
|
110051
110051
|
fetch(this._serverURL)
|
|
@@ -110056,6 +110056,9 @@ class DataSource {
|
|
|
110056
110056
|
}
|
|
110057
110057
|
});
|
|
110058
110058
|
}
|
|
110059
|
+
setQuickFilter(term) {
|
|
110060
|
+
this._quickFilterTerm = term;
|
|
110061
|
+
}
|
|
110059
110062
|
}
|
|
110060
110063
|
|
|
110061
110064
|
class AgGridController {
|
|
@@ -110090,11 +110093,13 @@ class AgGridController {
|
|
|
110090
110093
|
this._serverURL = options.serverURL;
|
|
110091
110094
|
this._dataUnit = options.dataUnit;
|
|
110092
110095
|
this._dataUnit.sortingProvider = this;
|
|
110096
|
+
this._dataSource = new DataSource(this._dataUnit, this._serverURL);
|
|
110093
110097
|
this._gridOptions = {
|
|
110094
110098
|
localeText: gridTerms,
|
|
110095
110099
|
rowModelType: "serverSide",
|
|
110100
|
+
serverSideStoreType: "partial",
|
|
110096
110101
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
110097
|
-
serverSideDatasource:
|
|
110102
|
+
serverSideDatasource: this._dataSource,
|
|
110098
110103
|
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
110099
110104
|
getMainMenuItems: (params) => {
|
|
110100
110105
|
const column = params.column;
|
|
@@ -110105,10 +110110,13 @@ class AgGridController {
|
|
|
110105
110110
|
}));
|
|
110106
110111
|
return items;
|
|
110107
110112
|
},
|
|
110108
|
-
|
|
110109
|
-
|
|
110110
|
-
|
|
110111
|
-
|
|
110113
|
+
getRowHeight: () => {
|
|
110114
|
+
//FIXME: Existe um bug no PartialStore.prototype.destroyAllBlocks do ag-grid, pois
|
|
110115
|
+
//apesar de destruir os blocos, mantém a variável "blockHeights" com o tamanho antigo
|
|
110116
|
+
//dos blocos, então, quando removemos uma linha, a altura do bloco não é recalculada.
|
|
110117
|
+
//Descobri que setando manualmente a altura das linhas, apesar do bloco ficar com
|
|
110118
|
+
//tamanho errado, isso afeta menos o componente.
|
|
110119
|
+
return 25;
|
|
110112
110120
|
}
|
|
110113
110121
|
};
|
|
110114
110122
|
this.setOptionsEvents(this._gridOptions);
|
|
@@ -110131,6 +110139,11 @@ class AgGridController {
|
|
|
110131
110139
|
opt.onSelectionChanged = e => this.onSelectionChange(e);
|
|
110132
110140
|
opt.onPaginationChanged = () => this.onPaginationChange();
|
|
110133
110141
|
opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
|
|
110142
|
+
opt.onViewportChanged = () => {
|
|
110143
|
+
if (this._dataUnit) {
|
|
110144
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
110145
|
+
}
|
|
110146
|
+
};
|
|
110134
110147
|
}
|
|
110135
110148
|
setOptionsPagination(opt) {
|
|
110136
110149
|
opt.pagination = (this._pageSize > -1);
|
|
@@ -110148,11 +110161,11 @@ class AgGridController {
|
|
|
110148
110161
|
}
|
|
110149
110162
|
this._gridOptions.api.setRowData(data);
|
|
110150
110163
|
}
|
|
110151
|
-
addRows(
|
|
110164
|
+
addRows() {
|
|
110152
110165
|
if (this._grid === undefined) {
|
|
110153
110166
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110154
110167
|
}
|
|
110155
|
-
this._gridOptions.api.
|
|
110168
|
+
this._gridOptions.api.refreshServerSideStore({});
|
|
110156
110169
|
}
|
|
110157
110170
|
selectRows(rowIds) {
|
|
110158
110171
|
if (this._grid === undefined) {
|
|
@@ -110167,11 +110180,11 @@ class AgGridController {
|
|
|
110167
110180
|
});
|
|
110168
110181
|
}
|
|
110169
110182
|
}
|
|
110170
|
-
removeRows(
|
|
110183
|
+
removeRows() {
|
|
110171
110184
|
if (this._grid === undefined) {
|
|
110172
110185
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110173
110186
|
}
|
|
110174
|
-
this._gridOptions.api.
|
|
110187
|
+
this._gridOptions.api.refreshServerSideStore({});
|
|
110175
110188
|
}
|
|
110176
110189
|
changeValues(changes, rowIds) {
|
|
110177
110190
|
if (this._grid === undefined) {
|
|
@@ -110288,6 +110301,14 @@ class AgGridController {
|
|
|
110288
110301
|
previousPage() {
|
|
110289
110302
|
this._gridOptions.api.paginationGoToPreviousPage();
|
|
110290
110303
|
}
|
|
110304
|
+
goToPage(page) {
|
|
110305
|
+
this._gridOptions.api.paginationGoToPage(page);
|
|
110306
|
+
}
|
|
110307
|
+
quickFilter(term) {
|
|
110308
|
+
this._dataSource.setQuickFilter(term);
|
|
110309
|
+
this.goToPage(0);
|
|
110310
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
110311
|
+
}
|
|
110291
110312
|
buildColDef(source) {
|
|
110292
110313
|
return {
|
|
110293
110314
|
headerName: source.label,
|
|
@@ -110501,6 +110522,18 @@ let EzGrid = class {
|
|
|
110501
110522
|
async getColumns() {
|
|
110502
110523
|
return Promise.resolve(this._gridController.getColumnsDef());
|
|
110503
110524
|
}
|
|
110525
|
+
/**
|
|
110526
|
+
* Método para recarregar pagina atual da grid.
|
|
110527
|
+
*/
|
|
110528
|
+
async refresh() {
|
|
110529
|
+
this._gridController.refresh();
|
|
110530
|
+
}
|
|
110531
|
+
/**
|
|
110532
|
+
* Método para fazer um filtro rápido na grid.
|
|
110533
|
+
*/
|
|
110534
|
+
async quickFilter(term) {
|
|
110535
|
+
this._gridController.quickFilter(term);
|
|
110536
|
+
}
|
|
110504
110537
|
componentWillLoad() {
|
|
110505
110538
|
if (this.dataUnit) {
|
|
110506
110539
|
this._dataUnitBridge = new DataUnitBridge(this._gridController, this.dataUnit);
|
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"],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[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]}]]],["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-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-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]}]]],["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-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["test-du.cjs",[[0,"test-du"]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["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],"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-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":[516],"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"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]]], options);
|
|
18
|
+
return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"refresh":[64],"quickFilter":[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]}]]],["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-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-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]}]]],["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-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["test-du.cjs",[[0,"test-du"]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["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],"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-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":[516],"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"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]]], options);
|
|
19
19
|
});
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[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]}]]],["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-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-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]}]]],["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-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["test-du.cjs",[[0,"test-du"]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["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],"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-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":[516],"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"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"refresh":[64],"quickFilter":[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]}]]],["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-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-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]}]]],["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-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["test-du.cjs",[[0,"test-du"]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["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],"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-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":[516],"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"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -57,16 +57,20 @@ let TestDu = class {
|
|
|
57
57
|
}
|
|
58
58
|
]
|
|
59
59
|
};
|
|
60
|
-
this.dataUnit.dataLoader = () => new Promise(accept => accept(
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
this.dataUnit.dataLoader = () => new Promise(accept => accept({
|
|
61
|
+
records: [{
|
|
62
|
+
__record__id__: "1321321321321321",
|
|
63
|
+
CODPARC: 10,
|
|
64
|
+
NOMEPARC: "Parceiro 10",
|
|
65
|
+
P: "M",
|
|
66
|
+
L: "Bagaço",
|
|
67
|
+
LI: "Azedo"
|
|
68
|
+
}],
|
|
69
|
+
limit: 0,
|
|
70
|
+
offset: 2,
|
|
71
|
+
total: 100,
|
|
72
|
+
hasMore: true
|
|
73
|
+
}));
|
|
70
74
|
}
|
|
71
75
|
render() {
|
|
72
76
|
return (index.h("ez-form", { dataUnit: this.dataUnit }));
|
|
@@ -37,11 +37,13 @@ export default class AgGridController {
|
|
|
37
37
|
this._serverURL = options.serverURL;
|
|
38
38
|
this._dataUnit = options.dataUnit;
|
|
39
39
|
this._dataUnit.sortingProvider = this;
|
|
40
|
+
this._dataSource = new DataSource(this._dataUnit, this._serverURL);
|
|
40
41
|
this._gridOptions = {
|
|
41
42
|
localeText: gridTerms,
|
|
42
43
|
rowModelType: "serverSide",
|
|
44
|
+
serverSideStoreType: "partial",
|
|
43
45
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
44
|
-
serverSideDatasource:
|
|
46
|
+
serverSideDatasource: this._dataSource,
|
|
45
47
|
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
46
48
|
getMainMenuItems: (params) => {
|
|
47
49
|
const column = params.column;
|
|
@@ -52,10 +54,13 @@ export default class AgGridController {
|
|
|
52
54
|
}));
|
|
53
55
|
return items;
|
|
54
56
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
getRowHeight: () => {
|
|
58
|
+
//FIXME: Existe um bug no PartialStore.prototype.destroyAllBlocks do ag-grid, pois
|
|
59
|
+
//apesar de destruir os blocos, mantém a variável "blockHeights" com o tamanho antigo
|
|
60
|
+
//dos blocos, então, quando removemos uma linha, a altura do bloco não é recalculada.
|
|
61
|
+
//Descobri que setando manualmente a altura das linhas, apesar do bloco ficar com
|
|
62
|
+
//tamanho errado, isso afeta menos o componente.
|
|
63
|
+
return 25;
|
|
59
64
|
}
|
|
60
65
|
};
|
|
61
66
|
this.setOptionsEvents(this._gridOptions);
|
|
@@ -78,6 +83,11 @@ export default class AgGridController {
|
|
|
78
83
|
opt.onSelectionChanged = e => this.onSelectionChange(e);
|
|
79
84
|
opt.onPaginationChanged = () => this.onPaginationChange();
|
|
80
85
|
opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
|
|
86
|
+
opt.onViewportChanged = () => {
|
|
87
|
+
if (this._dataUnit) {
|
|
88
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
89
|
+
}
|
|
90
|
+
};
|
|
81
91
|
}
|
|
82
92
|
setOptionsPagination(opt) {
|
|
83
93
|
opt.pagination = (this._pageSize > -1);
|
|
@@ -95,11 +105,11 @@ export default class AgGridController {
|
|
|
95
105
|
}
|
|
96
106
|
this._gridOptions.api.setRowData(data);
|
|
97
107
|
}
|
|
98
|
-
addRows(
|
|
108
|
+
addRows() {
|
|
99
109
|
if (this._grid === undefined) {
|
|
100
110
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
101
111
|
}
|
|
102
|
-
this._gridOptions.api.
|
|
112
|
+
this._gridOptions.api.refreshServerSideStore({});
|
|
103
113
|
}
|
|
104
114
|
selectRows(rowIds) {
|
|
105
115
|
if (this._grid === undefined) {
|
|
@@ -114,11 +124,11 @@ export default class AgGridController {
|
|
|
114
124
|
});
|
|
115
125
|
}
|
|
116
126
|
}
|
|
117
|
-
removeRows(
|
|
127
|
+
removeRows() {
|
|
118
128
|
if (this._grid === undefined) {
|
|
119
129
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
120
130
|
}
|
|
121
|
-
this._gridOptions.api.
|
|
131
|
+
this._gridOptions.api.refreshServerSideStore({});
|
|
122
132
|
}
|
|
123
133
|
changeValues(changes, rowIds) {
|
|
124
134
|
if (this._grid === undefined) {
|
|
@@ -235,6 +245,14 @@ export default class AgGridController {
|
|
|
235
245
|
previousPage() {
|
|
236
246
|
this._gridOptions.api.paginationGoToPreviousPage();
|
|
237
247
|
}
|
|
248
|
+
goToPage(page) {
|
|
249
|
+
this._gridOptions.api.paginationGoToPage(page);
|
|
250
|
+
}
|
|
251
|
+
quickFilter(term) {
|
|
252
|
+
this._dataSource.setQuickFilter(term);
|
|
253
|
+
this.goToPage(0);
|
|
254
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
255
|
+
}
|
|
238
256
|
buildColDef(source) {
|
|
239
257
|
return {
|
|
240
258
|
headerName: source.label,
|
|
@@ -19,15 +19,15 @@ export default class DataSource {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
|
-
this.loadData()
|
|
22
|
+
this.loadData({ limit: params.api.paginationGetPageSize(), offset: params.request.startRow, quickFilter: this._quickFilterTerm })
|
|
23
23
|
.then(data => params.success(data))
|
|
24
24
|
.catch(() => params.fail());
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
loadData() {
|
|
27
|
+
loadData(page) {
|
|
28
28
|
return new Promise((resolve, reject) => {
|
|
29
29
|
if (this._dataUnit) {
|
|
30
|
-
this._dataUnit.loadData().then(
|
|
30
|
+
this._dataUnit.loadData(page).then(pageRes => resolve({ rowData: this._dataUnit.records, rowCount: pageRes.total }));
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
33
|
fetch(this._serverURL)
|
|
@@ -38,4 +38,7 @@ export default class DataSource {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
+
setQuickFilter(term) {
|
|
42
|
+
this._quickFilterTerm = term;
|
|
43
|
+
}
|
|
41
44
|
}
|
|
@@ -54,6 +54,18 @@ export class EzGrid {
|
|
|
54
54
|
async getColumns() {
|
|
55
55
|
return Promise.resolve(this._gridController.getColumnsDef());
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Método para recarregar pagina atual da grid.
|
|
59
|
+
*/
|
|
60
|
+
async refresh() {
|
|
61
|
+
this._gridController.refresh();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Método para fazer um filtro rápido na grid.
|
|
65
|
+
*/
|
|
66
|
+
async quickFilter(term) {
|
|
67
|
+
this._gridController.quickFilter(term);
|
|
68
|
+
}
|
|
57
69
|
componentWillLoad() {
|
|
58
70
|
if (this.dataUnit) {
|
|
59
71
|
this._dataUnitBridge = new DataUnitBridge(this._gridController, this.dataUnit);
|
|
@@ -433,6 +445,41 @@ export class EzGrid {
|
|
|
433
445
|
"text": "M\u00E9todo retornar o estado atual das colunas do grid.",
|
|
434
446
|
"tags": []
|
|
435
447
|
}
|
|
448
|
+
},
|
|
449
|
+
"refresh": {
|
|
450
|
+
"complexType": {
|
|
451
|
+
"signature": "() => Promise<any>",
|
|
452
|
+
"parameters": [],
|
|
453
|
+
"references": {
|
|
454
|
+
"Promise": {
|
|
455
|
+
"location": "global"
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
"return": "Promise<any>"
|
|
459
|
+
},
|
|
460
|
+
"docs": {
|
|
461
|
+
"text": "M\u00E9todo para recarregar pagina atual da grid.",
|
|
462
|
+
"tags": []
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
"quickFilter": {
|
|
466
|
+
"complexType": {
|
|
467
|
+
"signature": "(term: string) => Promise<any>",
|
|
468
|
+
"parameters": [{
|
|
469
|
+
"tags": [],
|
|
470
|
+
"text": ""
|
|
471
|
+
}],
|
|
472
|
+
"references": {
|
|
473
|
+
"Promise": {
|
|
474
|
+
"location": "global"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"return": "Promise<any>"
|
|
478
|
+
},
|
|
479
|
+
"docs": {
|
|
480
|
+
"text": "M\u00E9todo para fazer um filtro r\u00E1pido na grid.",
|
|
481
|
+
"tags": []
|
|
482
|
+
}
|
|
436
483
|
}
|
|
437
484
|
}; }
|
|
438
485
|
}
|
|
@@ -47,16 +47,20 @@ export class TestDu {
|
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
49
|
};
|
|
50
|
-
this.dataUnit.dataLoader = () => new Promise(accept => accept(
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
this.dataUnit.dataLoader = () => new Promise(accept => accept({
|
|
51
|
+
records: [{
|
|
52
|
+
__record__id__: "1321321321321321",
|
|
53
|
+
CODPARC: 10,
|
|
54
|
+
NOMEPARC: "Parceiro 10",
|
|
55
|
+
P: "M",
|
|
56
|
+
L: "Bagaço",
|
|
57
|
+
LI: "Azedo"
|
|
58
|
+
}],
|
|
59
|
+
limit: 0,
|
|
60
|
+
offset: 2,
|
|
61
|
+
total: 100,
|
|
62
|
+
hasMore: true
|
|
63
|
+
}));
|
|
60
64
|
}
|
|
61
65
|
render() {
|
|
62
66
|
return (h("ez-form", { dataUnit: this.dataUnit }));
|
|
@@ -111978,15 +111978,15 @@ class DataSource {
|
|
|
111978
111978
|
}
|
|
111979
111979
|
}
|
|
111980
111980
|
else {
|
|
111981
|
-
this.loadData()
|
|
111981
|
+
this.loadData({ limit: params.api.paginationGetPageSize(), offset: params.request.startRow, quickFilter: this._quickFilterTerm })
|
|
111982
111982
|
.then(data => params.success(data))
|
|
111983
111983
|
.catch(() => params.fail());
|
|
111984
111984
|
}
|
|
111985
111985
|
}
|
|
111986
|
-
loadData() {
|
|
111986
|
+
loadData(page) {
|
|
111987
111987
|
return new Promise((resolve, reject) => {
|
|
111988
111988
|
if (this._dataUnit) {
|
|
111989
|
-
this._dataUnit.loadData().then(
|
|
111989
|
+
this._dataUnit.loadData(page).then(pageRes => resolve({ rowData: this._dataUnit.records, rowCount: pageRes.total }));
|
|
111990
111990
|
}
|
|
111991
111991
|
else {
|
|
111992
111992
|
fetch(this._serverURL)
|
|
@@ -111997,6 +111997,9 @@ class DataSource {
|
|
|
111997
111997
|
}
|
|
111998
111998
|
});
|
|
111999
111999
|
}
|
|
112000
|
+
setQuickFilter(term) {
|
|
112001
|
+
this._quickFilterTerm = term;
|
|
112002
|
+
}
|
|
112000
112003
|
}
|
|
112001
112004
|
|
|
112002
112005
|
class AgGridController {
|
|
@@ -112031,11 +112034,13 @@ class AgGridController {
|
|
|
112031
112034
|
this._serverURL = options.serverURL;
|
|
112032
112035
|
this._dataUnit = options.dataUnit;
|
|
112033
112036
|
this._dataUnit.sortingProvider = this;
|
|
112037
|
+
this._dataSource = new DataSource(this._dataUnit, this._serverURL);
|
|
112034
112038
|
this._gridOptions = {
|
|
112035
112039
|
localeText: gridTerms,
|
|
112036
112040
|
rowModelType: "serverSide",
|
|
112041
|
+
serverSideStoreType: "partial",
|
|
112037
112042
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
112038
|
-
serverSideDatasource:
|
|
112043
|
+
serverSideDatasource: this._dataSource,
|
|
112039
112044
|
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
112040
112045
|
getMainMenuItems: (params) => {
|
|
112041
112046
|
const column = params.column;
|
|
@@ -112046,10 +112051,13 @@ class AgGridController {
|
|
|
112046
112051
|
}));
|
|
112047
112052
|
return items;
|
|
112048
112053
|
},
|
|
112049
|
-
|
|
112050
|
-
|
|
112051
|
-
|
|
112052
|
-
|
|
112054
|
+
getRowHeight: () => {
|
|
112055
|
+
//FIXME: Existe um bug no PartialStore.prototype.destroyAllBlocks do ag-grid, pois
|
|
112056
|
+
//apesar de destruir os blocos, mantém a variável "blockHeights" com o tamanho antigo
|
|
112057
|
+
//dos blocos, então, quando removemos uma linha, a altura do bloco não é recalculada.
|
|
112058
|
+
//Descobri que setando manualmente a altura das linhas, apesar do bloco ficar com
|
|
112059
|
+
//tamanho errado, isso afeta menos o componente.
|
|
112060
|
+
return 25;
|
|
112053
112061
|
}
|
|
112054
112062
|
};
|
|
112055
112063
|
this.setOptionsEvents(this._gridOptions);
|
|
@@ -112072,6 +112080,11 @@ class AgGridController {
|
|
|
112072
112080
|
opt.onSelectionChanged = e => this.onSelectionChange(e);
|
|
112073
112081
|
opt.onPaginationChanged = () => this.onPaginationChange();
|
|
112074
112082
|
opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
|
|
112083
|
+
opt.onViewportChanged = () => {
|
|
112084
|
+
if (this._dataUnit) {
|
|
112085
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
112086
|
+
}
|
|
112087
|
+
};
|
|
112075
112088
|
}
|
|
112076
112089
|
setOptionsPagination(opt) {
|
|
112077
112090
|
opt.pagination = (this._pageSize > -1);
|
|
@@ -112089,11 +112102,11 @@ class AgGridController {
|
|
|
112089
112102
|
}
|
|
112090
112103
|
this._gridOptions.api.setRowData(data);
|
|
112091
112104
|
}
|
|
112092
|
-
addRows(
|
|
112105
|
+
addRows() {
|
|
112093
112106
|
if (this._grid === undefined) {
|
|
112094
112107
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112095
112108
|
}
|
|
112096
|
-
this._gridOptions.api.
|
|
112109
|
+
this._gridOptions.api.refreshServerSideStore({});
|
|
112097
112110
|
}
|
|
112098
112111
|
selectRows(rowIds) {
|
|
112099
112112
|
if (this._grid === undefined) {
|
|
@@ -112108,11 +112121,11 @@ class AgGridController {
|
|
|
112108
112121
|
});
|
|
112109
112122
|
}
|
|
112110
112123
|
}
|
|
112111
|
-
removeRows(
|
|
112124
|
+
removeRows() {
|
|
112112
112125
|
if (this._grid === undefined) {
|
|
112113
112126
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112114
112127
|
}
|
|
112115
|
-
this._gridOptions.api.
|
|
112128
|
+
this._gridOptions.api.refreshServerSideStore({});
|
|
112116
112129
|
}
|
|
112117
112130
|
changeValues(changes, rowIds) {
|
|
112118
112131
|
if (this._grid === undefined) {
|
|
@@ -112229,6 +112242,14 @@ class AgGridController {
|
|
|
112229
112242
|
previousPage() {
|
|
112230
112243
|
this._gridOptions.api.paginationGoToPreviousPage();
|
|
112231
112244
|
}
|
|
112245
|
+
goToPage(page) {
|
|
112246
|
+
this._gridOptions.api.paginationGoToPage(page);
|
|
112247
|
+
}
|
|
112248
|
+
quickFilter(term) {
|
|
112249
|
+
this._dataSource.setQuickFilter(term);
|
|
112250
|
+
this.goToPage(0);
|
|
112251
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
112252
|
+
}
|
|
112232
112253
|
buildColDef(source) {
|
|
112233
112254
|
return {
|
|
112234
112255
|
headerName: source.label,
|
|
@@ -112443,6 +112464,18 @@ let EzGrid$1 = class extends HTMLElement$1 {
|
|
|
112443
112464
|
async getColumns() {
|
|
112444
112465
|
return Promise.resolve(this._gridController.getColumnsDef());
|
|
112445
112466
|
}
|
|
112467
|
+
/**
|
|
112468
|
+
* Método para recarregar pagina atual da grid.
|
|
112469
|
+
*/
|
|
112470
|
+
async refresh() {
|
|
112471
|
+
this._gridController.refresh();
|
|
112472
|
+
}
|
|
112473
|
+
/**
|
|
112474
|
+
* Método para fazer um filtro rápido na grid.
|
|
112475
|
+
*/
|
|
112476
|
+
async quickFilter(term) {
|
|
112477
|
+
this._gridController.quickFilter(term);
|
|
112478
|
+
}
|
|
112446
112479
|
componentWillLoad() {
|
|
112447
112480
|
if (this.dataUnit) {
|
|
112448
112481
|
this._dataUnitBridge = new DataUnitBridge(this._gridController, this.dataUnit);
|
|
@@ -114923,16 +114956,20 @@ let TestDu$1 = class extends HTMLElement$1 {
|
|
|
114923
114956
|
}
|
|
114924
114957
|
]
|
|
114925
114958
|
};
|
|
114926
|
-
this.dataUnit.dataLoader = () => new Promise(accept => accept(
|
|
114927
|
-
{
|
|
114928
|
-
|
|
114929
|
-
|
|
114930
|
-
|
|
114931
|
-
|
|
114932
|
-
|
|
114933
|
-
|
|
114934
|
-
|
|
114935
|
-
|
|
114959
|
+
this.dataUnit.dataLoader = () => new Promise(accept => accept({
|
|
114960
|
+
records: [{
|
|
114961
|
+
__record__id__: "1321321321321321",
|
|
114962
|
+
CODPARC: 10,
|
|
114963
|
+
NOMEPARC: "Parceiro 10",
|
|
114964
|
+
P: "M",
|
|
114965
|
+
L: "Bagaço",
|
|
114966
|
+
LI: "Azedo"
|
|
114967
|
+
}],
|
|
114968
|
+
limit: 0,
|
|
114969
|
+
offset: 2,
|
|
114970
|
+
total: 100,
|
|
114971
|
+
hasMore: true
|
|
114972
|
+
}));
|
|
114936
114973
|
}
|
|
114937
114974
|
render() {
|
|
114938
114975
|
return (h("ez-form", { dataUnit: this.dataUnit }));
|