@sankhyalabs/ezui 1.1.130 → 1.1.133
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 +14 -3
- package/dist/cjs/ez-grid.cjs.entry.js +215 -51
- package/dist/cjs/ez-list.cjs.entry.js +11 -0
- package/dist/cjs/ez-modal.cjs.entry.js +6 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +10 -8
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/grid-config.cjs.entry.js +44 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-form/DataBinder.js +13 -2
- package/dist/collection/components/ez-form/ez-form.js +1 -1
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +10 -5
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +128 -36
- package/dist/collection/components/ez-grid/ez-grid.js +253 -15
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +44 -2
- package/dist/collection/components/ez-list/ez-list.js +27 -0
- package/dist/collection/components/ez-modal/ez-modal.js +20 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +1 -1
- package/dist/collection/components/ez-text-input/ez-text-input.js +10 -8
- package/dist/collection/utils/interfaces/PageableComponent.js +1 -0
- package/dist/custom-elements/index.js +302 -67
- package/dist/esm/ez-form.entry.js +14 -3
- package/dist/esm/ez-grid.entry.js +216 -52
- package/dist/esm/ez-list.entry.js +11 -0
- package/dist/esm/ez-modal.entry.js +6 -0
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +10 -8
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/grid-config.entry.js +44 -2
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-48ba92b2.entry.js +1 -0
- package/dist/ezui/p-4ded39c2.entry.js +1 -0
- package/dist/ezui/{p-2d165ca8.entry.js → p-80d863c2.entry.js} +7 -7
- package/dist/ezui/p-c8f9b691.entry.js +1 -0
- package/dist/ezui/{p-47fe4273.entry.js → p-cfa7378a.entry.js} +1 -1
- package/dist/ezui/p-d5c93280.entry.js +1 -0
- package/dist/ezui/p-d9bb2a96.entry.js +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +46 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +12 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +45 -4
- package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +1 -0
- package/dist/types/components/ez-list/ez-list.d.ts +4 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +5 -0
- package/dist/types/components.d.ts +49 -0
- package/dist/types/utils/interfaces/PageableComponent.d.ts +12 -0
- package/package.json +1 -1
- package/dist/ezui/p-6d39b7ea.entry.js +0 -1
- package/dist/ezui/p-7d5b2ebf.entry.js +0 -1
- package/dist/ezui/p-c6b2b2e5.entry.js +0 -1
- package/dist/ezui/p-ef8f1275.entry.js +0 -1
- package/dist/ezui/p-f65302bb.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLElement as HTMLElement$1, createEvent, h, forceUpdate, Host, getAssetPath, setAssetPath, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
2
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
3
|
-
import { FloatingManager, DateUtils, TimeFormatter, UserInterface, Action, ApplicationContext, DataUnitAction, DataUnit, DataType, StringUtils,
|
|
3
|
+
import { FloatingManager, DateUtils, TimeFormatter, UserInterface, Action, ApplicationContext, DataUnitAction, DataUnit, NumberUtils, DataType, StringUtils, MaskFormatter } from '@sankhyalabs/core';
|
|
4
4
|
import { UserInterface as UserInterface$1, SortMode } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
5
5
|
|
|
6
6
|
const ezActionChipCss = ":host{--ez-action-chip--height:36px;--ez-action-chip--border-radius:var(--border--radius-large, 24px);--ez-action-chip__border:1px solid;--ez-action-chip__border-color-strokes:var(--color--strokes, #DCE0E8);--ez-action-chip--font-size:var(--text--medium, 14px);--ez-action-chip--font-family:var(--font-pattern, Arial);--ez-action-chip--font-weight:var(--text-weight--large, 500);--ez-action-chip__label--title--primary:var(--title--primary, #919191);--ez-action-chip__label-color--disable-secondary:var(--color--disable-secondary, #F2F5F8);--ez-action-chip__label__default--background-color--hover:var(--color--primary-200, #f2faf8);--ez-action-chip__label__default--border-color--hover:var(--color--primary-600, #007a5a)}.label__container{width:fit-content;display:flex;flex-wrap:wrap;position:relative;background-color:#FFFFFF;align-items:center;align-self:center;cursor:pointer;color:var(--ez-action-chip__label--title--primary);fill:var(--ez-action-chip__label--title--primary);border:var(--ez-action-chip__border);border-radius:var(--ez-action-chip--border-radius);border-color:var(--ez-action-chip__border-color-strokes);padding-right:var(--space--medium, 12px);padding-left:var(--space--medium, 12px)}.label__container:hover{border-color:var(--ez-action-chip__label__default--border-color--hover);background-color:var(--ez-action-chip__label__default--background-color--hover)}label{display:flex;align-items:center;font-weight:var(--text-weight--large, 600);cursor:pointer;height:var(--ez-action-chip--height);font-family:var(--ez-action-chip--font-family);font-size:var(--ez-action-chip--font-size)}";
|
|
@@ -1793,7 +1793,12 @@ class DataBinder {
|
|
|
1793
1793
|
const oldValue = field["value"];
|
|
1794
1794
|
const newValue = this._dataUnit.getFieldValue(fieldName);
|
|
1795
1795
|
if (oldValue != newValue) {
|
|
1796
|
-
|
|
1796
|
+
if (newValue === undefined) {
|
|
1797
|
+
field.removeAttribute("value");
|
|
1798
|
+
}
|
|
1799
|
+
else {
|
|
1800
|
+
field["value"] = newValue;
|
|
1801
|
+
}
|
|
1797
1802
|
}
|
|
1798
1803
|
}
|
|
1799
1804
|
updateBind(fieldName, field) {
|
|
@@ -1801,7 +1806,13 @@ class DataBinder {
|
|
|
1801
1806
|
if (oldBind) {
|
|
1802
1807
|
oldBind.destroy();
|
|
1803
1808
|
}
|
|
1804
|
-
|
|
1809
|
+
const value = this._dataUnit.getFieldValue(fieldName);
|
|
1810
|
+
if (value === undefined) {
|
|
1811
|
+
field.removeAttribute("value");
|
|
1812
|
+
}
|
|
1813
|
+
else {
|
|
1814
|
+
field["value"] = value;
|
|
1815
|
+
}
|
|
1805
1816
|
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
1806
1817
|
this.bindSearchOptionsLoader(fieldName, field);
|
|
1807
1818
|
this.applyEzUploadContext(fieldName, field);
|
|
@@ -1928,7 +1939,7 @@ let EzForm$1 = class extends HTMLElement$1 {
|
|
|
1928
1939
|
.filter(f => f.dataset.required)
|
|
1929
1940
|
.map(f => f.dataset.fieldName)
|
|
1930
1941
|
.concat(metadata.getRequiredFields());
|
|
1931
|
-
const records = this.dataUnit.
|
|
1942
|
+
const records = this.dataUnit.getModifiedRecords();
|
|
1932
1943
|
for (let i = 0; i < records.length; i++) {
|
|
1933
1944
|
if (!this.validateRequired(requiredFields, records[i])) {
|
|
1934
1945
|
reject();
|
|
@@ -112090,8 +112101,11 @@ class DataSource {
|
|
|
112090
112101
|
|
|
112091
112102
|
class AgGridController {
|
|
112092
112103
|
constructor(enterprise) {
|
|
112104
|
+
this.DEFAULT_ROW_HEIGHT = 25;
|
|
112093
112105
|
this._menuItems = [];
|
|
112094
112106
|
this._idAttribName = "__record__id__";
|
|
112107
|
+
this._isFirstRecordOfPage = true;
|
|
112108
|
+
this._isLastRecordOfPage = false;
|
|
112095
112109
|
this._enterprise = enterprise;
|
|
112096
112110
|
}
|
|
112097
112111
|
getSort() {
|
|
@@ -112119,7 +112133,9 @@ class AgGridController {
|
|
|
112119
112133
|
this._pageSize = options.pageSize;
|
|
112120
112134
|
this._serverURL = options.serverURL;
|
|
112121
112135
|
this._dataUnit = options.dataUnit;
|
|
112122
|
-
this._dataUnit
|
|
112136
|
+
if (this._dataUnit) {
|
|
112137
|
+
this._dataUnit.sortingProvider = this;
|
|
112138
|
+
}
|
|
112123
112139
|
this._dataSource = new DataSource(this._dataUnit, this._serverURL);
|
|
112124
112140
|
this._gridOptions = {
|
|
112125
112141
|
localeText: gridTerms,
|
|
@@ -112128,7 +112144,7 @@ class AgGridController {
|
|
|
112128
112144
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
112129
112145
|
serverSideDatasource: this._dataSource,
|
|
112130
112146
|
sortingOrder: ['desc', 'asc', null],
|
|
112131
|
-
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
112147
|
+
getRowNodeId: this._dataUnit ? (params) => typeof params === "string" ? params : params[this._idAttribName] : undefined,
|
|
112132
112148
|
getMainMenuItems: (params) => {
|
|
112133
112149
|
const column = params.column;
|
|
112134
112150
|
const items = [column.isPinned() ? "clearPinned" : "pinLeft", "separator"];
|
|
@@ -112138,14 +112154,12 @@ class AgGridController {
|
|
|
112138
112154
|
}));
|
|
112139
112155
|
return items;
|
|
112140
112156
|
},
|
|
112141
|
-
|
|
112142
|
-
|
|
112143
|
-
|
|
112144
|
-
|
|
112145
|
-
|
|
112146
|
-
|
|
112147
|
-
return 25;
|
|
112148
|
-
}
|
|
112157
|
+
//FIXME: Existe um bug no PartialStore.prototype.destroyAllBlocks do ag-grid, pois
|
|
112158
|
+
//apesar de destruir os blocos, mantém a variável "blockHeights" com o tamanho antigo
|
|
112159
|
+
//dos blocos, então, quando removemos uma linha, a altura do bloco não é recalculada.
|
|
112160
|
+
//Descobri que setando manualmente a altura das linhas, apesar do bloco ficar com
|
|
112161
|
+
//tamanho errado, isso afeta menos o componente.
|
|
112162
|
+
rowHeight: this.DEFAULT_ROW_HEIGHT
|
|
112149
112163
|
};
|
|
112150
112164
|
this.setOptionsEvents(this._gridOptions);
|
|
112151
112165
|
this.setOptionsPagination(this._gridOptions);
|
|
@@ -112168,16 +112182,17 @@ class AgGridController {
|
|
|
112168
112182
|
opt.onPaginationChanged = () => this.onPaginationChange();
|
|
112169
112183
|
opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
|
|
112170
112184
|
opt.onDragStopped = evt => this.onCallStateChange("columnMovedEnd", evt);
|
|
112171
|
-
|
|
112172
|
-
|
|
112173
|
-
|
|
112174
|
-
|
|
112175
|
-
}
|
|
112185
|
+
}
|
|
112186
|
+
syncSelection() {
|
|
112187
|
+
if (this._dataUnit) {
|
|
112188
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
112189
|
+
}
|
|
112176
112190
|
}
|
|
112177
112191
|
setOptionsPagination(opt) {
|
|
112178
112192
|
opt.pagination = (this._pageSize > -1);
|
|
112179
112193
|
opt.paginationPageSize = this._pageSize;
|
|
112180
112194
|
opt.cacheBlockSize = this._pageSize;
|
|
112195
|
+
opt.maxBlocksInCache = 1;
|
|
112181
112196
|
}
|
|
112182
112197
|
setOptionsSupress(opt) {
|
|
112183
112198
|
opt.suppressDragLeaveHidesColumns = true;
|
|
@@ -112213,7 +112228,7 @@ class AgGridController {
|
|
|
112213
112228
|
if (this._grid === undefined) {
|
|
112214
112229
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112215
112230
|
}
|
|
112216
|
-
this._gridOptions.api.refreshServerSideStore({});
|
|
112231
|
+
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
112217
112232
|
}
|
|
112218
112233
|
changeValues(changes, rowIds) {
|
|
112219
112234
|
if (this._grid === undefined) {
|
|
@@ -112350,6 +112365,75 @@ class AgGridController {
|
|
|
112350
112365
|
this.goToPage(0);
|
|
112351
112366
|
this._gridOptions.api.refreshServerSideStore({ purge: true });
|
|
112352
112367
|
}
|
|
112368
|
+
isLastOfPage() {
|
|
112369
|
+
return this._isLastRecordOfPage;
|
|
112370
|
+
}
|
|
112371
|
+
isFirstOfPage() {
|
|
112372
|
+
return this._isFirstRecordOfPage;
|
|
112373
|
+
}
|
|
112374
|
+
previousRecord() {
|
|
112375
|
+
const pagination = this.getPaginationStatus();
|
|
112376
|
+
if (this._isFirstRecordOfPage && pagination.hasPrevious) {
|
|
112377
|
+
this.previousPage();
|
|
112378
|
+
}
|
|
112379
|
+
else {
|
|
112380
|
+
if (this._dataUnit) {
|
|
112381
|
+
this._dataUnit.previousRecord();
|
|
112382
|
+
}
|
|
112383
|
+
else {
|
|
112384
|
+
const node = this._gridOptions.api.getSelectedNodes()[0];
|
|
112385
|
+
this.setSelectedIndex(node.rowIndex - 1);
|
|
112386
|
+
}
|
|
112387
|
+
}
|
|
112388
|
+
}
|
|
112389
|
+
nextRecord() {
|
|
112390
|
+
const pagination = this.getPaginationStatus();
|
|
112391
|
+
if (this._isLastRecordOfPage && pagination.hasNext) {
|
|
112392
|
+
this.nextPage();
|
|
112393
|
+
}
|
|
112394
|
+
else {
|
|
112395
|
+
if (this._dataUnit) {
|
|
112396
|
+
this._dataUnit.nextRecord();
|
|
112397
|
+
}
|
|
112398
|
+
else {
|
|
112399
|
+
const node = this._gridOptions.api.getSelectedNodes()[0];
|
|
112400
|
+
this.setSelectedIndex(node.rowIndex + 1);
|
|
112401
|
+
}
|
|
112402
|
+
}
|
|
112403
|
+
}
|
|
112404
|
+
setSelectedIndex(index) {
|
|
112405
|
+
var _a;
|
|
112406
|
+
(_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
|
|
112407
|
+
}
|
|
112408
|
+
hasPreviousRecord() {
|
|
112409
|
+
const pagination = this.getPaginationStatus();
|
|
112410
|
+
if (this._isFirstRecordOfPage) {
|
|
112411
|
+
return pagination.hasPrevious;
|
|
112412
|
+
}
|
|
112413
|
+
else {
|
|
112414
|
+
if (this._dataUnit) {
|
|
112415
|
+
return this._dataUnit.hasPrevious();
|
|
112416
|
+
}
|
|
112417
|
+
else {
|
|
112418
|
+
return pagination.hasPrevious || this._gridOptions.api.getSelectedRows()[0].rowIndex > 0;
|
|
112419
|
+
}
|
|
112420
|
+
}
|
|
112421
|
+
}
|
|
112422
|
+
hasNextRecord() {
|
|
112423
|
+
const pagination = this.getPaginationStatus();
|
|
112424
|
+
if (this._isLastRecordOfPage) {
|
|
112425
|
+
return pagination.hasNext;
|
|
112426
|
+
}
|
|
112427
|
+
else {
|
|
112428
|
+
if (this._dataUnit) {
|
|
112429
|
+
return this._dataUnit.hasNext() || this.getPaginationStatus().hasNext;
|
|
112430
|
+
}
|
|
112431
|
+
else {
|
|
112432
|
+
const api = this._gridOptions.api;
|
|
112433
|
+
return pagination.hasNext || api.getSelectedRows()[0].rowIndex < api.getDisplayedRowCount();
|
|
112434
|
+
}
|
|
112435
|
+
}
|
|
112436
|
+
}
|
|
112353
112437
|
buildColDef(source) {
|
|
112354
112438
|
return {
|
|
112355
112439
|
headerName: source.label,
|
|
@@ -112384,19 +112468,24 @@ class AgGridController {
|
|
|
112384
112468
|
});
|
|
112385
112469
|
return optionSelected === null || optionSelected === void 0 ? void 0 : optionSelected.label;
|
|
112386
112470
|
}
|
|
112387
|
-
if ((source === null || source === void 0 ? void 0 : source.userInterface) ===
|
|
112388
|
-
if ((params === null || params === void 0 ? void 0 : params.value) === "S" || (params === null || params === void 0 ? void 0 : params.value) === true) {
|
|
112471
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.SWITCH) {
|
|
112472
|
+
if ((params === null || params === void 0 ? void 0 : params.value) === "S" || (params === null || params === void 0 ? void 0 : params.value) === true || (params === null || params === void 0 ? void 0 : params.value) === "true") {
|
|
112389
112473
|
return "Sim";
|
|
112390
112474
|
}
|
|
112391
|
-
else if ((params === null || params === void 0 ? void 0 : params.value) === "N" || (params === null || params === void 0 ? void 0 : params.value) === false) {
|
|
112475
|
+
else if ((params === null || params === void 0 ? void 0 : params.value) === "N" || (params === null || params === void 0 ? void 0 : params.value) === false || (params === null || params === void 0 ? void 0 : params.value) === "false") {
|
|
112392
112476
|
return "Não";
|
|
112393
112477
|
}
|
|
112394
112478
|
}
|
|
112395
|
-
if ((source === null || source === void 0 ? void 0 : source.userInterface) ===
|
|
112479
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.SEARCH) {
|
|
112396
112480
|
if (params.value !== undefined) {
|
|
112397
112481
|
return ((_a = params === null || params === void 0 ? void 0 : params.value) === null || _a === void 0 ? void 0 : _a.value) + " - " + ((_b = params === null || params === void 0 ? void 0 : params.value) === null || _b === void 0 ? void 0 : _b.label);
|
|
112398
112482
|
}
|
|
112399
112483
|
}
|
|
112484
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.DECIMALNUMBER) {
|
|
112485
|
+
if (params.value !== undefined) {
|
|
112486
|
+
return NumberUtils.format(params.value.toString(), 2, 2);
|
|
112487
|
+
}
|
|
112488
|
+
}
|
|
112400
112489
|
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.DATE || (source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface$1.DATETIME) {
|
|
112401
112490
|
if (params.value !== undefined) {
|
|
112402
112491
|
return params.value.toLocaleDateString();
|
|
@@ -112426,31 +112515,44 @@ class AgGridController {
|
|
|
112426
112515
|
return false;
|
|
112427
112516
|
}
|
|
112428
112517
|
onSelectionChange(e) {
|
|
112518
|
+
const selectedNodes = e.api.getSelectedNodes();
|
|
112519
|
+
if (selectedNodes.length > 0) {
|
|
112520
|
+
this._isFirstRecordOfPage = selectedNodes[0].rowIndex === e.api.getFirstDisplayedRow();
|
|
112521
|
+
this._isLastRecordOfPage = selectedNodes[0].rowIndex === e.api.getLastDisplayedRow();
|
|
112522
|
+
}
|
|
112429
112523
|
if (this._selectionChangeCallback) {
|
|
112430
|
-
this._selectionChangeCallback(
|
|
112524
|
+
this._selectionChangeCallback({
|
|
112525
|
+
selection: e.api.getSelectedRows(),
|
|
112526
|
+
isFirstOfPage: this._isFirstRecordOfPage,
|
|
112527
|
+
isLastOfPage: this._isLastRecordOfPage
|
|
112528
|
+
});
|
|
112431
112529
|
}
|
|
112432
112530
|
}
|
|
112433
112531
|
onPaginationChange() {
|
|
112532
|
+
this.syncSelection();
|
|
112434
112533
|
if (this._paginationChangeCallback) {
|
|
112435
112534
|
if (this._gridOptions.api) {
|
|
112436
|
-
|
|
112437
|
-
const currentPage = api.paginationGetCurrentPage();
|
|
112438
|
-
const isLastPage = api.paginationGetTotalPages() === (currentPage + 1);
|
|
112439
|
-
const pageSize = api.paginationGetPageSize();
|
|
112440
|
-
const totalRows = api.paginationGetRowCount();
|
|
112441
|
-
const pageStart = currentPage * pageSize + 1;
|
|
112442
|
-
const pageEnd = Math.min(totalRows, (currentPage + 1) * pageSize);
|
|
112443
|
-
this._paginationChangeCallback({
|
|
112444
|
-
hasPrevious: currentPage > 0,
|
|
112445
|
-
hasNext: !isLastPage,
|
|
112446
|
-
currentPage: currentPage + 1,
|
|
112447
|
-
pageStart,
|
|
112448
|
-
pageEnd,
|
|
112449
|
-
totalRows
|
|
112450
|
-
});
|
|
112535
|
+
this._paginationChangeCallback(this.getPaginationStatus());
|
|
112451
112536
|
}
|
|
112452
112537
|
}
|
|
112453
112538
|
}
|
|
112539
|
+
getPaginationStatus() {
|
|
112540
|
+
const api = this._gridOptions.api;
|
|
112541
|
+
const currentPage = api.paginationGetCurrentPage();
|
|
112542
|
+
const isLastPage = api.paginationGetTotalPages() === (currentPage + 1);
|
|
112543
|
+
const pageSize = api.paginationGetPageSize();
|
|
112544
|
+
const totalRows = api.paginationGetRowCount();
|
|
112545
|
+
const pageStart = currentPage * pageSize + 1;
|
|
112546
|
+
const pageEnd = Math.min(totalRows, (currentPage + 1) * pageSize);
|
|
112547
|
+
return {
|
|
112548
|
+
hasPrevious: currentPage > 0,
|
|
112549
|
+
hasNext: !isLastPage,
|
|
112550
|
+
currentPage: currentPage + 1,
|
|
112551
|
+
pageStart,
|
|
112552
|
+
pageEnd,
|
|
112553
|
+
totalRows
|
|
112554
|
+
};
|
|
112555
|
+
}
|
|
112454
112556
|
onRowDoubleClick(evt) {
|
|
112455
112557
|
if (this._doubleClickCallBack) {
|
|
112456
112558
|
this._doubleClickCallBack(evt.data);
|
|
@@ -112474,10 +112576,6 @@ class DataUnitBridge {
|
|
|
112474
112576
|
const { records } = action.payload;
|
|
112475
112577
|
this._gridController.removeRows(records);
|
|
112476
112578
|
break;
|
|
112477
|
-
case Action.RECORDS_ADDED:
|
|
112478
|
-
case Action.RECORDS_COPIED:
|
|
112479
|
-
this._gridController.addRows(action.payload);
|
|
112480
|
-
break;
|
|
112481
112579
|
case Action.EDITION_CANCELED:
|
|
112482
112580
|
case Action.DATA_SAVED:
|
|
112483
112581
|
this._gridController.refresh();
|
|
@@ -112486,6 +112584,10 @@ class DataUnitBridge {
|
|
|
112486
112584
|
const { selection } = action.payload;
|
|
112487
112585
|
this._gridController.selectRows(selection);
|
|
112488
112586
|
break;
|
|
112587
|
+
case Action.NEXT_SELECTED:
|
|
112588
|
+
case Action.PREVIOUS_SELECTED:
|
|
112589
|
+
this._gridController.selectRows(this._dataUnit.getSelection());
|
|
112590
|
+
break;
|
|
112489
112591
|
case Action.DATA_CHANGED:
|
|
112490
112592
|
const changes = Object.assign({}, action.payload);
|
|
112491
112593
|
delete changes.records;
|
|
@@ -112502,7 +112604,12 @@ class DataUnitBridge {
|
|
|
112502
112604
|
this._dataUnit.metadata.fields.forEach(f => {
|
|
112503
112605
|
var _a;
|
|
112504
112606
|
if (f.visible !== false) {
|
|
112505
|
-
|
|
112607
|
+
const props = new Map();
|
|
112608
|
+
const properties = this._dataUnit.getField(f.name).properties;
|
|
112609
|
+
for (const value in properties) {
|
|
112610
|
+
props.set(value, properties[value]);
|
|
112611
|
+
}
|
|
112612
|
+
columnDefs.push({ label: f.label, name: f.name, userInterface: f.userInterface, options: (_a = this._dataUnit.getField(f.name).properties) === null || _a === void 0 ? void 0 : _a.options, props });
|
|
112506
112613
|
}
|
|
112507
112614
|
});
|
|
112508
112615
|
}
|
|
@@ -112524,7 +112631,7 @@ let EzGrid$1 = class extends HTMLElement$1 {
|
|
|
112524
112631
|
this.ezDoubleClick = createEvent(this, "ezDoubleClick", 7);
|
|
112525
112632
|
this.configChange = createEvent(this, "configChange", 7);
|
|
112526
112633
|
this._gridController = new AgGridController(false);
|
|
112527
|
-
this.
|
|
112634
|
+
this._popUpGridConfig = false;
|
|
112528
112635
|
/**
|
|
112529
112636
|
* Determina o número de linhas de cada página. Caso informado o valor -1
|
|
112530
112637
|
* não haverá paginação.
|
|
@@ -112586,6 +112693,74 @@ let EzGrid$1 = class extends HTMLElement$1 {
|
|
|
112586
112693
|
async quickFilter(term) {
|
|
112587
112694
|
this._gridController.quickFilter(term);
|
|
112588
112695
|
}
|
|
112696
|
+
/**
|
|
112697
|
+
* Método para fazer um filtro rápido na grid.
|
|
112698
|
+
*/
|
|
112699
|
+
async nextPage() {
|
|
112700
|
+
this._gridController.nextPage();
|
|
112701
|
+
}
|
|
112702
|
+
/**
|
|
112703
|
+
* Método para fazer um filtro rápido na grid.
|
|
112704
|
+
*/
|
|
112705
|
+
async previousPage() {
|
|
112706
|
+
this._gridController.previousPage();
|
|
112707
|
+
}
|
|
112708
|
+
/**
|
|
112709
|
+
* Método para fazer um filtro rápido na grid.
|
|
112710
|
+
*/
|
|
112711
|
+
async hasNextPage() {
|
|
112712
|
+
return new Promise(resolve => {
|
|
112713
|
+
resolve(this._navigationHasNext);
|
|
112714
|
+
});
|
|
112715
|
+
}
|
|
112716
|
+
/**
|
|
112717
|
+
* Método para fazer um filtro rápido na grid.
|
|
112718
|
+
*/
|
|
112719
|
+
async hasPreviousPage() {
|
|
112720
|
+
return new Promise(resolve => {
|
|
112721
|
+
resolve(this._navigationHasPrevious);
|
|
112722
|
+
});
|
|
112723
|
+
}
|
|
112724
|
+
/**
|
|
112725
|
+
* Método para verificar se o registro selecionado é o ultimo da página.
|
|
112726
|
+
*/
|
|
112727
|
+
async isLastOfPage() {
|
|
112728
|
+
return new Promise(resolve => {
|
|
112729
|
+
resolve(this._gridController.isLastOfPage());
|
|
112730
|
+
});
|
|
112731
|
+
}
|
|
112732
|
+
/**
|
|
112733
|
+
* Método para verificar se o registro selecionado é o primeiro da página.
|
|
112734
|
+
*/
|
|
112735
|
+
async isFirstOfPage() {
|
|
112736
|
+
return new Promise(resolve => {
|
|
112737
|
+
resolve(this._gridController.isFirstOfPage());
|
|
112738
|
+
});
|
|
112739
|
+
}
|
|
112740
|
+
/**
|
|
112741
|
+
* Método para navegar para o proxímo registro da grid.
|
|
112742
|
+
*/
|
|
112743
|
+
async nextRecord() {
|
|
112744
|
+
this._gridController.nextRecord();
|
|
112745
|
+
}
|
|
112746
|
+
/**
|
|
112747
|
+
* Método para navegar para o registro anterior da grid.
|
|
112748
|
+
*/
|
|
112749
|
+
async previousRecord() {
|
|
112750
|
+
this._gridController.previousRecord();
|
|
112751
|
+
}
|
|
112752
|
+
/**
|
|
112753
|
+
* Método para verificar se existem proximos registros.
|
|
112754
|
+
*/
|
|
112755
|
+
async hasNextRecord() {
|
|
112756
|
+
return Promise.resolve(this._gridController.hasNextRecord());
|
|
112757
|
+
}
|
|
112758
|
+
/**
|
|
112759
|
+
* Método para verificar se existem registros anteriores.
|
|
112760
|
+
*/
|
|
112761
|
+
async hasPreviousRecord() {
|
|
112762
|
+
return Promise.resolve(this._gridController.hasPreviousRecord());
|
|
112763
|
+
}
|
|
112589
112764
|
componentWillLoad() {
|
|
112590
112765
|
if (this.dataUnit) {
|
|
112591
112766
|
this._dataUnitBridge = new DataUnitBridge(this._gridController, this.dataUnit);
|
|
@@ -112658,7 +112833,7 @@ let EzGrid$1 = class extends HTMLElement$1 {
|
|
|
112658
112833
|
componentDidLoad() {
|
|
112659
112834
|
this._gridController.initDatagrid(this._container, {
|
|
112660
112835
|
onColumnStateChange: (type, state, info) => this.onColumnStateChange(type, state, info),
|
|
112661
|
-
onSelectionChange: (
|
|
112836
|
+
onSelectionChange: (state) => this.ezSelectionChange.emit(state.selection),
|
|
112662
112837
|
onPaginationChange: (status) => {
|
|
112663
112838
|
this._navigationHasPrevious = status.hasPrevious;
|
|
112664
112839
|
this._navigationHasNext = status.hasNext;
|
|
@@ -112692,24 +112867,24 @@ let EzGrid$1 = class extends HTMLElement$1 {
|
|
|
112692
112867
|
}
|
|
112693
112868
|
return [
|
|
112694
112869
|
h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, `${this._navigationFirstRow}-${this._navigationLastRow}`), ` de ${this._navigationTotalRows}`),
|
|
112695
|
-
h("ez-button", { size: "small", iconName: "chevron-left", class: "ez-margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this.
|
|
112696
|
-
h("ez-button", { size: "small", iconName: "chevron-right", class: "ez-margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this.
|
|
112870
|
+
h("ez-button", { size: "small", iconName: "chevron-left", class: "ez-margin-right--medium", mode: "icon", enabled: this._navigationHasPrevious, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }),
|
|
112871
|
+
h("ez-button", { size: "small", iconName: "chevron-right", class: "ez-margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
|
|
112697
112872
|
];
|
|
112698
112873
|
}
|
|
112699
112874
|
applyConfig(config) {
|
|
112700
112875
|
this._gridController.setColumnsState(config.columns);
|
|
112701
|
-
this.
|
|
112876
|
+
this.closeGridConfig();
|
|
112702
112877
|
}
|
|
112703
|
-
|
|
112704
|
-
this.
|
|
112878
|
+
closeGridConfig() {
|
|
112879
|
+
this._popUpGridConfig = false;
|
|
112705
112880
|
}
|
|
112706
|
-
|
|
112881
|
+
openGridConfig() {
|
|
112707
112882
|
this._gridConfig.columns = this._gridController.getColumnsState().filter(c => c.name);
|
|
112708
112883
|
this._gridConfig.selectedTab = "Colunas";
|
|
112709
|
-
this.
|
|
112884
|
+
this._popUpGridConfig = true;
|
|
112710
112885
|
}
|
|
112711
112886
|
render() {
|
|
112712
|
-
return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container" }, this.getPaginationControl()
|
|
112887
|
+
return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container" }, this.getPaginationControl())), h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), h("div", { class: "grid__footer" }), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("grid-config", { ref: ref => this._gridConfig = ref, config: this.config, selectedTab: "Colunas", onConfigFinish: evt => { this.applyConfig(evt.detail); this.configChange.emit(evt.detail); }, onConfigCancel: _evt => this.closeGridConfig() }))));
|
|
112713
112888
|
}
|
|
112714
112889
|
static get assetsDirs() { return ["../assets"]; }
|
|
112715
112890
|
static get watchers() { return {
|
|
@@ -112909,6 +113084,17 @@ let EzList$1 = class extends HTMLElement$1 {
|
|
|
112909
113084
|
this._listItemsHistory = [];
|
|
112910
113085
|
}
|
|
112911
113086
|
/**
|
|
113087
|
+
* Responsável por dar um scroll top no componente da lista.
|
|
113088
|
+
*/
|
|
113089
|
+
async scrollToTop() {
|
|
113090
|
+
if (this.useGroups) {
|
|
113091
|
+
this._element.shadowRoot.querySelector('.group-container').scrollTop = 0;
|
|
113092
|
+
}
|
|
113093
|
+
else {
|
|
113094
|
+
this._element.shadowRoot.querySelector('.items-container').scrollTop = 0;
|
|
113095
|
+
}
|
|
113096
|
+
}
|
|
113097
|
+
/**
|
|
112912
113098
|
* Recebe como argumento um ListItem {label: string} e um booleano que define se o componente deve fazer scroll para exibir o item específico (opcional).
|
|
112913
113099
|
*/
|
|
112914
113100
|
async setSelection(selectedItem, scrollToOption) {
|
|
@@ -113362,6 +113548,7 @@ let EzModal$1 = class extends HTMLElement$1 {
|
|
|
113362
113548
|
this.__registerHost();
|
|
113363
113549
|
this.__attachShadow();
|
|
113364
113550
|
this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
|
|
113551
|
+
this.ezOpenModal = createEvent(this, "ezOpenModal", 7);
|
|
113365
113552
|
/**
|
|
113366
113553
|
* Controle de exibição do Modal
|
|
113367
113554
|
*/
|
|
@@ -113395,6 +113582,11 @@ let EzModal$1 = class extends HTMLElement$1 {
|
|
|
113395
113582
|
componentDidLoad() {
|
|
113396
113583
|
this.handleopenedChange();
|
|
113397
113584
|
}
|
|
113585
|
+
componentDidRender() {
|
|
113586
|
+
if (this.opened) {
|
|
113587
|
+
this.ezOpenModal.emit();
|
|
113588
|
+
}
|
|
113589
|
+
}
|
|
113398
113590
|
onMouseDownHandler(event) {
|
|
113399
113591
|
if (this.closeOutsideClick && event.target === this._overlay) {
|
|
113400
113592
|
this.closeModal();
|
|
@@ -113456,7 +113648,7 @@ let EzNumberInput$1 = class extends HTMLElement$1 {
|
|
|
113456
113648
|
}
|
|
113457
113649
|
changeValue(newValue) {
|
|
113458
113650
|
this.errorMessage = "";
|
|
113459
|
-
if (newValue
|
|
113651
|
+
if (newValue !== this.value) {
|
|
113460
113652
|
this.value = newValue;
|
|
113461
113653
|
this.ezChange.emit(this.value);
|
|
113462
113654
|
}
|
|
@@ -114093,14 +114285,16 @@ let EzTextInput$1 = class extends HTMLElement$1 {
|
|
|
114093
114285
|
}
|
|
114094
114286
|
showError() {
|
|
114095
114287
|
var _a, _b;
|
|
114096
|
-
|
|
114097
|
-
|
|
114098
|
-
|
|
114099
|
-
|
|
114100
|
-
|
|
114101
|
-
|
|
114102
|
-
|
|
114103
|
-
|
|
114288
|
+
if (this._inputElem) {
|
|
114289
|
+
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
114290
|
+
if (hasError) {
|
|
114291
|
+
this._inputElem.classList.add("hasError");
|
|
114292
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
|
|
114293
|
+
}
|
|
114294
|
+
else {
|
|
114295
|
+
this._inputElem.classList.remove("hasError");
|
|
114296
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
|
|
114297
|
+
}
|
|
114104
114298
|
}
|
|
114105
114299
|
}
|
|
114106
114300
|
prepareMask() {
|
|
@@ -114856,6 +115050,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
114856
115050
|
this._orderPriorityList = [];
|
|
114857
115051
|
this._columListItems = [];
|
|
114858
115052
|
this._selectedIndex = -1;
|
|
115053
|
+
this._dataChanged = false;
|
|
114859
115054
|
this.selectedTab = "Colunas";
|
|
114860
115055
|
}
|
|
114861
115056
|
/* Creation Methods */
|
|
@@ -114931,6 +115126,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
114931
115126
|
}
|
|
114932
115127
|
updateOrder(sortOrder, updatedItemLabel) {
|
|
114933
115128
|
var _a;
|
|
115129
|
+
this._dataChanged = true;
|
|
114934
115130
|
let newList = [...this.columns];
|
|
114935
115131
|
let newItem = newList.find(item => item.label === updatedItemLabel);
|
|
114936
115132
|
if (newItem) {
|
|
@@ -114959,6 +115155,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
114959
115155
|
switchColumnGroup(ev, switchedItem) {
|
|
114960
115156
|
ev.stopPropagation();
|
|
114961
115157
|
let newList = [...this._columListItems];
|
|
115158
|
+
this._dataChanged = true;
|
|
114962
115159
|
if (ev.detail === true) {
|
|
114963
115160
|
let hiddenGroup = newList.find(group => group.group === "Ocultas");
|
|
114964
115161
|
let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
|
|
@@ -114998,6 +115195,9 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
114998
115195
|
});
|
|
114999
115196
|
});
|
|
115000
115197
|
this.columns = newColumnList;
|
|
115198
|
+
this._dataChanged = false;
|
|
115199
|
+
this.closeConfig();
|
|
115200
|
+
ApplicationUtils.info("As configurações foram salvas com sucesso!");
|
|
115001
115201
|
this.save();
|
|
115002
115202
|
}
|
|
115003
115203
|
save() {
|
|
@@ -115180,13 +115380,46 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115180
115380
|
return false;
|
|
115181
115381
|
}
|
|
115182
115382
|
closeConfig() {
|
|
115183
|
-
this.
|
|
115184
|
-
this.
|
|
115383
|
+
this._orderList.scrollToTop();
|
|
115384
|
+
this._columnList.scrollToTop();
|
|
115385
|
+
this._searchElement.value = "";
|
|
115386
|
+
if (this._dataChanged) {
|
|
115387
|
+
let options = {
|
|
115388
|
+
canClose: false,
|
|
115389
|
+
labelCancel: "Descartar",
|
|
115390
|
+
labelConfirm: "Salvar",
|
|
115391
|
+
btnConfirmDanger: false
|
|
115392
|
+
};
|
|
115393
|
+
ApplicationUtils.confirm("Aviso", "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?", null, false, options)
|
|
115394
|
+
.then(response => {
|
|
115395
|
+
if (!response) {
|
|
115396
|
+
this._dataChanged = false;
|
|
115397
|
+
this.configCancel.emit();
|
|
115398
|
+
this._orderList.clearHistory();
|
|
115399
|
+
}
|
|
115400
|
+
else {
|
|
115401
|
+
this.finish();
|
|
115402
|
+
}
|
|
115403
|
+
});
|
|
115404
|
+
}
|
|
115405
|
+
else {
|
|
115406
|
+
this.configCancel.emit();
|
|
115407
|
+
this._orderList.clearHistory();
|
|
115408
|
+
}
|
|
115185
115409
|
}
|
|
115186
115410
|
/* Handlers */
|
|
115187
115411
|
handleTabChange(ev) {
|
|
115188
115412
|
var _a;
|
|
115189
115413
|
if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
|
|
115414
|
+
if (this.selectedTab !== ev.target.selectedTab) {
|
|
115415
|
+
if (ev.target.selectedTab === "Colunas") {
|
|
115416
|
+
this._orderList.scrollToTop();
|
|
115417
|
+
}
|
|
115418
|
+
else if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
115419
|
+
this._columnList.scrollToTop();
|
|
115420
|
+
}
|
|
115421
|
+
this._searchElement.value = "";
|
|
115422
|
+
}
|
|
115190
115423
|
if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
115191
115424
|
this.createOrderList();
|
|
115192
115425
|
}
|
|
@@ -115198,6 +115431,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115198
115431
|
if (ev.detail) {
|
|
115199
115432
|
let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
|
|
115200
115433
|
if (visibleItems) {
|
|
115434
|
+
this._dataChanged = true;
|
|
115201
115435
|
this._orderListItems = visibleItems;
|
|
115202
115436
|
}
|
|
115203
115437
|
}
|
|
@@ -115206,6 +115440,7 @@ let GridConfig$1 = class extends HTMLElement$1 {
|
|
|
115206
115440
|
if (ev.detail) {
|
|
115207
115441
|
let orderPriorityList = ev.detail;
|
|
115208
115442
|
if (orderPriorityList) {
|
|
115443
|
+
this._dataChanged = true;
|
|
115209
115444
|
this._orderPriorityList = orderPriorityList;
|
|
115210
115445
|
}
|
|
115211
115446
|
}
|
|
@@ -115320,7 +115555,7 @@ const EzDateTimeInput = /*@__PURE__*/proxyCustomElement(EzDateTimeInput$1, [1,"e
|
|
|
115320
115555
|
const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"]}]);
|
|
115321
115556
|
const EzFilterInput = /*@__PURE__*/proxyCustomElement(EzFilterInput$1, [1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"loading":[516],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513]}]);
|
|
115322
115557
|
const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [0,"ez-form",{"dataUnit":[1040],"config":[16]}]);
|
|
115323
|
-
const EzGrid = /*@__PURE__*/proxyCustomElement(EzGrid$1, [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],"
|
|
115558
|
+
const EzGrid = /*@__PURE__*/proxyCustomElement(EzGrid$1, [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]}]);
|
|
115324
115559
|
const EzIcon = /*@__PURE__*/proxyCustomElement(EzIcon$1, [1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]);
|
|
115325
115560
|
const EzLabelChip = /*@__PURE__*/proxyCustomElement(EzLabelChip$1, [1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540]}]);
|
|
115326
115561
|
const EzList = /*@__PURE__*/proxyCustomElement(EzList$1, [1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32]}]);
|
|
@@ -637,7 +637,12 @@ class DataBinder {
|
|
|
637
637
|
const oldValue = field["value"];
|
|
638
638
|
const newValue = this._dataUnit.getFieldValue(fieldName);
|
|
639
639
|
if (oldValue != newValue) {
|
|
640
|
-
|
|
640
|
+
if (newValue === undefined) {
|
|
641
|
+
field.removeAttribute("value");
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
field["value"] = newValue;
|
|
645
|
+
}
|
|
641
646
|
}
|
|
642
647
|
}
|
|
643
648
|
updateBind(fieldName, field) {
|
|
@@ -645,7 +650,13 @@ class DataBinder {
|
|
|
645
650
|
if (oldBind) {
|
|
646
651
|
oldBind.destroy();
|
|
647
652
|
}
|
|
648
|
-
|
|
653
|
+
const value = this._dataUnit.getFieldValue(fieldName);
|
|
654
|
+
if (value === undefined) {
|
|
655
|
+
field.removeAttribute("value");
|
|
656
|
+
}
|
|
657
|
+
else {
|
|
658
|
+
field["value"] = value;
|
|
659
|
+
}
|
|
649
660
|
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
650
661
|
this.bindSearchOptionsLoader(fieldName, field);
|
|
651
662
|
this.applyEzUploadContext(fieldName, field);
|
|
@@ -732,7 +743,7 @@ let EzForm = class {
|
|
|
732
743
|
.filter(f => f.dataset.required)
|
|
733
744
|
.map(f => f.dataset.fieldName)
|
|
734
745
|
.concat(metadata.getRequiredFields());
|
|
735
|
-
const records = this.dataUnit.
|
|
746
|
+
const records = this.dataUnit.getModifiedRecords();
|
|
736
747
|
for (let i = 0; i < records.length; i++) {
|
|
737
748
|
if (!this.validateRequired(requiredFields, records[i])) {
|
|
738
749
|
reject();
|