@sankhyalabs/ezui 1.1.111 → 1.1.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-form.cjs.entry.js +4 -4
- package/dist/cjs/ez-grid.cjs.entry.js +74 -12
- package/dist/cjs/ez-search.cjs.entry.js +5 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +2 -2
- package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +14 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +60 -11
- package/dist/collection/components/ez-search/ez-search.js +24 -2
- package/dist/custom-elements/index.js +84 -18
- package/dist/esm/ez-form.entry.js +4 -4
- package/dist/esm/ez-grid.entry.js +74 -12
- package/dist/esm/ez-search.entry.js +5 -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-3602ab8c.entry.js +1 -0
- package/dist/ezui/{p-a038e7a5.entry.js → p-3cd17150.entry.js} +1 -1
- package/dist/ezui/p-fb73f557.entry.js +1 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +2 -1
- package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +16 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -0
- package/dist/types/components/ez-search/ez-search.d.ts +4 -0
- package/dist/types/components.d.ts +10 -2
- package/package.json +6 -36
- package/dist/ezui/p-3662c09e.entry.js +0 -1
- package/dist/ezui/p-3c954800.entry.js +0 -1
|
@@ -27,7 +27,7 @@ function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
|
27
27
|
index.h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
30
|
+
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
31
31
|
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
32
32
|
let options;
|
|
33
33
|
if (typeof prop === "string") {
|
|
@@ -38,12 +38,12 @@ const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
|
38
38
|
options = prop;
|
|
39
39
|
}
|
|
40
40
|
return (index.h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
|
|
41
|
-
index.h("ez-combo-box", { enabled: !readOnly, label: label, "data-field-name": name, key: name, options: options })));
|
|
41
|
+
index.h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const buildSearch = ({ name, label, readOnly }) => {
|
|
44
|
+
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
45
45
|
return (index.h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
|
|
46
|
-
index.h("ez-search", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
46
|
+
index.h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const buildFile = ({ name, label, readOnly }) => {
|
|
@@ -110061,11 +110061,14 @@ class DataSource {
|
|
|
110061
110061
|
class AgGridController {
|
|
110062
110062
|
constructor(enterprise) {
|
|
110063
110063
|
this._menuItems = [];
|
|
110064
|
+
this._idAttribName = "__record__id__";
|
|
110064
110065
|
this._enterprise = enterprise;
|
|
110065
110066
|
}
|
|
110066
110067
|
getSort() {
|
|
110067
110068
|
const sortedColumns = [];
|
|
110068
|
-
this._gridOptions.
|
|
110069
|
+
this._gridOptions.columnApi.getColumnState()
|
|
110070
|
+
.sort((colA, colB) => colA.sortIndex - colB.sortIndex)
|
|
110071
|
+
.forEach(({ colId, sort }) => {
|
|
110069
110072
|
if (sort) {
|
|
110070
110073
|
const field = this._dataUnit.getField(colId);
|
|
110071
110074
|
const mode = sort === "asc" ? UnitMetadata.SortMode.ASC : UnitMetadata.SortMode.DESC;
|
|
@@ -110090,10 +110093,9 @@ class AgGridController {
|
|
|
110090
110093
|
this._gridOptions = {
|
|
110091
110094
|
localeText: gridTerms,
|
|
110092
110095
|
rowModelType: "serverSide",
|
|
110093
|
-
serverSideStoreType: "partial",
|
|
110094
110096
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
110095
110097
|
serverSideDatasource: new DataSource(this._dataUnit, this._serverURL),
|
|
110096
|
-
getRowNodeId: (params) => params.
|
|
110098
|
+
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
110097
110099
|
getMainMenuItems: (params) => {
|
|
110098
110100
|
const column = params.column;
|
|
110099
110101
|
const items = [column.isPinned() ? "clearPinned" : "pinLeft", "separator"];
|
|
@@ -110103,14 +110105,9 @@ class AgGridController {
|
|
|
110103
110105
|
}));
|
|
110104
110106
|
return items;
|
|
110105
110107
|
},
|
|
110106
|
-
onViewportChanged: (
|
|
110107
|
-
if (this.
|
|
110108
|
-
|
|
110109
|
-
this._dataUnit.getSelection().forEach(id => {
|
|
110110
|
-
let node = evt.api.getRowNode(id);
|
|
110111
|
-
node.setSelected(true);
|
|
110112
|
-
});
|
|
110113
|
-
}
|
|
110108
|
+
onViewportChanged: () => {
|
|
110109
|
+
if (this._dataUnit) {
|
|
110110
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
110114
110111
|
}
|
|
110115
110112
|
}
|
|
110116
110113
|
};
|
|
@@ -110151,6 +110148,58 @@ class AgGridController {
|
|
|
110151
110148
|
}
|
|
110152
110149
|
this._gridOptions.api.setRowData(data);
|
|
110153
110150
|
}
|
|
110151
|
+
addRows(rows) {
|
|
110152
|
+
if (this._grid === undefined) {
|
|
110153
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110154
|
+
}
|
|
110155
|
+
this._gridOptions.api.applyServerSideTransaction({ add: rows });
|
|
110156
|
+
}
|
|
110157
|
+
selectRows(rowIds) {
|
|
110158
|
+
if (this._grid === undefined) {
|
|
110159
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110160
|
+
}
|
|
110161
|
+
if (rowIds && rowIds.length > 0) {
|
|
110162
|
+
rowIds.forEach(rowId => {
|
|
110163
|
+
const row = this._gridOptions.api.getRowNode(rowId);
|
|
110164
|
+
if (row) {
|
|
110165
|
+
row.setSelected(true);
|
|
110166
|
+
}
|
|
110167
|
+
});
|
|
110168
|
+
}
|
|
110169
|
+
}
|
|
110170
|
+
removeRows(rowIds) {
|
|
110171
|
+
if (this._grid === undefined) {
|
|
110172
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110173
|
+
}
|
|
110174
|
+
this._gridOptions.api.applyServerSideTransaction({ remove: rowIds });
|
|
110175
|
+
}
|
|
110176
|
+
changeValues(changes, rowIds) {
|
|
110177
|
+
if (this._grid === undefined) {
|
|
110178
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110179
|
+
}
|
|
110180
|
+
if (changes) {
|
|
110181
|
+
let rowNodes;
|
|
110182
|
+
if (rowIds) {
|
|
110183
|
+
rowNodes = [];
|
|
110184
|
+
rowIds.forEach(id => {
|
|
110185
|
+
const rowNode = this._gridOptions.api.getRowNode(id);
|
|
110186
|
+
if (rowNode) {
|
|
110187
|
+
rowNodes.push(rowNode);
|
|
110188
|
+
}
|
|
110189
|
+
});
|
|
110190
|
+
}
|
|
110191
|
+
else {
|
|
110192
|
+
rowNodes = this._gridOptions.api.getSelectedNodes();
|
|
110193
|
+
}
|
|
110194
|
+
rowNodes.forEach(r => {
|
|
110195
|
+
const data = r.data;
|
|
110196
|
+
Object.entries(changes).forEach(([field, value]) => {
|
|
110197
|
+
data[field] = value;
|
|
110198
|
+
});
|
|
110199
|
+
r.setData(data);
|
|
110200
|
+
});
|
|
110201
|
+
}
|
|
110202
|
+
}
|
|
110154
110203
|
refresh() {
|
|
110155
110204
|
if (this._grid === undefined) {
|
|
110156
110205
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
@@ -110358,12 +110407,25 @@ class DataUnitBridge {
|
|
|
110358
110407
|
this._gridController.setColumnsDef(this.buildColumnDefs(), true);
|
|
110359
110408
|
break;
|
|
110360
110409
|
case core.Action.RECORDS_REMOVED:
|
|
110361
|
-
|
|
110410
|
+
const { records } = action.payload;
|
|
110411
|
+
this._gridController.removeRows(records);
|
|
110412
|
+
break;
|
|
110362
110413
|
case core.Action.RECORDS_ADDED:
|
|
110363
110414
|
case core.Action.RECORDS_COPIED:
|
|
110415
|
+
this._gridController.addRows(action.payload);
|
|
110416
|
+
break;
|
|
110417
|
+
case core.Action.EDITION_CANCELED:
|
|
110364
110418
|
case core.Action.DATA_SAVED:
|
|
110365
110419
|
this._gridController.refresh();
|
|
110366
110420
|
break;
|
|
110421
|
+
case core.Action.SELECTION_CHANGED:
|
|
110422
|
+
const { selection } = action.payload;
|
|
110423
|
+
this._gridController.selectRows(selection);
|
|
110424
|
+
break;
|
|
110425
|
+
case core.Action.DATA_CHANGED:
|
|
110426
|
+
const changes = Object.assign({}, action.payload);
|
|
110427
|
+
delete changes.records;
|
|
110428
|
+
this._gridController.changeValues(changes, action.payload.records);
|
|
110367
110429
|
}
|
|
110368
110430
|
}
|
|
110369
110431
|
buildColumnDefs() {
|
|
@@ -24,6 +24,10 @@ let EzSearch = class {
|
|
|
24
24
|
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
25
25
|
*/
|
|
26
26
|
this.showOptionValue = true;
|
|
27
|
+
/**
|
|
28
|
+
* Remove a opção vazia da lista de opções
|
|
29
|
+
*/
|
|
30
|
+
this.suppressEmptyOption = false;
|
|
27
31
|
}
|
|
28
32
|
updateValue() {
|
|
29
33
|
if (this._comboElement) {
|
|
@@ -51,7 +55,7 @@ let EzSearch = class {
|
|
|
51
55
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
52
56
|
}
|
|
53
57
|
render() {
|
|
54
|
-
return (index.h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue }));
|
|
58
|
+
return (index.h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption }));
|
|
55
59
|
}
|
|
56
60
|
;
|
|
57
61
|
get _elem() { return index.getElement(this); }
|
package/dist/cjs/ezui.cjs.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"setFocus":[64],"setBlur":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"setFocus":[64],"setBlur":[64]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"setFocus":[64],"setBlur":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du.cjs",[[0,"test-du"]]]], options);
|
|
18
|
+
return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"setFocus":[64],"setBlur":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"setFocus":[64],"setBlur":[64]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"setFocus":[64],"setBlur":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du.cjs",[[0,"test-du"]]]], options);
|
|
19
19
|
});
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"setFocus":[64],"setBlur":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"setFocus":[64],"setBlur":[64]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"setFocus":[64],"setBlur":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du.cjs",[[0,"test-du"]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpVisible":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"setFocus":[64],"setBlur":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"setFocus":[64],"setBlur":[64]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"setFocus":[64],"setBlur":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"_preSelection":[32],"_visibleOptions":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du.cjs",[[0,"test-du"]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
2
|
+
export const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
3
3
|
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
4
4
|
let options;
|
|
5
5
|
if (typeof prop === "string") {
|
|
@@ -10,5 +10,5 @@ export const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
|
10
10
|
options = prop;
|
|
11
11
|
}
|
|
12
12
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
|
|
13
|
-
h("ez-combo-box", { enabled: !readOnly, label: label, "data-field-name": name, key: name, options: options })));
|
|
13
|
+
h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
14
14
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildSearch = ({ name, label, readOnly }) => {
|
|
2
|
+
export const buildSearch = ({ name, label, readOnly, required }) => {
|
|
3
3
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
|
|
4
|
-
h("ez-search", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
4
|
+
h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
5
5
|
};
|
|
@@ -11,12 +11,25 @@ export default class DataUnitBridge {
|
|
|
11
11
|
this._gridController.setColumnsDef(this.buildColumnDefs(), true);
|
|
12
12
|
break;
|
|
13
13
|
case Action.RECORDS_REMOVED:
|
|
14
|
-
|
|
14
|
+
const { records } = action.payload;
|
|
15
|
+
this._gridController.removeRows(records);
|
|
16
|
+
break;
|
|
15
17
|
case Action.RECORDS_ADDED:
|
|
16
18
|
case Action.RECORDS_COPIED:
|
|
19
|
+
this._gridController.addRows(action.payload);
|
|
20
|
+
break;
|
|
21
|
+
case Action.EDITION_CANCELED:
|
|
17
22
|
case Action.DATA_SAVED:
|
|
18
23
|
this._gridController.refresh();
|
|
19
24
|
break;
|
|
25
|
+
case Action.SELECTION_CHANGED:
|
|
26
|
+
const { selection } = action.payload;
|
|
27
|
+
this._gridController.selectRows(selection);
|
|
28
|
+
break;
|
|
29
|
+
case Action.DATA_CHANGED:
|
|
30
|
+
const changes = Object.assign({}, action.payload);
|
|
31
|
+
delete changes.records;
|
|
32
|
+
this._gridController.changeValues(changes, action.payload.records);
|
|
20
33
|
}
|
|
21
34
|
}
|
|
22
35
|
buildColumnDefs() {
|
|
@@ -8,11 +8,14 @@ import { SortMode, UserInterface } from "@sankhyalabs/core/dist/dataunit/metadat
|
|
|
8
8
|
export default class AgGridController {
|
|
9
9
|
constructor(enterprise) {
|
|
10
10
|
this._menuItems = [];
|
|
11
|
+
this._idAttribName = "__record__id__";
|
|
11
12
|
this._enterprise = enterprise;
|
|
12
13
|
}
|
|
13
14
|
getSort() {
|
|
14
15
|
const sortedColumns = [];
|
|
15
|
-
this._gridOptions.
|
|
16
|
+
this._gridOptions.columnApi.getColumnState()
|
|
17
|
+
.sort((colA, colB) => colA.sortIndex - colB.sortIndex)
|
|
18
|
+
.forEach(({ colId, sort }) => {
|
|
16
19
|
if (sort) {
|
|
17
20
|
const field = this._dataUnit.getField(colId);
|
|
18
21
|
const mode = sort === "asc" ? SortMode.ASC : SortMode.DESC;
|
|
@@ -37,10 +40,9 @@ export default class AgGridController {
|
|
|
37
40
|
this._gridOptions = {
|
|
38
41
|
localeText: gridTerms,
|
|
39
42
|
rowModelType: "serverSide",
|
|
40
|
-
serverSideStoreType: "partial",
|
|
41
43
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
42
44
|
serverSideDatasource: new DataSource(this._dataUnit, this._serverURL),
|
|
43
|
-
getRowNodeId: (params) => params.
|
|
45
|
+
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
44
46
|
getMainMenuItems: (params) => {
|
|
45
47
|
const column = params.column;
|
|
46
48
|
const items = [column.isPinned() ? "clearPinned" : "pinLeft", "separator"];
|
|
@@ -50,14 +52,9 @@ export default class AgGridController {
|
|
|
50
52
|
}));
|
|
51
53
|
return items;
|
|
52
54
|
},
|
|
53
|
-
onViewportChanged: (
|
|
54
|
-
if (this.
|
|
55
|
-
|
|
56
|
-
this._dataUnit.getSelection().forEach(id => {
|
|
57
|
-
let node = evt.api.getRowNode(id);
|
|
58
|
-
node.setSelected(true);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
55
|
+
onViewportChanged: () => {
|
|
56
|
+
if (this._dataUnit) {
|
|
57
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
60
|
};
|
|
@@ -98,6 +95,58 @@ export default class AgGridController {
|
|
|
98
95
|
}
|
|
99
96
|
this._gridOptions.api.setRowData(data);
|
|
100
97
|
}
|
|
98
|
+
addRows(rows) {
|
|
99
|
+
if (this._grid === undefined) {
|
|
100
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
101
|
+
}
|
|
102
|
+
this._gridOptions.api.applyServerSideTransaction({ add: rows });
|
|
103
|
+
}
|
|
104
|
+
selectRows(rowIds) {
|
|
105
|
+
if (this._grid === undefined) {
|
|
106
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
107
|
+
}
|
|
108
|
+
if (rowIds && rowIds.length > 0) {
|
|
109
|
+
rowIds.forEach(rowId => {
|
|
110
|
+
const row = this._gridOptions.api.getRowNode(rowId);
|
|
111
|
+
if (row) {
|
|
112
|
+
row.setSelected(true);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
removeRows(rowIds) {
|
|
118
|
+
if (this._grid === undefined) {
|
|
119
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
120
|
+
}
|
|
121
|
+
this._gridOptions.api.applyServerSideTransaction({ remove: rowIds });
|
|
122
|
+
}
|
|
123
|
+
changeValues(changes, rowIds) {
|
|
124
|
+
if (this._grid === undefined) {
|
|
125
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
126
|
+
}
|
|
127
|
+
if (changes) {
|
|
128
|
+
let rowNodes;
|
|
129
|
+
if (rowIds) {
|
|
130
|
+
rowNodes = [];
|
|
131
|
+
rowIds.forEach(id => {
|
|
132
|
+
const rowNode = this._gridOptions.api.getRowNode(id);
|
|
133
|
+
if (rowNode) {
|
|
134
|
+
rowNodes.push(rowNode);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
rowNodes = this._gridOptions.api.getSelectedNodes();
|
|
140
|
+
}
|
|
141
|
+
rowNodes.forEach(r => {
|
|
142
|
+
const data = r.data;
|
|
143
|
+
Object.entries(changes).forEach(([field, value]) => {
|
|
144
|
+
data[field] = value;
|
|
145
|
+
});
|
|
146
|
+
r.setData(data);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
101
150
|
refresh() {
|
|
102
151
|
if (this._grid === undefined) {
|
|
103
152
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
@@ -14,6 +14,10 @@ export class EzSearch {
|
|
|
14
14
|
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
15
15
|
*/
|
|
16
16
|
this.showOptionValue = true;
|
|
17
|
+
/**
|
|
18
|
+
* Remove a opção vazia da lista de opções
|
|
19
|
+
*/
|
|
20
|
+
this.suppressEmptyOption = false;
|
|
17
21
|
}
|
|
18
22
|
updateValue() {
|
|
19
23
|
if (this._comboElement) {
|
|
@@ -41,7 +45,7 @@ export class EzSearch {
|
|
|
41
45
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
42
46
|
}
|
|
43
47
|
render() {
|
|
44
|
-
return (h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue }));
|
|
48
|
+
return (h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption }));
|
|
45
49
|
}
|
|
46
50
|
;
|
|
47
51
|
static get is() { return "ez-search"; }
|
|
@@ -57,7 +61,7 @@ export class EzSearch {
|
|
|
57
61
|
"type": "string",
|
|
58
62
|
"mutable": true,
|
|
59
63
|
"complexType": {
|
|
60
|
-
"original": "Option|string",
|
|
64
|
+
"original": "Option | string",
|
|
61
65
|
"resolved": "Option | string",
|
|
62
66
|
"references": {
|
|
63
67
|
"Option": {
|
|
@@ -181,6 +185,24 @@ export class EzSearch {
|
|
|
181
185
|
"attribute": "show-option-value",
|
|
182
186
|
"reflect": false,
|
|
183
187
|
"defaultValue": "true"
|
|
188
|
+
},
|
|
189
|
+
"suppressEmptyOption": {
|
|
190
|
+
"type": "boolean",
|
|
191
|
+
"mutable": false,
|
|
192
|
+
"complexType": {
|
|
193
|
+
"original": "boolean",
|
|
194
|
+
"resolved": "boolean",
|
|
195
|
+
"references": {}
|
|
196
|
+
},
|
|
197
|
+
"required": false,
|
|
198
|
+
"optional": false,
|
|
199
|
+
"docs": {
|
|
200
|
+
"tags": [],
|
|
201
|
+
"text": "Remove a op\u00E7\u00E3o vazia da lista de op\u00E7\u00F5es"
|
|
202
|
+
},
|
|
203
|
+
"attribute": "suppress-empty-option",
|
|
204
|
+
"reflect": false,
|
|
205
|
+
"defaultValue": "false"
|
|
184
206
|
}
|
|
185
207
|
}; }
|
|
186
208
|
static get events() { return [{
|