@sankhyalabs/ezui 1.1.100 → 1.1.103
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/{UnitMetadata-63c56042.js → UnitMetadata-4b90ead3.js} +43 -8
- package/dist/cjs/ez-button_3.cjs.entry.js +16 -4
- package/dist/cjs/ez-calendar_16.cjs.entry.js +97 -15
- package/dist/cjs/ez-grid.cjs.entry.js +14 -1
- package/dist/cjs/ez-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-button/ez-button.js +51 -5
- package/dist/collection/components/ez-calendar/ez-calendar.js +11 -7
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +3 -3
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +47 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +59 -7
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +57 -6
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +7 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +6 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +47 -1
- package/dist/collection/components/ez-search/ez-search.js +47 -1
- package/dist/collection/components/ez-upload/ez-upload.css +5 -0
- package/dist/collection/components/ez-upload/ez-upload.js +45 -1
- package/dist/collection/components/test-du/test-du.js +7 -0
- package/dist/custom-elements/index.js +168 -26
- package/dist/esm/{UnitMetadata-109880b0.js → UnitMetadata-8951d803.js} +43 -8
- package/dist/esm/ez-button_3.entry.js +16 -4
- package/dist/esm/ez-calendar_16.entry.js +97 -15
- package/dist/esm/ez-grid.entry.js +14 -1
- package/dist/esm/ez-modal_2.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- 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-afb820c1.entry.js → p-18c00d88.entry.js} +1 -1
- package/dist/ezui/p-2259c926.entry.js +1 -0
- package/dist/ezui/p-6b257393.entry.js +1 -0
- package/dist/ezui/{p-a30309ce.entry.js → p-7294c815.entry.js} +1 -1
- package/dist/ezui/p-c6760545.js +1 -0
- package/dist/ezui/{p-18de871c.entry.js → p-da0f5393.entry.js} +2 -2
- package/dist/types/components/ez-button/ez-button.d.ts +9 -0
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +1 -1
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +8 -0
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +9 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +9 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +4 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +8 -0
- package/dist/types/components/ez-search/ez-search.d.ts +8 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +8 -0
- package/dist/types/components.d.ts +60 -4
- package/package.json +1 -1
- package/dist/ezui/p-3ea01b00.entry.js +0 -1
- package/dist/ezui/p-9fab5606.js +0 -1
- package/dist/ezui/p-d7c80eac.entry.js +0 -1
|
@@ -63,6 +63,18 @@ let EzButton$1 = class extends HTMLElement$1 {
|
|
|
63
63
|
*/
|
|
64
64
|
this.size = "medium";
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Realiza o foco no botão
|
|
68
|
+
*/
|
|
69
|
+
async setFocus() {
|
|
70
|
+
this._button.focus();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Remove o foco no botão
|
|
74
|
+
*/
|
|
75
|
+
async setBlur() {
|
|
76
|
+
this._button.blur();
|
|
77
|
+
}
|
|
66
78
|
getIconSize() {
|
|
67
79
|
return this.size;
|
|
68
80
|
}
|
|
@@ -84,22 +96,22 @@ let EzButton$1 = class extends HTMLElement$1 {
|
|
|
84
96
|
}
|
|
85
97
|
render() {
|
|
86
98
|
if (this.mode == "icon") {
|
|
87
|
-
return (h("button", { class: "icon " + this.size, type: "button", disabled: !this.enabled }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
|
|
99
|
+
return (h("button", { class: "icon " + this.size, type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
|
|
88
100
|
if (!this.enabled)
|
|
89
101
|
evt.stopPropagation();
|
|
90
102
|
} })));
|
|
91
103
|
}
|
|
92
104
|
else if (this.mode == "label-icon") {
|
|
93
|
-
return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: "large", onClick: evt => {
|
|
105
|
+
return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: "large", onClick: evt => {
|
|
94
106
|
if (!this.enabled)
|
|
95
107
|
evt.stopPropagation();
|
|
96
108
|
} })), h("label", { title: this.label }, this.label)));
|
|
97
109
|
}
|
|
98
110
|
else if (this.mode == "link") {
|
|
99
|
-
return (h("a", { class: this.size }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
111
|
+
return (h("a", { class: this.size, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
100
112
|
}
|
|
101
113
|
else {
|
|
102
|
-
return (h("button", { type: "button", disabled: !this.enabled }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
114
|
+
return (h("button", { type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
117
|
static get style() { return ezButtonCss; }
|
|
@@ -897,6 +909,7 @@ var Action;
|
|
|
897
909
|
Action["DATA_LOADED"] = "dataLoaded";
|
|
898
910
|
Action["SAVING_DATA"] = "savingData";
|
|
899
911
|
Action["DATA_SAVED"] = "dataSaved";
|
|
912
|
+
Action["REMOVING_RECORDS"] = "removingRecords";
|
|
900
913
|
Action["RECORDS_REMOVED"] = "recordsRemoved";
|
|
901
914
|
Action["RECORDS_ADDED"] = "recordsAdded";
|
|
902
915
|
Action["RECORDS_COPIED"] = "recordsCopied";
|
|
@@ -1061,7 +1074,11 @@ class RemovedRecordsReducerImpl {
|
|
|
1061
1074
|
reduce(_stateManager, currentState, action) {
|
|
1062
1075
|
switch (action.type) {
|
|
1063
1076
|
case Action.RECORDS_REMOVED:
|
|
1064
|
-
|
|
1077
|
+
const { records, buffered } = action.payload;
|
|
1078
|
+
if (buffered) {
|
|
1079
|
+
return (currentState || []).concat(records);
|
|
1080
|
+
}
|
|
1081
|
+
return currentState;
|
|
1065
1082
|
case Action.EDITION_CANCELED:
|
|
1066
1083
|
case Action.DATA_SAVED:
|
|
1067
1084
|
return undefined;
|
|
@@ -1082,6 +1099,12 @@ class RecordsReducerImpl {
|
|
|
1082
1099
|
switch (action.type) {
|
|
1083
1100
|
case Action.DATA_LOADED:
|
|
1084
1101
|
return action.payload;
|
|
1102
|
+
case Action.RECORDS_REMOVED:
|
|
1103
|
+
const { records, buffered } = action.payload;
|
|
1104
|
+
if (!buffered) {
|
|
1105
|
+
return currentState.filter(r => !records.includes(r.__record__id__));
|
|
1106
|
+
}
|
|
1107
|
+
return currentState;
|
|
1085
1108
|
case Action.DATA_SAVED:
|
|
1086
1109
|
const recordsMap = new Map();
|
|
1087
1110
|
const currentRecords = getRecords(stateManager);
|
|
@@ -1255,7 +1278,7 @@ class SelectionReducerImpl {
|
|
|
1255
1278
|
case Action.DATA_SAVED:
|
|
1256
1279
|
return updateSavedIds(stateManager, action.payload.records);
|
|
1257
1280
|
case Action.RECORDS_REMOVED:
|
|
1258
|
-
const removed = action.payload;
|
|
1281
|
+
const removed = action.payload.records;
|
|
1259
1282
|
if (currentState && removed) {
|
|
1260
1283
|
return currentState.filter(recordId => !removed.includes(recordId));
|
|
1261
1284
|
}
|
|
@@ -1445,6 +1468,36 @@ class DataUnit {
|
|
|
1445
1468
|
return Promise.resolve();
|
|
1446
1469
|
});
|
|
1447
1470
|
}
|
|
1471
|
+
removeSelectedRecords(buffered = false) {
|
|
1472
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1473
|
+
const selection = getSelection(this._stateManager);
|
|
1474
|
+
if (selection) {
|
|
1475
|
+
return this.removeRecords(selection, buffered);
|
|
1476
|
+
}
|
|
1477
|
+
return Promise.resolve(selection);
|
|
1478
|
+
});
|
|
1479
|
+
}
|
|
1480
|
+
removeRecords(records, buffered = false) {
|
|
1481
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1482
|
+
if (records) {
|
|
1483
|
+
if (buffered || !this.removeLoader) {
|
|
1484
|
+
this.dispatchAction(Action.RECORDS_REMOVED, { records, buffered: true });
|
|
1485
|
+
}
|
|
1486
|
+
else {
|
|
1487
|
+
this.dispatchAction(Action.REMOVING_RECORDS);
|
|
1488
|
+
return new Promise((resolve, fail) => {
|
|
1489
|
+
if (this.removeLoader) {
|
|
1490
|
+
this.removeLoader(this, records).then(records => {
|
|
1491
|
+
this.dispatchAction(Action.RECORDS_REMOVED, { records, buffered: false });
|
|
1492
|
+
resolve(records);
|
|
1493
|
+
}).catch(error => fail(error));
|
|
1494
|
+
}
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
return Promise.resolve(records);
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1448
1501
|
// API
|
|
1449
1502
|
valueFromString(fieldName, value) {
|
|
1450
1503
|
const descriptor = this.getField(fieldName);
|
|
@@ -1484,12 +1537,6 @@ class DataUnit {
|
|
|
1484
1537
|
this.dispatchAction(Action.RECORDS_COPIED, prepareAddedRecordId(this._stateManager, selectedRecords));
|
|
1485
1538
|
}
|
|
1486
1539
|
}
|
|
1487
|
-
removeSelectedRecords() {
|
|
1488
|
-
const selection = getSelection(this._stateManager);
|
|
1489
|
-
if (selection) {
|
|
1490
|
-
this.dispatchAction(Action.RECORDS_REMOVED, selection);
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
1540
|
getFieldValue(fieldName) {
|
|
1494
1541
|
return getFieldValue(this._stateManager, fieldName);
|
|
1495
1542
|
}
|
|
@@ -1631,10 +1678,10 @@ var UserInterface;
|
|
|
1631
1678
|
|
|
1632
1679
|
class ApplicationContext {
|
|
1633
1680
|
static getContextValue(key) {
|
|
1634
|
-
return ApplicationContext.getCtx()[key]
|
|
1681
|
+
return ApplicationContext.getCtx()[key];
|
|
1635
1682
|
}
|
|
1636
1683
|
static setContextValue(key, value) {
|
|
1637
|
-
ApplicationContext.getCtx()[key] =
|
|
1684
|
+
ApplicationContext.getCtx()[key] = value;
|
|
1638
1685
|
}
|
|
1639
1686
|
static getCtx() {
|
|
1640
1687
|
let ctx = window.___snkcore___ctx___;
|
|
@@ -1747,28 +1794,28 @@ let EzCalendar$1 = class extends HTMLElement$1 {
|
|
|
1747
1794
|
}
|
|
1748
1795
|
}
|
|
1749
1796
|
this.value = newDate;
|
|
1750
|
-
this.ezChange.emit();
|
|
1797
|
+
this.ezChange.emit(this.value);
|
|
1751
1798
|
}
|
|
1752
1799
|
selectHours(hour) {
|
|
1753
1800
|
if (!this.value) {
|
|
1754
1801
|
this.value = new Date();
|
|
1755
1802
|
}
|
|
1756
1803
|
this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), hour, this.value.getMinutes(), this.value.getSeconds());
|
|
1757
|
-
this.ezChange.emit();
|
|
1804
|
+
this.ezChange.emit(this.value);
|
|
1758
1805
|
}
|
|
1759
1806
|
selectMinutes(minute) {
|
|
1760
1807
|
if (!this.value) {
|
|
1761
1808
|
this.value = new Date();
|
|
1762
1809
|
}
|
|
1763
1810
|
this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), minute, this.value.getSeconds());
|
|
1764
|
-
this.ezChange.emit();
|
|
1811
|
+
this.ezChange.emit(this.value);
|
|
1765
1812
|
}
|
|
1766
1813
|
selectSeconds(second) {
|
|
1767
1814
|
if (!this.value) {
|
|
1768
1815
|
this.value = new Date();
|
|
1769
1816
|
}
|
|
1770
1817
|
this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), this.value.getMinutes(), second);
|
|
1771
|
-
this.ezChange.emit();
|
|
1818
|
+
this.ezChange.emit(this.value);
|
|
1772
1819
|
}
|
|
1773
1820
|
updateScroll(element) {
|
|
1774
1821
|
if (element) {
|
|
@@ -1953,7 +2000,7 @@ let EzCollapsibleBox$1 = class extends HTMLElement$1 {
|
|
|
1953
2000
|
this.iconPlacement = "left";
|
|
1954
2001
|
}
|
|
1955
2002
|
observeValue() {
|
|
1956
|
-
this.ezChange.emit();
|
|
2003
|
+
this.ezChange.emit(this.value);
|
|
1957
2004
|
}
|
|
1958
2005
|
/**
|
|
1959
2006
|
* Esconde ou revela o conteúdo do componente
|
|
@@ -2027,6 +2074,18 @@ let EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2027
2074
|
this._preSelection = undefined;
|
|
2028
2075
|
this.updateVisibleOptions();
|
|
2029
2076
|
}
|
|
2077
|
+
/**
|
|
2078
|
+
* Realiza o foco no componente de seleção
|
|
2079
|
+
*/
|
|
2080
|
+
async setFocus() {
|
|
2081
|
+
this._inputElement.setFocus();
|
|
2082
|
+
}
|
|
2083
|
+
/**
|
|
2084
|
+
* Remove o foco no componente de seleção
|
|
2085
|
+
*/
|
|
2086
|
+
async setBlur() {
|
|
2087
|
+
this._inputElement.setBlur();
|
|
2088
|
+
}
|
|
2030
2089
|
getText() {
|
|
2031
2090
|
let text = "";
|
|
2032
2091
|
const selected = this.getSelectedOption();
|
|
@@ -2272,12 +2331,26 @@ let EzDateInput$1 = class extends HTMLElement$1 {
|
|
|
2272
2331
|
this._textInput.value = this.getTextValue(this.value);
|
|
2273
2332
|
}
|
|
2274
2333
|
}
|
|
2334
|
+
/**
|
|
2335
|
+
* Realiza o foco no componente de data
|
|
2336
|
+
*/
|
|
2337
|
+
async setFocus() {
|
|
2338
|
+
this._textInput.setFocus();
|
|
2339
|
+
}
|
|
2340
|
+
/**
|
|
2341
|
+
* Remove o foco no componente de data
|
|
2342
|
+
*/
|
|
2343
|
+
async setBlur() {
|
|
2344
|
+
this._textInput.setBlur();
|
|
2345
|
+
}
|
|
2275
2346
|
changeValue(newValue) {
|
|
2276
|
-
|
|
2347
|
+
var _a;
|
|
2348
|
+
newValue = newValue instanceof Date ? DateUtils.clearTime(newValue) : null;
|
|
2349
|
+
this.value = this.value instanceof Date ? DateUtils.clearTime(this.value) : null;
|
|
2277
2350
|
this._textInput.errorMessage = "";
|
|
2278
|
-
if (newValue !== this.value) {
|
|
2351
|
+
if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
|
|
2279
2352
|
this.value = newValue;
|
|
2280
|
-
this.ezChange.emit();
|
|
2353
|
+
this.ezChange.emit(this.value);
|
|
2281
2354
|
}
|
|
2282
2355
|
}
|
|
2283
2356
|
showCalendar() {
|
|
@@ -2357,6 +2430,18 @@ let EzDateTimeInput$1 = class extends HTMLElement$1 {
|
|
|
2357
2430
|
this._textInput.value = this.getTextValue(this.value);
|
|
2358
2431
|
}
|
|
2359
2432
|
}
|
|
2433
|
+
/**
|
|
2434
|
+
* Realiza o foco no componente de datetime
|
|
2435
|
+
*/
|
|
2436
|
+
async setFocus() {
|
|
2437
|
+
this._textInput.setFocus();
|
|
2438
|
+
}
|
|
2439
|
+
/**
|
|
2440
|
+
* Remove o foco no componente de datetime
|
|
2441
|
+
*/
|
|
2442
|
+
async setBlur() {
|
|
2443
|
+
this._textInput.setBlur();
|
|
2444
|
+
}
|
|
2360
2445
|
onChangeKeyDown(ev) {
|
|
2361
2446
|
const input = this._textInput.shadowRoot.querySelector('input');
|
|
2362
2447
|
if (ev.key === "H" || ev.key === "h") {
|
|
@@ -2397,10 +2482,11 @@ let EzDateTimeInput$1 = class extends HTMLElement$1 {
|
|
|
2397
2482
|
input.setSelectionRange(selectIni, selectFin);
|
|
2398
2483
|
}
|
|
2399
2484
|
changeValue(newValue) {
|
|
2485
|
+
var _a;
|
|
2400
2486
|
this._textInput.errorMessage = "";
|
|
2401
|
-
if (newValue !== this.value) {
|
|
2487
|
+
if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
|
|
2402
2488
|
this.value = newValue;
|
|
2403
|
-
this.ezChange.emit();
|
|
2489
|
+
this.ezChange.emit(this.value);
|
|
2404
2490
|
}
|
|
2405
2491
|
}
|
|
2406
2492
|
showCalendar() {
|
|
@@ -113474,6 +113560,12 @@ class AgGridController {
|
|
|
113474
113560
|
}
|
|
113475
113561
|
this._gridOptions.api.setRowData(data);
|
|
113476
113562
|
}
|
|
113563
|
+
refresh() {
|
|
113564
|
+
if (this._grid === undefined) {
|
|
113565
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
113566
|
+
}
|
|
113567
|
+
this._gridOptions.api.refreshServerSideStore({ purge: false });
|
|
113568
|
+
}
|
|
113477
113569
|
setColumnsDef(cols, showCheckSelection) {
|
|
113478
113570
|
if (this._grid === undefined) {
|
|
113479
113571
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
@@ -113667,6 +113759,13 @@ class DataUnitBridge {
|
|
|
113667
113759
|
case Action.METADATA_LOADED:
|
|
113668
113760
|
this._gridController.setColumnsDef(this.buildColumnDefs(), true);
|
|
113669
113761
|
break;
|
|
113762
|
+
case Action.RECORDS_REMOVED:
|
|
113763
|
+
case Action.EDITION_CANCELED:
|
|
113764
|
+
case Action.RECORDS_ADDED:
|
|
113765
|
+
case Action.RECORDS_COPIED:
|
|
113766
|
+
case Action.DATA_SAVED:
|
|
113767
|
+
this._gridController.refresh();
|
|
113768
|
+
break;
|
|
113670
113769
|
}
|
|
113671
113770
|
}
|
|
113672
113771
|
buildColumnDefs() {
|
|
@@ -114515,6 +114614,18 @@ let EzNumberInput$1 = class extends HTMLElement$1 {
|
|
|
114515
114614
|
this._textInput.value = this.getTextValue(this.value);
|
|
114516
114615
|
}
|
|
114517
114616
|
}
|
|
114617
|
+
/**
|
|
114618
|
+
* Realiza o foco no componente de input
|
|
114619
|
+
*/
|
|
114620
|
+
async setFocus() {
|
|
114621
|
+
this._textInput.setFocus();
|
|
114622
|
+
}
|
|
114623
|
+
/**
|
|
114624
|
+
* Remove o foco no componente de input
|
|
114625
|
+
*/
|
|
114626
|
+
async setBlur() {
|
|
114627
|
+
this._textInput.setBlur();
|
|
114628
|
+
}
|
|
114518
114629
|
changeValue(newValue) {
|
|
114519
114630
|
this.errorMessage = "";
|
|
114520
114631
|
if (newValue && newValue !== this.value) {
|
|
@@ -114742,6 +114853,18 @@ let EzSearch$1 = class extends HTMLElement$1 {
|
|
|
114742
114853
|
this._comboElement.value = this.value;
|
|
114743
114854
|
}
|
|
114744
114855
|
}
|
|
114856
|
+
/**
|
|
114857
|
+
* Realiza o foco no componente de pesquisa
|
|
114858
|
+
*/
|
|
114859
|
+
async setFocus() {
|
|
114860
|
+
this._comboElement.setFocus();
|
|
114861
|
+
}
|
|
114862
|
+
/**
|
|
114863
|
+
* Remove o foco no componente de pesquisa
|
|
114864
|
+
*/
|
|
114865
|
+
async setBlur() {
|
|
114866
|
+
this._comboElement.setBlur();
|
|
114867
|
+
}
|
|
114745
114868
|
onComboChange(evt) {
|
|
114746
114869
|
evt.stopPropagation();
|
|
114747
114870
|
this.value = evt.detail;
|
|
@@ -115512,7 +115635,7 @@ class RemoteFile {
|
|
|
115512
115635
|
}
|
|
115513
115636
|
}
|
|
115514
115637
|
|
|
115515
|
-
const ezUploadCss = ":host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--ez-upload__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--ez-upload--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
115638
|
+
const ezUploadCss = ":host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--ez-upload__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--ez-upload--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.appearanceNone{width:0px;height:0px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
115516
115639
|
|
|
115517
115640
|
let EzUpload$1 = class extends HTMLElement$1 {
|
|
115518
115641
|
constructor() {
|
|
@@ -115575,6 +115698,18 @@ let EzUpload$1 = class extends HTMLElement$1 {
|
|
|
115575
115698
|
}
|
|
115576
115699
|
Array.prototype.forEach.call(files, this.addFile.bind(this));
|
|
115577
115700
|
}
|
|
115701
|
+
/**
|
|
115702
|
+
* Realiza o foco no componente de upload
|
|
115703
|
+
*/
|
|
115704
|
+
async setFocus() {
|
|
115705
|
+
this._fileInput.focus();
|
|
115706
|
+
}
|
|
115707
|
+
/**
|
|
115708
|
+
* Remove o foco no componente de upload
|
|
115709
|
+
*/
|
|
115710
|
+
async setBlur() {
|
|
115711
|
+
this._fileInput.blur();
|
|
115712
|
+
}
|
|
115578
115713
|
async addFile(file) {
|
|
115579
115714
|
const oldFile = this._filePointers.get(file.name);
|
|
115580
115715
|
if (oldFile) {
|
|
@@ -115724,7 +115859,7 @@ let EzUpload$1 = class extends HTMLElement$1 {
|
|
|
115724
115859
|
}
|
|
115725
115860
|
}
|
|
115726
115861
|
render() {
|
|
115727
|
-
return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") }, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu_header" }, this.label ? h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null, h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura"))), this.buildFooter()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true,
|
|
115862
|
+
return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") }, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu_header" }, this.label ? h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null, h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura"))), this.buildFooter()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, class: "appearanceNone" })));
|
|
115728
115863
|
}
|
|
115729
115864
|
buildFooter() {
|
|
115730
115865
|
if (this._filePointers.size === 0) {
|
|
@@ -116033,6 +116168,13 @@ let TestDu$1 = class extends HTMLElement$1 {
|
|
|
116033
116168
|
super();
|
|
116034
116169
|
this.__registerHost();
|
|
116035
116170
|
}
|
|
116171
|
+
/*private _ezButton// : HTMLEzButton;
|
|
116172
|
+
private _ezComboBox// : HTMLEzComboBox;
|
|
116173
|
+
private _ezDateInput// : HTMLEzDateInput;
|
|
116174
|
+
private _ezDateTimeInput// : HTMLEzDateTimeInput;
|
|
116175
|
+
private _ezNumberInput// : HTMLEzNumberInput
|
|
116176
|
+
private _ezSearch// : HTMLEzSearch
|
|
116177
|
+
private _ezUpload// : HTMLEzUpload*/
|
|
116036
116178
|
componentWillLoad() {
|
|
116037
116179
|
this.dataUnit = new DataUnit("testes_com_formulario");
|
|
116038
116180
|
this.dataUnit.metadata = {
|
|
@@ -570,6 +570,7 @@ var Action;
|
|
|
570
570
|
Action["DATA_LOADED"] = "dataLoaded";
|
|
571
571
|
Action["SAVING_DATA"] = "savingData";
|
|
572
572
|
Action["DATA_SAVED"] = "dataSaved";
|
|
573
|
+
Action["REMOVING_RECORDS"] = "removingRecords";
|
|
573
574
|
Action["RECORDS_REMOVED"] = "recordsRemoved";
|
|
574
575
|
Action["RECORDS_ADDED"] = "recordsAdded";
|
|
575
576
|
Action["RECORDS_COPIED"] = "recordsCopied";
|
|
@@ -734,7 +735,11 @@ class RemovedRecordsReducerImpl {
|
|
|
734
735
|
reduce(_stateManager, currentState, action) {
|
|
735
736
|
switch (action.type) {
|
|
736
737
|
case Action.RECORDS_REMOVED:
|
|
737
|
-
|
|
738
|
+
const { records, buffered } = action.payload;
|
|
739
|
+
if (buffered) {
|
|
740
|
+
return (currentState || []).concat(records);
|
|
741
|
+
}
|
|
742
|
+
return currentState;
|
|
738
743
|
case Action.EDITION_CANCELED:
|
|
739
744
|
case Action.DATA_SAVED:
|
|
740
745
|
return undefined;
|
|
@@ -755,6 +760,12 @@ class RecordsReducerImpl {
|
|
|
755
760
|
switch (action.type) {
|
|
756
761
|
case Action.DATA_LOADED:
|
|
757
762
|
return action.payload;
|
|
763
|
+
case Action.RECORDS_REMOVED:
|
|
764
|
+
const { records, buffered } = action.payload;
|
|
765
|
+
if (!buffered) {
|
|
766
|
+
return currentState.filter(r => !records.includes(r.__record__id__));
|
|
767
|
+
}
|
|
768
|
+
return currentState;
|
|
758
769
|
case Action.DATA_SAVED:
|
|
759
770
|
const recordsMap = new Map();
|
|
760
771
|
const currentRecords = getRecords(stateManager);
|
|
@@ -928,7 +939,7 @@ class SelectionReducerImpl {
|
|
|
928
939
|
case Action.DATA_SAVED:
|
|
929
940
|
return updateSavedIds(stateManager, action.payload.records);
|
|
930
941
|
case Action.RECORDS_REMOVED:
|
|
931
|
-
const removed = action.payload;
|
|
942
|
+
const removed = action.payload.records;
|
|
932
943
|
if (currentState && removed) {
|
|
933
944
|
return currentState.filter(recordId => !removed.includes(recordId));
|
|
934
945
|
}
|
|
@@ -1118,6 +1129,36 @@ class DataUnit {
|
|
|
1118
1129
|
return Promise.resolve();
|
|
1119
1130
|
});
|
|
1120
1131
|
}
|
|
1132
|
+
removeSelectedRecords(buffered = false) {
|
|
1133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1134
|
+
const selection = getSelection(this._stateManager);
|
|
1135
|
+
if (selection) {
|
|
1136
|
+
return this.removeRecords(selection, buffered);
|
|
1137
|
+
}
|
|
1138
|
+
return Promise.resolve(selection);
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
removeRecords(records, buffered = false) {
|
|
1142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1143
|
+
if (records) {
|
|
1144
|
+
if (buffered || !this.removeLoader) {
|
|
1145
|
+
this.dispatchAction(Action.RECORDS_REMOVED, { records, buffered: true });
|
|
1146
|
+
}
|
|
1147
|
+
else {
|
|
1148
|
+
this.dispatchAction(Action.REMOVING_RECORDS);
|
|
1149
|
+
return new Promise((resolve, fail) => {
|
|
1150
|
+
if (this.removeLoader) {
|
|
1151
|
+
this.removeLoader(this, records).then(records => {
|
|
1152
|
+
this.dispatchAction(Action.RECORDS_REMOVED, { records, buffered: false });
|
|
1153
|
+
resolve(records);
|
|
1154
|
+
}).catch(error => fail(error));
|
|
1155
|
+
}
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
return Promise.resolve(records);
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1121
1162
|
// API
|
|
1122
1163
|
valueFromString(fieldName, value) {
|
|
1123
1164
|
const descriptor = this.getField(fieldName);
|
|
@@ -1157,12 +1198,6 @@ class DataUnit {
|
|
|
1157
1198
|
this.dispatchAction(Action.RECORDS_COPIED, prepareAddedRecordId(this._stateManager, selectedRecords));
|
|
1158
1199
|
}
|
|
1159
1200
|
}
|
|
1160
|
-
removeSelectedRecords() {
|
|
1161
|
-
const selection = getSelection(this._stateManager);
|
|
1162
|
-
if (selection) {
|
|
1163
|
-
this.dispatchAction(Action.RECORDS_REMOVED, selection);
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
1201
|
getFieldValue(fieldName) {
|
|
1167
1202
|
return getFieldValue(this._stateManager, fieldName);
|
|
1168
1203
|
}
|
|
@@ -18,6 +18,18 @@ let EzButton = class {
|
|
|
18
18
|
*/
|
|
19
19
|
this.size = "medium";
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Realiza o foco no botão
|
|
23
|
+
*/
|
|
24
|
+
async setFocus() {
|
|
25
|
+
this._button.focus();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Remove o foco no botão
|
|
29
|
+
*/
|
|
30
|
+
async setBlur() {
|
|
31
|
+
this._button.blur();
|
|
32
|
+
}
|
|
21
33
|
getIconSize() {
|
|
22
34
|
return this.size;
|
|
23
35
|
}
|
|
@@ -39,22 +51,22 @@ let EzButton = class {
|
|
|
39
51
|
}
|
|
40
52
|
render() {
|
|
41
53
|
if (this.mode == "icon") {
|
|
42
|
-
return (h("button", { class: "icon " + this.size, type: "button", disabled: !this.enabled }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
|
|
54
|
+
return (h("button", { class: "icon " + this.size, type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
|
|
43
55
|
if (!this.enabled)
|
|
44
56
|
evt.stopPropagation();
|
|
45
57
|
} })));
|
|
46
58
|
}
|
|
47
59
|
else if (this.mode == "label-icon") {
|
|
48
|
-
return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: "large", onClick: evt => {
|
|
60
|
+
return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: "large", onClick: evt => {
|
|
49
61
|
if (!this.enabled)
|
|
50
62
|
evt.stopPropagation();
|
|
51
63
|
} })), h("label", { title: this.label }, this.label)));
|
|
52
64
|
}
|
|
53
65
|
else if (this.mode == "link") {
|
|
54
|
-
return (h("a", { class: this.size }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
66
|
+
return (h("a", { class: this.size, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
55
67
|
}
|
|
56
68
|
else {
|
|
57
|
-
return (h("button", { type: "button", disabled: !this.enabled }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
69
|
+
return (h("button", { type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
};
|