@sankhyalabs/ezui 1.1.153 → 1.1.156
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 +23 -12
- package/dist/cjs/ez-number-input.cjs.entry.js +5 -1
- package/dist/cjs/grid-config.cjs.entry.js +3 -1
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +1 -9
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +9 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +13 -1
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +3 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +5 -1
- package/dist/custom-elements/index.js +31 -14
- package/dist/esm/ez-grid.entry.js +23 -12
- package/dist/esm/ez-number-input.entry.js +5 -1
- package/dist/esm/grid-config.entry.js +3 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-91377c65.entry.js +1 -0
- package/dist/ezui/{p-0fbf10c0.entry.js → p-be87ac5e.entry.js} +1 -1
- package/dist/ezui/p-bea6f8a6.entry.js +1 -0
- package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +0 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +8 -4
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +3 -0
- package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +1 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -1
- package/package.json +1 -1
- package/dist/ezui/p-24e98dc1.entry.js +0 -1
- package/dist/ezui/p-905688e6.entry.js +0 -1
|
@@ -110049,7 +110049,16 @@ class DataSource {
|
|
|
110049
110049
|
loadData(page) {
|
|
110050
110050
|
return new Promise((resolve, reject) => {
|
|
110051
110051
|
if (this._dataUnit) {
|
|
110052
|
-
|
|
110052
|
+
if (this._localRefresh && this._lastPageResponse) {
|
|
110053
|
+
resolve({ rowCount: (this._lastPageResponse.rowCount + Math.max((this._dataUnit.records.length - this._lastPageResponse.rowData.length), 0)), rowData: this._dataUnit.records });
|
|
110054
|
+
this._localRefresh = false;
|
|
110055
|
+
}
|
|
110056
|
+
else {
|
|
110057
|
+
this._dataUnit.loadData(page).then(pageRes => {
|
|
110058
|
+
this._lastPageResponse = { rowData: this._dataUnit.records, rowCount: pageRes ? pageRes.total : 0 };
|
|
110059
|
+
resolve(this._lastPageResponse);
|
|
110060
|
+
});
|
|
110061
|
+
}
|
|
110053
110062
|
}
|
|
110054
110063
|
else {
|
|
110055
110064
|
fetch(this._serverURL)
|
|
@@ -110063,6 +110072,9 @@ class DataSource {
|
|
|
110063
110072
|
setQuickFilter(term, fields) {
|
|
110064
110073
|
this._quickFilter = { term, fields };
|
|
110065
110074
|
}
|
|
110075
|
+
setLocalRefresh(localREfresh) {
|
|
110076
|
+
this._localRefresh = localREfresh;
|
|
110077
|
+
}
|
|
110066
110078
|
}
|
|
110067
110079
|
|
|
110068
110080
|
class AgGridController {
|
|
@@ -110183,8 +110195,15 @@ class AgGridController {
|
|
|
110183
110195
|
if (this._grid === undefined) {
|
|
110184
110196
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110185
110197
|
}
|
|
110186
|
-
this.
|
|
110187
|
-
this.
|
|
110198
|
+
this._dataSource.setLocalRefresh(true);
|
|
110199
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
110200
|
+
}
|
|
110201
|
+
updateRows() {
|
|
110202
|
+
if (this._grid === undefined) {
|
|
110203
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110204
|
+
}
|
|
110205
|
+
this._dataSource.setLocalRefresh(true);
|
|
110206
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
110188
110207
|
}
|
|
110189
110208
|
selectRows(rowIds) {
|
|
110190
110209
|
if (this._grid === undefined) {
|
|
@@ -110580,11 +110599,8 @@ class DataUnitBridge {
|
|
|
110580
110599
|
this._gridController.removeRows(records);
|
|
110581
110600
|
break;
|
|
110582
110601
|
case core.Action.DATA_SAVED:
|
|
110583
|
-
this._gridController.addRows();
|
|
110584
|
-
break;
|
|
110585
110602
|
case core.Action.EDITION_CANCELED:
|
|
110586
|
-
this.
|
|
110587
|
-
break;
|
|
110603
|
+
this._gridController.updateRows();
|
|
110588
110604
|
case core.Action.SELECTION_CHANGED:
|
|
110589
110605
|
const { selection } = action.payload;
|
|
110590
110606
|
this._gridController.selectRows(selection);
|
|
@@ -110603,11 +110619,6 @@ class DataUnitBridge {
|
|
|
110603
110619
|
this._dataUnit = dataUnit;
|
|
110604
110620
|
this._dataUnit.subscribe(this.processAction);
|
|
110605
110621
|
}
|
|
110606
|
-
updateValues() {
|
|
110607
|
-
this._dataUnit.getSelectedRecords().forEach((record) => {
|
|
110608
|
-
this._gridController.changeValues(record, [record.__record__id__]);
|
|
110609
|
-
});
|
|
110610
|
-
}
|
|
110611
110622
|
buildColumnDefs() {
|
|
110612
110623
|
const columnDefs = [];
|
|
110613
110624
|
if (this._dataUnit.metadata) {
|
|
@@ -55,10 +55,12 @@ let EzNumberInput = class {
|
|
|
55
55
|
if (newValue !== this.value) {
|
|
56
56
|
this.value = newValue;
|
|
57
57
|
this.ezChange.emit(this.value);
|
|
58
|
+
return true;
|
|
58
59
|
}
|
|
59
60
|
else {
|
|
60
61
|
this.observeValue();
|
|
61
62
|
}
|
|
63
|
+
return false;
|
|
62
64
|
}
|
|
63
65
|
parseNumber() {
|
|
64
66
|
const parsedNumber = this._textInput.value ? core.NumberUtils.stringToNumber(this._textInput.value) : undefined;
|
|
@@ -68,7 +70,9 @@ let EzNumberInput = class {
|
|
|
68
70
|
}
|
|
69
71
|
else {
|
|
70
72
|
try {
|
|
71
|
-
this.changeValue(parsedNumber)
|
|
73
|
+
if (!this.changeValue(parsedNumber)) {
|
|
74
|
+
this.ezCancelWaitingChange.emit();
|
|
75
|
+
}
|
|
72
76
|
}
|
|
73
77
|
catch (e) {
|
|
74
78
|
this.ezCancelWaitingChange.emit();
|
|
@@ -18,6 +18,7 @@ let GridConfig = class {
|
|
|
18
18
|
this._columListItems = [];
|
|
19
19
|
this._selectedIndex = -1;
|
|
20
20
|
this._dataChanged = false;
|
|
21
|
+
this._componenteInternalKey = Date.now();
|
|
21
22
|
this.selectedTab = "Colunas";
|
|
22
23
|
}
|
|
23
24
|
/* Creation Methods */
|
|
@@ -89,7 +90,7 @@ let GridConfig = class {
|
|
|
89
90
|
if ((item === null || item === void 0 ? void 0 : item.ascending) != undefined) {
|
|
90
91
|
selectedOption = item.ascending == true ? 'asc' : 'desc';
|
|
91
92
|
}
|
|
92
|
-
return (index.h("div", null, index.h("select-box", { selectedOption: selectedOption, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
93
|
+
return (index.h("div", null, index.h("select-box", { selectedOption: selectedOption, key: 'select-box-' + this._componenteInternalKey + '-' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
93
94
|
}
|
|
94
95
|
updateOrder(sortOrder, updatedItemLabel) {
|
|
95
96
|
var _a;
|
|
@@ -363,6 +364,7 @@ let GridConfig = class {
|
|
|
363
364
|
this._dataChanged = false;
|
|
364
365
|
this.configCancel.emit();
|
|
365
366
|
this._orderList.clearHistory();
|
|
367
|
+
this._componenteInternalKey = Date.now();
|
|
366
368
|
}
|
|
367
369
|
else {
|
|
368
370
|
this.finish();
|
|
@@ -12,11 +12,8 @@ export default class DataUnitBridge {
|
|
|
12
12
|
this._gridController.removeRows(records);
|
|
13
13
|
break;
|
|
14
14
|
case Action.DATA_SAVED:
|
|
15
|
-
this._gridController.addRows();
|
|
16
|
-
break;
|
|
17
15
|
case Action.EDITION_CANCELED:
|
|
18
|
-
this.
|
|
19
|
-
break;
|
|
16
|
+
this._gridController.updateRows();
|
|
20
17
|
case Action.SELECTION_CHANGED:
|
|
21
18
|
const { selection } = action.payload;
|
|
22
19
|
this._gridController.selectRows(selection);
|
|
@@ -35,11 +32,6 @@ export default class DataUnitBridge {
|
|
|
35
32
|
this._dataUnit = dataUnit;
|
|
36
33
|
this._dataUnit.subscribe(this.processAction);
|
|
37
34
|
}
|
|
38
|
-
updateValues() {
|
|
39
|
-
this._dataUnit.getSelectedRecords().forEach((record) => {
|
|
40
|
-
this._gridController.changeValues(record, [record.__record__id__]);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
35
|
buildColumnDefs() {
|
|
44
36
|
const columnDefs = [];
|
|
45
37
|
if (this._dataUnit.metadata) {
|
|
@@ -124,8 +124,15 @@ export default class AgGridController {
|
|
|
124
124
|
if (this._grid === undefined) {
|
|
125
125
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
126
126
|
}
|
|
127
|
-
this.
|
|
128
|
-
this.
|
|
127
|
+
this._dataSource.setLocalRefresh(true);
|
|
128
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
129
|
+
}
|
|
130
|
+
updateRows() {
|
|
131
|
+
if (this._grid === undefined) {
|
|
132
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
133
|
+
}
|
|
134
|
+
this._dataSource.setLocalRefresh(true);
|
|
135
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
129
136
|
}
|
|
130
137
|
selectRows(rowIds) {
|
|
131
138
|
if (this._grid === undefined) {
|
|
@@ -27,7 +27,16 @@ export default class DataSource {
|
|
|
27
27
|
loadData(page) {
|
|
28
28
|
return new Promise((resolve, reject) => {
|
|
29
29
|
if (this._dataUnit) {
|
|
30
|
-
|
|
30
|
+
if (this._localRefresh && this._lastPageResponse) {
|
|
31
|
+
resolve({ rowCount: (this._lastPageResponse.rowCount + Math.max((this._dataUnit.records.length - this._lastPageResponse.rowData.length), 0)), rowData: this._dataUnit.records });
|
|
32
|
+
this._localRefresh = false;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this._dataUnit.loadData(page).then(pageRes => {
|
|
36
|
+
this._lastPageResponse = { rowData: this._dataUnit.records, rowCount: pageRes ? pageRes.total : 0 };
|
|
37
|
+
resolve(this._lastPageResponse);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
31
40
|
}
|
|
32
41
|
else {
|
|
33
42
|
fetch(this._serverURL)
|
|
@@ -41,4 +50,7 @@ export default class DataSource {
|
|
|
41
50
|
setQuickFilter(term, fields) {
|
|
42
51
|
this._quickFilter = { term, fields };
|
|
43
52
|
}
|
|
53
|
+
setLocalRefresh(localREfresh) {
|
|
54
|
+
this._localRefresh = localREfresh;
|
|
55
|
+
}
|
|
44
56
|
}
|
|
@@ -8,6 +8,7 @@ export class GridConfig {
|
|
|
8
8
|
this._columListItems = [];
|
|
9
9
|
this._selectedIndex = -1;
|
|
10
10
|
this._dataChanged = false;
|
|
11
|
+
this._componenteInternalKey = Date.now();
|
|
11
12
|
this.selectedTab = "Colunas";
|
|
12
13
|
}
|
|
13
14
|
/* Creation Methods */
|
|
@@ -81,7 +82,7 @@ export class GridConfig {
|
|
|
81
82
|
selectedOption = item.ascending == true ? 'asc' : 'desc';
|
|
82
83
|
}
|
|
83
84
|
return (h("div", null,
|
|
84
|
-
h("select-box", { selectedOption: selectedOption, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
85
|
+
h("select-box", { selectedOption: selectedOption, key: 'select-box-' + this._componenteInternalKey + '-' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
85
86
|
}
|
|
86
87
|
updateOrder(sortOrder, updatedItemLabel) {
|
|
87
88
|
var _a;
|
|
@@ -355,6 +356,7 @@ export class GridConfig {
|
|
|
355
356
|
this._dataChanged = false;
|
|
356
357
|
this.configCancel.emit();
|
|
357
358
|
this._orderList.clearHistory();
|
|
359
|
+
this._componenteInternalKey = Date.now();
|
|
358
360
|
}
|
|
359
361
|
else {
|
|
360
362
|
this.finish();
|
|
@@ -44,10 +44,12 @@ export class EzNumberInput {
|
|
|
44
44
|
if (newValue !== this.value) {
|
|
45
45
|
this.value = newValue;
|
|
46
46
|
this.ezChange.emit(this.value);
|
|
47
|
+
return true;
|
|
47
48
|
}
|
|
48
49
|
else {
|
|
49
50
|
this.observeValue();
|
|
50
51
|
}
|
|
52
|
+
return false;
|
|
51
53
|
}
|
|
52
54
|
parseNumber() {
|
|
53
55
|
const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : undefined;
|
|
@@ -57,7 +59,9 @@ export class EzNumberInput {
|
|
|
57
59
|
}
|
|
58
60
|
else {
|
|
59
61
|
try {
|
|
60
|
-
this.changeValue(parsedNumber)
|
|
62
|
+
if (!this.changeValue(parsedNumber)) {
|
|
63
|
+
this.ezCancelWaitingChange.emit();
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
catch (e) {
|
|
63
67
|
this.ezCancelWaitingChange.emit();
|
|
@@ -112324,7 +112324,16 @@ class DataSource {
|
|
|
112324
112324
|
loadData(page) {
|
|
112325
112325
|
return new Promise((resolve, reject) => {
|
|
112326
112326
|
if (this._dataUnit) {
|
|
112327
|
-
|
|
112327
|
+
if (this._localRefresh && this._lastPageResponse) {
|
|
112328
|
+
resolve({ rowCount: (this._lastPageResponse.rowCount + Math.max((this._dataUnit.records.length - this._lastPageResponse.rowData.length), 0)), rowData: this._dataUnit.records });
|
|
112329
|
+
this._localRefresh = false;
|
|
112330
|
+
}
|
|
112331
|
+
else {
|
|
112332
|
+
this._dataUnit.loadData(page).then(pageRes => {
|
|
112333
|
+
this._lastPageResponse = { rowData: this._dataUnit.records, rowCount: pageRes ? pageRes.total : 0 };
|
|
112334
|
+
resolve(this._lastPageResponse);
|
|
112335
|
+
});
|
|
112336
|
+
}
|
|
112328
112337
|
}
|
|
112329
112338
|
else {
|
|
112330
112339
|
fetch(this._serverURL)
|
|
@@ -112338,6 +112347,9 @@ class DataSource {
|
|
|
112338
112347
|
setQuickFilter(term, fields) {
|
|
112339
112348
|
this._quickFilter = { term, fields };
|
|
112340
112349
|
}
|
|
112350
|
+
setLocalRefresh(localREfresh) {
|
|
112351
|
+
this._localRefresh = localREfresh;
|
|
112352
|
+
}
|
|
112341
112353
|
}
|
|
112342
112354
|
|
|
112343
112355
|
class AgGridController {
|
|
@@ -112458,8 +112470,15 @@ class AgGridController {
|
|
|
112458
112470
|
if (this._grid === undefined) {
|
|
112459
112471
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112460
112472
|
}
|
|
112461
|
-
this.
|
|
112462
|
-
this.
|
|
112473
|
+
this._dataSource.setLocalRefresh(true);
|
|
112474
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
112475
|
+
}
|
|
112476
|
+
updateRows() {
|
|
112477
|
+
if (this._grid === undefined) {
|
|
112478
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112479
|
+
}
|
|
112480
|
+
this._dataSource.setLocalRefresh(true);
|
|
112481
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
112463
112482
|
}
|
|
112464
112483
|
selectRows(rowIds) {
|
|
112465
112484
|
if (this._grid === undefined) {
|
|
@@ -112855,11 +112874,8 @@ class DataUnitBridge {
|
|
|
112855
112874
|
this._gridController.removeRows(records);
|
|
112856
112875
|
break;
|
|
112857
112876
|
case Action.DATA_SAVED:
|
|
112858
|
-
this._gridController.addRows();
|
|
112859
|
-
break;
|
|
112860
112877
|
case Action.EDITION_CANCELED:
|
|
112861
|
-
this.
|
|
112862
|
-
break;
|
|
112878
|
+
this._gridController.updateRows();
|
|
112863
112879
|
case Action.SELECTION_CHANGED:
|
|
112864
112880
|
const { selection } = action.payload;
|
|
112865
112881
|
this._gridController.selectRows(selection);
|
|
@@ -112878,11 +112894,6 @@ class DataUnitBridge {
|
|
|
112878
112894
|
this._dataUnit = dataUnit;
|
|
112879
112895
|
this._dataUnit.subscribe(this.processAction);
|
|
112880
112896
|
}
|
|
112881
|
-
updateValues() {
|
|
112882
|
-
this._dataUnit.getSelectedRecords().forEach((record) => {
|
|
112883
|
-
this._gridController.changeValues(record, [record.__record__id__]);
|
|
112884
|
-
});
|
|
112885
|
-
}
|
|
112886
112897
|
buildColumnDefs() {
|
|
112887
112898
|
const columnDefs = [];
|
|
112888
112899
|
if (this._dataUnit.metadata) {
|
|
@@ -113866,10 +113877,12 @@ let EzNumberInput$1 = class extends HTMLElement$1 {
|
|
|
113866
113877
|
if (newValue !== this.value) {
|
|
113867
113878
|
this.value = newValue;
|
|
113868
113879
|
this.ezChange.emit(this.value);
|
|
113880
|
+
return true;
|
|
113869
113881
|
}
|
|
113870
113882
|
else {
|
|
113871
113883
|
this.observeValue();
|
|
113872
113884
|
}
|
|
113885
|
+
return false;
|
|
113873
113886
|
}
|
|
113874
113887
|
parseNumber() {
|
|
113875
113888
|
const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : undefined;
|
|
@@ -113879,7 +113892,9 @@ let EzNumberInput$1 = class extends HTMLElement$1 {
|
|
|
113879
113892
|
}
|
|
113880
113893
|
else {
|
|
113881
113894
|
try {
|
|
113882
|
-
this.changeValue(parsedNumber)
|
|
113895
|
+
if (!this.changeValue(parsedNumber)) {
|
|
113896
|
+
this.ezCancelWaitingChange.emit();
|
|
113897
|
+
}
|
|
113883
113898
|
}
|
|
113884
113899
|
catch (e) {
|
|
113885
113900
|
this.ezCancelWaitingChange.emit();
|
|
@@ -115383,6 +115398,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115383
115398
|
this._columListItems = [];
|
|
115384
115399
|
this._selectedIndex = -1;
|
|
115385
115400
|
this._dataChanged = false;
|
|
115401
|
+
this._componenteInternalKey = Date.now();
|
|
115386
115402
|
this.selectedTab = "Colunas";
|
|
115387
115403
|
}
|
|
115388
115404
|
/* Creation Methods */
|
|
@@ -115454,7 +115470,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115454
115470
|
if ((item === null || item === void 0 ? void 0 : item.ascending) != undefined) {
|
|
115455
115471
|
selectedOption = item.ascending == true ? 'asc' : 'desc';
|
|
115456
115472
|
}
|
|
115457
|
-
return (h("div", null, h("select-box", { selectedOption: selectedOption, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
115473
|
+
return (h("div", null, h("select-box", { selectedOption: selectedOption, key: 'select-box-' + this._componenteInternalKey + '-' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
115458
115474
|
}
|
|
115459
115475
|
updateOrder(sortOrder, updatedItemLabel) {
|
|
115460
115476
|
var _a;
|
|
@@ -115728,6 +115744,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115728
115744
|
this._dataChanged = false;
|
|
115729
115745
|
this.configCancel.emit();
|
|
115730
115746
|
this._orderList.clearHistory();
|
|
115747
|
+
this._componenteInternalKey = Date.now();
|
|
115731
115748
|
}
|
|
115732
115749
|
else {
|
|
115733
115750
|
this.finish();
|
|
@@ -110045,7 +110045,16 @@ class DataSource {
|
|
|
110045
110045
|
loadData(page) {
|
|
110046
110046
|
return new Promise((resolve, reject) => {
|
|
110047
110047
|
if (this._dataUnit) {
|
|
110048
|
-
|
|
110048
|
+
if (this._localRefresh && this._lastPageResponse) {
|
|
110049
|
+
resolve({ rowCount: (this._lastPageResponse.rowCount + Math.max((this._dataUnit.records.length - this._lastPageResponse.rowData.length), 0)), rowData: this._dataUnit.records });
|
|
110050
|
+
this._localRefresh = false;
|
|
110051
|
+
}
|
|
110052
|
+
else {
|
|
110053
|
+
this._dataUnit.loadData(page).then(pageRes => {
|
|
110054
|
+
this._lastPageResponse = { rowData: this._dataUnit.records, rowCount: pageRes ? pageRes.total : 0 };
|
|
110055
|
+
resolve(this._lastPageResponse);
|
|
110056
|
+
});
|
|
110057
|
+
}
|
|
110049
110058
|
}
|
|
110050
110059
|
else {
|
|
110051
110060
|
fetch(this._serverURL)
|
|
@@ -110059,6 +110068,9 @@ class DataSource {
|
|
|
110059
110068
|
setQuickFilter(term, fields) {
|
|
110060
110069
|
this._quickFilter = { term, fields };
|
|
110061
110070
|
}
|
|
110071
|
+
setLocalRefresh(localREfresh) {
|
|
110072
|
+
this._localRefresh = localREfresh;
|
|
110073
|
+
}
|
|
110062
110074
|
}
|
|
110063
110075
|
|
|
110064
110076
|
class AgGridController {
|
|
@@ -110179,8 +110191,15 @@ class AgGridController {
|
|
|
110179
110191
|
if (this._grid === undefined) {
|
|
110180
110192
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110181
110193
|
}
|
|
110182
|
-
this.
|
|
110183
|
-
this.
|
|
110194
|
+
this._dataSource.setLocalRefresh(true);
|
|
110195
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
110196
|
+
}
|
|
110197
|
+
updateRows() {
|
|
110198
|
+
if (this._grid === undefined) {
|
|
110199
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110200
|
+
}
|
|
110201
|
+
this._dataSource.setLocalRefresh(true);
|
|
110202
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
110184
110203
|
}
|
|
110185
110204
|
selectRows(rowIds) {
|
|
110186
110205
|
if (this._grid === undefined) {
|
|
@@ -110576,11 +110595,8 @@ class DataUnitBridge {
|
|
|
110576
110595
|
this._gridController.removeRows(records);
|
|
110577
110596
|
break;
|
|
110578
110597
|
case Action.DATA_SAVED:
|
|
110579
|
-
this._gridController.addRows();
|
|
110580
|
-
break;
|
|
110581
110598
|
case Action.EDITION_CANCELED:
|
|
110582
|
-
this.
|
|
110583
|
-
break;
|
|
110599
|
+
this._gridController.updateRows();
|
|
110584
110600
|
case Action.SELECTION_CHANGED:
|
|
110585
110601
|
const { selection } = action.payload;
|
|
110586
110602
|
this._gridController.selectRows(selection);
|
|
@@ -110599,11 +110615,6 @@ class DataUnitBridge {
|
|
|
110599
110615
|
this._dataUnit = dataUnit;
|
|
110600
110616
|
this._dataUnit.subscribe(this.processAction);
|
|
110601
110617
|
}
|
|
110602
|
-
updateValues() {
|
|
110603
|
-
this._dataUnit.getSelectedRecords().forEach((record) => {
|
|
110604
|
-
this._gridController.changeValues(record, [record.__record__id__]);
|
|
110605
|
-
});
|
|
110606
|
-
}
|
|
110607
110618
|
buildColumnDefs() {
|
|
110608
110619
|
const columnDefs = [];
|
|
110609
110620
|
if (this._dataUnit.metadata) {
|
|
@@ -51,10 +51,12 @@ let EzNumberInput = class {
|
|
|
51
51
|
if (newValue !== this.value) {
|
|
52
52
|
this.value = newValue;
|
|
53
53
|
this.ezChange.emit(this.value);
|
|
54
|
+
return true;
|
|
54
55
|
}
|
|
55
56
|
else {
|
|
56
57
|
this.observeValue();
|
|
57
58
|
}
|
|
59
|
+
return false;
|
|
58
60
|
}
|
|
59
61
|
parseNumber() {
|
|
60
62
|
const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : undefined;
|
|
@@ -64,7 +66,9 @@ let EzNumberInput = class {
|
|
|
64
66
|
}
|
|
65
67
|
else {
|
|
66
68
|
try {
|
|
67
|
-
this.changeValue(parsedNumber)
|
|
69
|
+
if (!this.changeValue(parsedNumber)) {
|
|
70
|
+
this.ezCancelWaitingChange.emit();
|
|
71
|
+
}
|
|
68
72
|
}
|
|
69
73
|
catch (e) {
|
|
70
74
|
this.ezCancelWaitingChange.emit();
|
|
@@ -14,6 +14,7 @@ let GridConfig = class {
|
|
|
14
14
|
this._columListItems = [];
|
|
15
15
|
this._selectedIndex = -1;
|
|
16
16
|
this._dataChanged = false;
|
|
17
|
+
this._componenteInternalKey = Date.now();
|
|
17
18
|
this.selectedTab = "Colunas";
|
|
18
19
|
}
|
|
19
20
|
/* Creation Methods */
|
|
@@ -85,7 +86,7 @@ let GridConfig = class {
|
|
|
85
86
|
if ((item === null || item === void 0 ? void 0 : item.ascending) != undefined) {
|
|
86
87
|
selectedOption = item.ascending == true ? 'asc' : 'desc';
|
|
87
88
|
}
|
|
88
|
-
return (h("div", null, h("select-box", { selectedOption: selectedOption, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
89
|
+
return (h("div", null, h("select-box", { selectedOption: selectedOption, key: 'select-box-' + this._componenteInternalKey + '-' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item.label); } })));
|
|
89
90
|
}
|
|
90
91
|
updateOrder(sortOrder, updatedItemLabel) {
|
|
91
92
|
var _a;
|
|
@@ -359,6 +360,7 @@ let GridConfig = class {
|
|
|
359
360
|
this._dataChanged = false;
|
|
360
361
|
this.configCancel.emit();
|
|
361
362
|
this._orderList.clearHistory();
|
|
363
|
+
this._componenteInternalKey = Date.now();
|
|
362
364
|
}
|
|
363
365
|
else {
|
|
364
366
|
this.finish();
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as s}from"./p-139ed2f6.js";(()=>{const s=import.meta.url,o={};return""!==s&&(o.resourcesUrl=new URL(".",s).href),e(o)})().then((e=>s([["p-4c3cd534",[[0,"test-du",{isDirty:[32]}]]],["p-fc9b9487",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],loading:[516],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-2c4372a4",[[0,"ez-application"]]],["p-5a05f1ea",[[1,"ez-card-item",{item:[16]}]]],["p-6287fc90",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-8be1a4d6",[[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]}]]],["p-94ed1ae6",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-4f2e5cf4",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-c2de757f",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-024df41e",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],stretchTitle:[516,"stretch-title"],showHide:[64]}]]],["p-ecee9d8d",[[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]}]]],["p-1941aef7",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]}]]],["p-
|
|
1
|
+
import{p as e,b as s}from"./p-139ed2f6.js";(()=>{const s=import.meta.url,o={};return""!==s&&(o.resourcesUrl=new URL(".",s).href),e(o)})().then((e=>s([["p-4c3cd534",[[0,"test-du",{isDirty:[32]}]]],["p-fc9b9487",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],loading:[516],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-2c4372a4",[[0,"ez-application"]]],["p-5a05f1ea",[[1,"ez-card-item",{item:[16]}]]],["p-6287fc90",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-8be1a4d6",[[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]}]]],["p-94ed1ae6",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-4f2e5cf4",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-c2de757f",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-024df41e",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],stretchTitle:[516,"stretch-title"],showHide:[64]}]]],["p-ecee9d8d",[[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]}]]],["p-1941aef7",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]}]]],["p-be87ac5e",[[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]}]]],["p-ec7b7e26",[[1,"ez-dialog",{confirm:[1028],critical:[1028],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],handleButtonClick:[64],show:[64]}]]],["p-dd723a09",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-294de17e",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[1540,"use-header"],ezTitle:[1,"ez-title"]}]]],["p-140f7085",[[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],slaveMode:[516,"slave-mode"],setFocus:[64],setBlur:[64]}]]],["p-727a39e5",[[1,"select-box",{selectedOption:[1,"selected-option"]}]]],["p-bea6f8a6",[[2,"grid-config",{selectedTab:[1025,"selected-tab"],columns:[1040],config:[1040]}]]],["p-6d4b1628",[[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]}]]],["p-c246e251",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-49fdfa4b",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-ec21ecce",[[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]}]]],["p-4fdceb7d",[[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]}]]],["p-91377c65",[[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]}]]],["p-b524dfca",[[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]}]]],["p-da156da3",[[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]}]]],["p-b65e22a1",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],mode:[513],getMode:[64],setFocus:[64]}]]],["p-2b017e4c",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1]}]]],["p-317250bc",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-2f34453f",[[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],setFocus:[64],setBlur:[64]}]]],["p-8f4fac31",[[0,"ez-form",{dataUnit:[1040],config:[16],submit:[64],cancel:[64],validate:[64]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as t,h as e,g as i}from"./p-139ed2f6.js";import{NumberUtils as h}from"@sankhyalabs/core";import{C as r}from"./p-933a7475.js";let a=class{constructor(e){s(this,e),this.ezChange=t(this,"ezChange",7),this.ezStartChange=t(this,"ezStartChange",7),this.ezCancelWaitingChange=t(this,"ezCancelWaitingChange",7),this.enabled=!0,this.mode="regular"}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){this._textInput&&(this._textInput.errorMessage=this.errorMessage)}observeValue(){this._textInput&&(this._textInput.value=this.getTextValue(this.value)||"")}changeValue(s){return this.errorMessage="",s!==this.value?(this.value=s,this.ezChange.emit(this.value),!0):(this.observeValue(),!1)}parseNumber(){const s=this._textInput.value?h.stringToNumber(this._textInput.value):void 0;if(void 0!==s&&isNaN(s))this.ezCancelWaitingChange.emit(),this.errorMessage="O valor digitado não é um número válido";else try{this.changeValue(s)||this.ezCancelWaitingChange.emit()}catch(s){return this.ezCancelWaitingChange.emit(),void(this.errorMessage=s.message)}}getTextValue(s){if(s)return this.precision>0?h.format(s.toString(),Number(this.precision),Number(this.prettyPrecision)):s.toString()}startChange(){this.ezStartChange.emit({waitmessage:"",blocking:!1})}componentDidLoad(){r.applyVarsTextInput(this._elem,this._textInput)}render(){return e("ez-text-input",{ref:s=>this._textInput=s,onBlur:()=>this.parseNumber(),label:this.label,onInput:()=>this.startChange(),value:this.getTextValue(this.value),restrict:this.precision>0?"0123456789-,.":"0123456789-",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,slaveMode:!0})}get _elem(){return i(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};a.style=":host{display:block;width:100%}";export{a as ez_number_input}
|