@sankhyalabs/ezui 4.1.0 → 4.2.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/{constants-5a75e2f3.js → constants-5d588e38.js} +2 -0
- package/dist/cjs/ez-check.cjs.entry.js +12 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +64 -36
- package/dist/cjs/ez-grid.cjs.entry.js +243 -111
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-check/ez-check.js +14 -1
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +16 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +72 -15
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +9 -1
- package/dist/collection/components/ez-grid/ez-grid.js +163 -94
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +2 -2
- package/dist/collection/utils/constants.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +47 -30
- package/dist/collection/utils/form/FormMetadata.js +17 -6
- package/dist/custom-elements/index.js +321 -150
- package/dist/esm/constants-76d2e931.js +4 -0
- package/dist/esm/ez-check.entry.js +12 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +64 -36
- package/dist/esm/ez-grid.entry.js +243 -111
- 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-1f841f3c.entry.js +1 -0
- package/dist/ezui/{p-468799e1.entry.js → p-8105c967.entry.js} +2 -2
- package/dist/ezui/{p-50883460.entry.js → p-878646a0.entry.js} +1 -1
- package/dist/ezui/p-a3ce3710.entry.js +1 -0
- package/dist/ezui/p-b01e3085.js +1 -0
- package/dist/ezui/{p-e748b5d3.entry.js → p-b7ea9791.entry.js} +1 -1
- package/dist/types/components/ez-check/ez-check.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +10 -2
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -2
- package/dist/types/components/ez-grid/ez-grid.d.ts +20 -15
- package/dist/types/components/ez-grid/subcomponents/selection-counter.d.ts +2 -1
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -2
- package/package.json +1 -1
- package/dist/esm/constants-ca136201.js +0 -3
- package/dist/ezui/p-08f4a048.entry.js +0 -1
- package/dist/ezui/p-3f4ae3a3.js +0 -1
- package/dist/ezui/p-a323b415.entry.js +0 -1
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-892780f1.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
+
const constants = require('./constants-5d588e38.js');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1
|
|
@@ -118941,6 +118942,7 @@ class DataSource {
|
|
|
118941
118942
|
this._controller.refresh();
|
|
118942
118943
|
break;
|
|
118943
118944
|
case core.Action.SELECTION_CHANGED:
|
|
118945
|
+
case core.Action.SELECTION_REMOVED:
|
|
118944
118946
|
case core.Action.NEXT_SELECTED:
|
|
118945
118947
|
case core.Action.PREVIOUS_SELECTED:
|
|
118946
118948
|
this.updateSelection();
|
|
@@ -118954,7 +118956,14 @@ class DataSource {
|
|
|
118954
118956
|
this._dataUnit.subscribe(this.duObserver);
|
|
118955
118957
|
}
|
|
118956
118958
|
updateSelection() {
|
|
118957
|
-
|
|
118959
|
+
var _a;
|
|
118960
|
+
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
|
|
118961
|
+
if ((selection === null || selection === void 0 ? void 0 : selection.length) > 0) {
|
|
118962
|
+
this._controller.selectRows(selection);
|
|
118963
|
+
}
|
|
118964
|
+
else {
|
|
118965
|
+
this._controller.deselectAll();
|
|
118966
|
+
}
|
|
118958
118967
|
}
|
|
118959
118968
|
getRows(params) {
|
|
118960
118969
|
if (this.needReload(params)) {
|
|
@@ -119156,7 +119165,7 @@ class AgGridController {
|
|
|
119156
119165
|
else {
|
|
119157
119166
|
this._grid = new Grid(container, this._gridOptions);
|
|
119158
119167
|
}
|
|
119159
|
-
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.
|
|
119168
|
+
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
|
|
119160
119169
|
if (selection) {
|
|
119161
119170
|
this.selectRows(selection);
|
|
119162
119171
|
}
|
|
@@ -119230,30 +119239,72 @@ class AgGridController {
|
|
|
119230
119239
|
opt.suppressDragLeaveHidesColumns = true;
|
|
119231
119240
|
opt.suppressMenuHide = true;
|
|
119232
119241
|
}
|
|
119242
|
+
isAllRecordSetted(allSelection) {
|
|
119243
|
+
return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
|
|
119244
|
+
return selectedRecord.__record__id__ === constants.ALL_RECORD;
|
|
119245
|
+
});
|
|
119246
|
+
}
|
|
119233
119247
|
getSelectionHeaderStatus() {
|
|
119234
119248
|
const records = this._dataUnit.records;
|
|
119235
119249
|
if (records && records.length === 0) {
|
|
119236
119250
|
return false;
|
|
119237
119251
|
}
|
|
119238
|
-
const
|
|
119239
|
-
if (
|
|
119252
|
+
const allSelection = this._dataUnit.getAllSelection();
|
|
119253
|
+
if (allSelection == undefined || allSelection.length === 0) {
|
|
119240
119254
|
return false;
|
|
119241
119255
|
}
|
|
119242
|
-
if (
|
|
119256
|
+
if (this.isAllRecordSetted(allSelection)) {
|
|
119257
|
+
return true;
|
|
119258
|
+
}
|
|
119259
|
+
if (allSelection.length != records.length) {
|
|
119260
|
+
return undefined;
|
|
119261
|
+
}
|
|
119262
|
+
const selectedRecords = this._dataUnit.getSelectedRecords();
|
|
119263
|
+
if (selectedRecords.length < allSelection.length) {
|
|
119243
119264
|
return undefined;
|
|
119244
119265
|
}
|
|
119245
119266
|
let status = undefined;
|
|
119246
119267
|
for (let i = 0; i < records.length; i++) {
|
|
119247
|
-
const current =
|
|
119268
|
+
const current = allSelection.some((selectedRecord) => {
|
|
119269
|
+
return selectedRecord.__record__id__ === records[i].__record__id__;
|
|
119270
|
+
});
|
|
119248
119271
|
if (status != undefined && current !== status) {
|
|
119249
|
-
return
|
|
119272
|
+
return;
|
|
119250
119273
|
}
|
|
119251
119274
|
status = current;
|
|
119252
119275
|
}
|
|
119253
119276
|
return status;
|
|
119254
119277
|
}
|
|
119255
|
-
updateSelectionForAll(selectAll) {
|
|
119256
|
-
|
|
119278
|
+
async updateSelectionForAll(selectAll) {
|
|
119279
|
+
if (this._dataUnit == undefined) {
|
|
119280
|
+
return;
|
|
119281
|
+
}
|
|
119282
|
+
let allSelection = this._dataUnit.getAllSelection();
|
|
119283
|
+
if (allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((sel) => sel.__record__id__ === constants.ALL_RECORD)) {
|
|
119284
|
+
await this._dataUnit.clearSelection();
|
|
119285
|
+
}
|
|
119286
|
+
let updateSelection = [];
|
|
119287
|
+
const records = this._dataUnit.records;
|
|
119288
|
+
const selectedRecords = this._dataUnit.getSelectedRecords();
|
|
119289
|
+
allSelection = this._dataUnit.getAllSelection();
|
|
119290
|
+
if (selectAll && selectedRecords.length < records.length) {
|
|
119291
|
+
updateSelection = records;
|
|
119292
|
+
allSelection.forEach((selectedRecord) => {
|
|
119293
|
+
const recordIds = updateSelection.map((record) => record.__record__id__);
|
|
119294
|
+
if (!recordIds.includes(selectedRecord.__record__id__)) {
|
|
119295
|
+
updateSelection.push(selectedRecord);
|
|
119296
|
+
}
|
|
119297
|
+
});
|
|
119298
|
+
}
|
|
119299
|
+
else {
|
|
119300
|
+
updateSelection = allSelection.filter((selectedRecord) => {
|
|
119301
|
+
return !(records || [])
|
|
119302
|
+
.some((record) => {
|
|
119303
|
+
return record.__record__id__ === selectedRecord.__record__id__;
|
|
119304
|
+
});
|
|
119305
|
+
});
|
|
119306
|
+
}
|
|
119307
|
+
this._dataUnit.setSelection(updateSelection);
|
|
119257
119308
|
}
|
|
119258
119309
|
setData(data) {
|
|
119259
119310
|
if (this._grid === undefined) {
|
|
@@ -119277,7 +119328,7 @@ class AgGridController {
|
|
|
119277
119328
|
}
|
|
119278
119329
|
this._gridOptions.api.forEachNode(node => {
|
|
119279
119330
|
var _a;
|
|
119280
|
-
if (rowIds && rowIds.
|
|
119331
|
+
if (rowIds && rowIds.find(row => row.__record__id__ === node.id)) {
|
|
119281
119332
|
node.setSelected(true);
|
|
119282
119333
|
(_a = this._gridOptions.api) === null || _a === void 0 ? void 0 : _a.ensureNodeVisible(node);
|
|
119283
119334
|
}
|
|
@@ -119285,10 +119336,7 @@ class AgGridController {
|
|
|
119285
119336
|
node.setSelected(false);
|
|
119286
119337
|
}
|
|
119287
119338
|
});
|
|
119288
|
-
|
|
119289
|
-
if (selectionHeader) {
|
|
119290
|
-
selectionHeader.updateCheckbox();
|
|
119291
|
-
}
|
|
119339
|
+
this.updateCheckbox();
|
|
119292
119340
|
}
|
|
119293
119341
|
removeRows() {
|
|
119294
119342
|
if (this._grid === undefined) {
|
|
@@ -119383,7 +119431,7 @@ class AgGridController {
|
|
|
119383
119431
|
if (this._grid === undefined) {
|
|
119384
119432
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
119385
119433
|
}
|
|
119386
|
-
const colDef = this._gridOptions.columnApi.
|
|
119434
|
+
const colDef = this._gridOptions.columnApi.getColumns();
|
|
119387
119435
|
return colDef.filter(c => ![this.CHECK_BOX_COL_ID, this.STATUS_COL_ID].includes(c.getColId())).map(c => {
|
|
119388
119436
|
const def = c.getColDef();
|
|
119389
119437
|
const colDef = { name: def.field, label: def.headerName };
|
|
@@ -119401,12 +119449,16 @@ class AgGridController {
|
|
|
119401
119449
|
if (this._grid === undefined) {
|
|
119402
119450
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
119403
119451
|
}
|
|
119452
|
+
const colDef = this._gridOptions.columnApi.getColumns();
|
|
119404
119453
|
let columns = this.getColumnsDef();
|
|
119405
119454
|
let visibleColumns = [];
|
|
119455
|
+
//Existem colunas implícitas que não tem estado, essas colunas são sempre as primeiras.
|
|
119456
|
+
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
119457
|
+
const columnsOffset = colDef.length - columns.length;
|
|
119406
119458
|
let sort = [];
|
|
119407
119459
|
state.forEach((cfgColumn, index) => {
|
|
119408
119460
|
const colWidth = this.getColumnWidth(cfgColumn);
|
|
119409
|
-
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index +
|
|
119461
|
+
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
119410
119462
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
119411
119463
|
visibleColumns.push(cfgColumn.name);
|
|
119412
119464
|
if (cfgColumn.ascending !== undefined) {
|
|
@@ -119467,6 +119519,19 @@ class AgGridController {
|
|
|
119467
119519
|
var _a;
|
|
119468
119520
|
(_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
|
|
119469
119521
|
}
|
|
119522
|
+
deselectAll() {
|
|
119523
|
+
var _a, _b;
|
|
119524
|
+
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.deselectAll();
|
|
119525
|
+
this.updateCheckbox();
|
|
119526
|
+
}
|
|
119527
|
+
updateCheckbox() {
|
|
119528
|
+
var _a, _b;
|
|
119529
|
+
const selectionHeader = (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.selectionHeader;
|
|
119530
|
+
if (selectionHeader == undefined) {
|
|
119531
|
+
return;
|
|
119532
|
+
}
|
|
119533
|
+
selectionHeader.updateCheckbox();
|
|
119534
|
+
}
|
|
119470
119535
|
buildColDef(source) {
|
|
119471
119536
|
var _a, _b, _c;
|
|
119472
119537
|
let tooltip = undefined;
|
|
@@ -119625,8 +119690,8 @@ class AgGridController {
|
|
|
119625
119690
|
}
|
|
119626
119691
|
|
|
119627
119692
|
const SelectionCounter = (props) => {
|
|
119628
|
-
const { selectionCount, total,
|
|
119629
|
-
const pageSelectedRecords =
|
|
119693
|
+
const { selectionCount, selectionPageCount, total, recordsLength, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
119694
|
+
const pageSelectedRecords = selectionPageCount === recordsLength;
|
|
119630
119695
|
const allSelectedRecords = selectionCount === total;
|
|
119631
119696
|
return (index.h("div", Object.assign({ class: "ez-box ez-box--shadow-small" }, getElementID("ezGridSelectionCounter")),
|
|
119632
119697
|
index.h("div", { class: "ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium" },
|
|
@@ -119665,10 +119730,12 @@ const EzGrid = class {
|
|
|
119665
119730
|
this.configChange = index.createEvent(this, "configChange", 7);
|
|
119666
119731
|
this._gridController = new AgGridController(false);
|
|
119667
119732
|
this._debounceTimer = 500;
|
|
119733
|
+
this._selectionAll = false;
|
|
119668
119734
|
this._paginationInfo = undefined;
|
|
119669
119735
|
this._paginationChangedByKeyboard = true;
|
|
119670
|
-
this._selectionCount = 0;
|
|
119671
119736
|
this._showSelectionCounter = false;
|
|
119737
|
+
this._selectionCount = 0;
|
|
119738
|
+
this._selectionPageCount = 0;
|
|
119672
119739
|
this.multipleSelection = undefined;
|
|
119673
119740
|
this.config = undefined;
|
|
119674
119741
|
this.serverUrl = undefined;
|
|
@@ -119723,32 +119790,94 @@ const EzGrid = class {
|
|
|
119723
119790
|
async quickFilter(term) {
|
|
119724
119791
|
this._gridController.quickFilter(term);
|
|
119725
119792
|
}
|
|
119793
|
+
observeConfig(config) {
|
|
119794
|
+
this._gridController.setColumnsState(config.columns);
|
|
119795
|
+
}
|
|
119726
119796
|
onSelectionChange(evt) {
|
|
119727
|
-
|
|
119728
|
-
|
|
119729
|
-
|
|
119797
|
+
const { selection } = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
119798
|
+
if (selection == undefined || this.dataUnit == undefined) {
|
|
119799
|
+
return;
|
|
119800
|
+
}
|
|
119801
|
+
if (this.isAllRecordSetted()) {
|
|
119802
|
+
this.updateSelectionPage(selection);
|
|
119803
|
+
return;
|
|
119804
|
+
}
|
|
119805
|
+
this.setSelection(selection);
|
|
119806
|
+
}
|
|
119807
|
+
updateSelectionPage(selection) {
|
|
119808
|
+
if (this._selectionAll) {
|
|
119809
|
+
this._selectionAll = false;
|
|
119810
|
+
}
|
|
119811
|
+
else {
|
|
119812
|
+
this.dataUnit.clearSelection()
|
|
119813
|
+
.then(() => {
|
|
119814
|
+
const records = this.dataUnit.records;
|
|
119815
|
+
const selectionPage = selection.filter((selectedRecord) => {
|
|
119816
|
+
return records.some((record) => {
|
|
119817
|
+
return record.__record__id__ === selectedRecord.__record__id__;
|
|
119818
|
+
});
|
|
119819
|
+
});
|
|
119820
|
+
this._gridController.selectRows(selectionPage);
|
|
119821
|
+
});
|
|
119822
|
+
}
|
|
119823
|
+
}
|
|
119824
|
+
isAllRecordSetted() {
|
|
119825
|
+
var _a;
|
|
119826
|
+
const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
|
|
119827
|
+
return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
|
|
119828
|
+
return selectedRecord.__record__id__ === constants.ALL_RECORD;
|
|
119829
|
+
});
|
|
119830
|
+
}
|
|
119831
|
+
setSelection(selection) {
|
|
119832
|
+
if ((selection === null || selection === void 0 ? void 0 : selection.length) > 0) {
|
|
119833
|
+
this.dataUnit.setSelection(selection)
|
|
119834
|
+
.then(this.controlSelectionCounter.bind(this));
|
|
119835
|
+
}
|
|
119836
|
+
else {
|
|
119837
|
+
this.dataUnit.clearSelection()
|
|
119838
|
+
.then(this.controlSelectionCounter.bind(this));
|
|
119839
|
+
}
|
|
119840
|
+
}
|
|
119841
|
+
setAutoSelectAll() {
|
|
119842
|
+
var _a, _b, _c, _d;
|
|
119843
|
+
const { total } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
|
|
119844
|
+
if (total == undefined) {
|
|
119845
|
+
return;
|
|
119846
|
+
}
|
|
119847
|
+
this._selectionCount = total;
|
|
119848
|
+
this._selectionAll = true;
|
|
119849
|
+
this._showSelectionCounter = true;
|
|
119850
|
+
(_b = this._gridController) === null || _b === void 0 ? void 0 : _b.selectRows((_d = (_c = this.dataUnit) === null || _c === void 0 ? void 0 : _c.records) !== null && _d !== void 0 ? _d : []);
|
|
119730
119851
|
}
|
|
119731
|
-
|
|
119852
|
+
controlSelectionCounter() {
|
|
119853
|
+
var _a, _b;
|
|
119854
|
+
const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
|
|
119855
|
+
const counter = (_b = allSelection === null || allSelection === void 0 ? void 0 : allSelection.length) !== null && _b !== void 0 ? _b : 0;
|
|
119856
|
+
if (this.isAllRecordSetted()) {
|
|
119857
|
+
this.setAutoSelectAll();
|
|
119858
|
+
return;
|
|
119859
|
+
}
|
|
119732
119860
|
if (!this.multipleSelection || !this.isPaginationActived()) {
|
|
119733
119861
|
this._showSelectionCounter = false;
|
|
119734
119862
|
setTimeout(this.setSelectionCount.bind(this), this._debounceTimer);
|
|
119735
119863
|
return;
|
|
119736
119864
|
}
|
|
119737
|
-
|
|
119738
|
-
|
|
119739
|
-
var _a;
|
|
119740
|
-
const counter = (_a = records === null || records === void 0 ? void 0 : records.length) !== null && _a !== void 0 ? _a : 0;
|
|
119741
|
-
this._showSelectionCounter = counter > 1;
|
|
119742
|
-
if (this._showSelectionCounter) {
|
|
119865
|
+
if (counter > 1) {
|
|
119866
|
+
setTimeout(() => {
|
|
119743
119867
|
this.setSelectionCount(counter);
|
|
119744
|
-
|
|
119745
|
-
|
|
119746
|
-
|
|
119747
|
-
|
|
119748
|
-
|
|
119868
|
+
this._showSelectionCounter = true;
|
|
119869
|
+
}, this._debounceTimer);
|
|
119870
|
+
}
|
|
119871
|
+
else {
|
|
119872
|
+
this._showSelectionCounter = false;
|
|
119873
|
+
setTimeout(this.setSelectionCount.bind(this, counter), this._debounceTimer);
|
|
119874
|
+
}
|
|
119749
119875
|
}
|
|
119750
119876
|
setSelectionCount(value = 0) {
|
|
119877
|
+
var _a, _b;
|
|
119751
119878
|
this._selectionCount = value;
|
|
119879
|
+
const selectPageRecords = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecords();
|
|
119880
|
+
this._selectionPageCount = (_b = selectPageRecords === null || selectPageRecords === void 0 ? void 0 : selectPageRecords.length) !== null && _b !== void 0 ? _b : 0;
|
|
119752
119881
|
}
|
|
119753
119882
|
isPaginationActived() {
|
|
119754
119883
|
var _a;
|
|
@@ -119759,60 +119888,23 @@ const EzGrid = class {
|
|
|
119759
119888
|
return Math.ceil(total / (lastRecord - firstRecord + 1)) > 1;
|
|
119760
119889
|
}
|
|
119761
119890
|
onSelectAllRecords() {
|
|
119762
|
-
|
|
119763
|
-
|
|
119764
|
-
|
|
119765
|
-
|
|
119766
|
-
}
|
|
119767
|
-
this.
|
|
119891
|
+
const allRecord = {
|
|
119892
|
+
__record__id__: constants.ALL_RECORD,
|
|
119893
|
+
filter: this.dataUnit.getFilters(),
|
|
119894
|
+
sort: this.dataUnit.getSort()
|
|
119895
|
+
};
|
|
119896
|
+
this.setSelection([allRecord]);
|
|
119768
119897
|
}
|
|
119769
119898
|
onSelectPageRecords() {
|
|
119770
|
-
this.controlSelectionCount();
|
|
119771
|
-
}
|
|
119772
|
-
onClearSelectedRecords() {
|
|
119773
119899
|
var _a;
|
|
119774
|
-
(_a = this.
|
|
119900
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection().then(() => {
|
|
119901
|
+
var _a, _b, _c;
|
|
119902
|
+
(_a = this._gridController) === null || _a === void 0 ? void 0 : _a.selectRows((_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : []);
|
|
119903
|
+
});
|
|
119775
119904
|
}
|
|
119776
|
-
|
|
119905
|
+
onClearSelectedRecords() {
|
|
119777
119906
|
var _a;
|
|
119778
|
-
this.
|
|
119779
|
-
if (info.isUserChange) {
|
|
119780
|
-
if (type === 'columnMovedEnd' && !info.isElementResize) {
|
|
119781
|
-
let newConfig;
|
|
119782
|
-
if (this.config) {
|
|
119783
|
-
newConfig = { columns: [] };
|
|
119784
|
-
state.forEach(columnState => {
|
|
119785
|
-
let newConfigColumn = this.config.columns.find(column => column.name === columnState.name);
|
|
119786
|
-
if (newConfigColumn) {
|
|
119787
|
-
newConfigColumn.width = columnState.width;
|
|
119788
|
-
newConfig.columns.push(newConfigColumn);
|
|
119789
|
-
}
|
|
119790
|
-
});
|
|
119791
|
-
}
|
|
119792
|
-
else {
|
|
119793
|
-
newConfig = this.createConfigFromState(state);
|
|
119794
|
-
}
|
|
119795
|
-
if (newConfig.columns.length > 0) {
|
|
119796
|
-
this.configChange.emit(newConfig);
|
|
119797
|
-
}
|
|
119798
|
-
}
|
|
119799
|
-
else if (type === 'columnResize') {
|
|
119800
|
-
if ((_a = info.column) === null || _a === void 0 ? void 0 : _a.colId) {
|
|
119801
|
-
let newConfig;
|
|
119802
|
-
if (this.config) {
|
|
119803
|
-
newConfig = Object.assign({}, this.config);
|
|
119804
|
-
}
|
|
119805
|
-
else {
|
|
119806
|
-
newConfig = this.createConfigFromState(state);
|
|
119807
|
-
}
|
|
119808
|
-
let newColumn = newConfig.columns.find(column => column.name === info.column.colId);
|
|
119809
|
-
if (newColumn) {
|
|
119810
|
-
newColumn.customWidth = info.column.actualWidth;
|
|
119811
|
-
this.configChange.emit(newConfig);
|
|
119812
|
-
}
|
|
119813
|
-
}
|
|
119814
|
-
}
|
|
119815
|
-
}
|
|
119907
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
|
|
119816
119908
|
}
|
|
119817
119909
|
createConfigFromState(state) {
|
|
119818
119910
|
let newConfig = { columns: [] };
|
|
@@ -119878,34 +119970,46 @@ const EzGrid = class {
|
|
|
119878
119970
|
this._resizeObserver.observe(this._element);
|
|
119879
119971
|
this.resizeSelectionCounter();
|
|
119880
119972
|
}
|
|
119881
|
-
|
|
119882
|
-
|
|
119883
|
-
|
|
119884
|
-
|
|
119885
|
-
|
|
119886
|
-
|
|
119887
|
-
if (
|
|
119888
|
-
|
|
119973
|
+
onColumnStateChange(type, state, info) {
|
|
119974
|
+
var _a;
|
|
119975
|
+
this.ezColumnStateChange.emit({ type, state, isUserChange: info.isUserChange });
|
|
119976
|
+
if (info.isUserChange) {
|
|
119977
|
+
if (type === 'columnMovedEnd' && !info.isElementResize) {
|
|
119978
|
+
let newConfig;
|
|
119979
|
+
if (this.config) {
|
|
119980
|
+
newConfig = { columns: [] };
|
|
119981
|
+
state.forEach(columnState => {
|
|
119982
|
+
let newConfigColumn = this.config.columns.find(column => column.name === columnState.name);
|
|
119983
|
+
if (newConfigColumn) {
|
|
119984
|
+
newConfigColumn.width = columnState.width;
|
|
119985
|
+
newConfig.columns.push(newConfigColumn);
|
|
119986
|
+
}
|
|
119987
|
+
});
|
|
119889
119988
|
}
|
|
119890
119989
|
else {
|
|
119891
|
-
this.
|
|
119892
|
-
this._paginationChangedByKeyboard = true;
|
|
119990
|
+
newConfig = this.createConfigFromState(state);
|
|
119893
119991
|
}
|
|
119894
|
-
|
|
119895
|
-
|
|
119896
|
-
|
|
119897
|
-
|
|
119898
|
-
|
|
119899
|
-
|
|
119900
|
-
|
|
119901
|
-
|
|
119902
|
-
|
|
119903
|
-
|
|
119904
|
-
|
|
119905
|
-
|
|
119992
|
+
if (newConfig.columns.length > 0) {
|
|
119993
|
+
this.configChange.emit(newConfig);
|
|
119994
|
+
}
|
|
119995
|
+
}
|
|
119996
|
+
else if (type === 'columnResize') {
|
|
119997
|
+
if ((_a = info.column) === null || _a === void 0 ? void 0 : _a.colId) {
|
|
119998
|
+
let newConfig;
|
|
119999
|
+
if (this.config) {
|
|
120000
|
+
newConfig = Object.assign({}, this.config);
|
|
120001
|
+
}
|
|
120002
|
+
else {
|
|
120003
|
+
newConfig = this.createConfigFromState(state);
|
|
120004
|
+
}
|
|
120005
|
+
let newColumn = newConfig.columns.find(column => column.name === info.column.colId);
|
|
120006
|
+
if (newColumn) {
|
|
120007
|
+
newColumn.customWidth = info.column.actualWidth;
|
|
120008
|
+
this.configChange.emit(newConfig);
|
|
120009
|
+
}
|
|
120010
|
+
}
|
|
120011
|
+
}
|
|
119906
120012
|
}
|
|
119907
|
-
this.buildDataElementId();
|
|
119908
|
-
this.setEvents();
|
|
119909
120013
|
}
|
|
119910
120014
|
buildDataElementId() {
|
|
119911
120015
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
@@ -119936,17 +120040,45 @@ const EzGrid = class {
|
|
|
119936
120040
|
}
|
|
119937
120041
|
return null;
|
|
119938
120042
|
}
|
|
119939
|
-
|
|
119940
|
-
this._gridController.
|
|
120043
|
+
componentDidLoad() {
|
|
120044
|
+
this._gridController.initDatagrid(this._container, {
|
|
120045
|
+
onColumnStateChange: (type, state, info) => this.onColumnStateChange(type, state, info),
|
|
120046
|
+
onSelectionChange: (selection) => this.ezSelectionChange.emit(selection),
|
|
120047
|
+
onPaginationChange: (paginationInfo) => {
|
|
120048
|
+
var _a;
|
|
120049
|
+
if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
|
|
120050
|
+
this._gridController.setFocusLastRow();
|
|
120051
|
+
}
|
|
120052
|
+
else {
|
|
120053
|
+
this._gridController.setFocusFirstRow();
|
|
120054
|
+
this._paginationChangedByKeyboard = true;
|
|
120055
|
+
}
|
|
120056
|
+
this._paginationInfo = paginationInfo;
|
|
120057
|
+
this._gridController.updateCheckbox();
|
|
120058
|
+
this.controlSelectionCounter();
|
|
120059
|
+
},
|
|
120060
|
+
onDoubleClick: (row) => {
|
|
120061
|
+
this.ezDoubleClick.emit(row);
|
|
120062
|
+
},
|
|
120063
|
+
allowMultipleSelection: this.multipleSelection,
|
|
120064
|
+
serverURL: this.serverUrl,
|
|
120065
|
+
dataUnit: this.dataUnit,
|
|
120066
|
+
statusResolver: this.statusResolver
|
|
120067
|
+
});
|
|
120068
|
+
if (this.config) {
|
|
120069
|
+
this.observeConfig(this.config);
|
|
120070
|
+
}
|
|
120071
|
+
this.buildDataElementId();
|
|
120072
|
+
this.setEvents();
|
|
119941
120073
|
}
|
|
119942
120074
|
componentWillRender() {
|
|
119943
120075
|
this.configSelectionCounter();
|
|
119944
120076
|
}
|
|
119945
120077
|
render() {
|
|
119946
|
-
var _a, _b;
|
|
120078
|
+
var _a, _b, _c;
|
|
119947
120079
|
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", ref: ref => this._refPaginationControl = ref }, this.getPaginationControl())), index.h("div", { ref: (ref) => this._gridSelectionCounter = ref, class: `grid__selection-counter
|
|
119948
120080
|
${this._showSelectionCounter ? "grid__selection-counter--opened" : ""}
|
|
119949
|
-
` }, index.h(SelectionCounter, { selectionCount: this._selectionCount, total: (_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.total,
|
|
120081
|
+
` }, index.h(SelectionCounter, { selectionCount: this._selectionCount, selectionPageCount: this._selectionPageCount, total: (_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.total, recordsLength: (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length, onSelectAll: this.onSelectAllRecords.bind(this), onSelectPage: this.onSelectPageRecords.bind(this), onClearAll: this.onClearSelectedRecords.bind(this), onClose: () => this._showSelectionCounter = false })), index.h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" })));
|
|
119950
120082
|
}
|
|
119951
120083
|
static get assetsDirs() { return ["../assets"]; }
|
|
119952
120084
|
get _element() { return index.getElement(this); }
|
package/dist/cjs/ezui.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["ez-actions-button.cjs",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"isOpened":[64]}]]],["ez-breadcrumb.cjs",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"show":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_selectionCount":[32],"
|
|
20
|
+
return index.bootstrapLazy([["ez-actions-button.cjs",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"isOpened":[64]}]]],["ez-breadcrumb.cjs",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"show":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_selectionCount":[32],"_selectionPageCount":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["ez-modal-container.cjs",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]}]]],["ez-alert.cjs",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-file-item.cjs",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["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"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]]],["ez-radio-button.cjs",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-form-view.cjs",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-guide-navigator.cjs",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["ez-dropdown.cjs",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[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],"isInvalid":[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],"isInvalid":[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],"isInvalid":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[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],"isInvalid":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[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-text-edit.cjs",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["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],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-filter-input_4.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[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"]]],[1,"ez-sidebar-button"]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["ez-form.cjs",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"validate":[64]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|