@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
|
@@ -1074,7 +1074,7 @@ function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
|
1074
1074
|
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
|
|
1075
1075
|
}
|
|
1076
1076
|
|
|
1077
|
-
const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
1077
|
+
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
1078
1078
|
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
1079
1079
|
let options;
|
|
1080
1080
|
if (typeof prop === "string") {
|
|
@@ -1085,12 +1085,12 @@ const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
|
1085
1085
|
options = prop;
|
|
1086
1086
|
}
|
|
1087
1087
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
|
|
1088
|
-
h("ez-combo-box", { enabled: !readOnly, label: label, "data-field-name": name, key: name, options: options })));
|
|
1088
|
+
h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
1089
1089
|
};
|
|
1090
1090
|
|
|
1091
|
-
const buildSearch = ({ name, label, readOnly }) => {
|
|
1091
|
+
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
1092
1092
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
|
|
1093
|
-
h("ez-search", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
1093
|
+
h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
1094
1094
|
};
|
|
1095
1095
|
|
|
1096
1096
|
const buildFile = ({ name, label, readOnly }) => {
|
|
@@ -111921,11 +111921,14 @@ class DataSource {
|
|
|
111921
111921
|
class AgGridController {
|
|
111922
111922
|
constructor(enterprise) {
|
|
111923
111923
|
this._menuItems = [];
|
|
111924
|
+
this._idAttribName = "__record__id__";
|
|
111924
111925
|
this._enterprise = enterprise;
|
|
111925
111926
|
}
|
|
111926
111927
|
getSort() {
|
|
111927
111928
|
const sortedColumns = [];
|
|
111928
|
-
this._gridOptions.
|
|
111929
|
+
this._gridOptions.columnApi.getColumnState()
|
|
111930
|
+
.sort((colA, colB) => colA.sortIndex - colB.sortIndex)
|
|
111931
|
+
.forEach(({ colId, sort }) => {
|
|
111929
111932
|
if (sort) {
|
|
111930
111933
|
const field = this._dataUnit.getField(colId);
|
|
111931
111934
|
const mode = sort === "asc" ? SortMode.ASC : SortMode.DESC;
|
|
@@ -111950,10 +111953,9 @@ class AgGridController {
|
|
|
111950
111953
|
this._gridOptions = {
|
|
111951
111954
|
localeText: gridTerms,
|
|
111952
111955
|
rowModelType: "serverSide",
|
|
111953
|
-
serverSideStoreType: "partial",
|
|
111954
111956
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
111955
111957
|
serverSideDatasource: new DataSource(this._dataUnit, this._serverURL),
|
|
111956
|
-
getRowNodeId: (params) => params.
|
|
111958
|
+
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
111957
111959
|
getMainMenuItems: (params) => {
|
|
111958
111960
|
const column = params.column;
|
|
111959
111961
|
const items = [column.isPinned() ? "clearPinned" : "pinLeft", "separator"];
|
|
@@ -111963,14 +111965,9 @@ class AgGridController {
|
|
|
111963
111965
|
}));
|
|
111964
111966
|
return items;
|
|
111965
111967
|
},
|
|
111966
|
-
onViewportChanged: (
|
|
111967
|
-
if (this.
|
|
111968
|
-
|
|
111969
|
-
this._dataUnit.getSelection().forEach(id => {
|
|
111970
|
-
let node = evt.api.getRowNode(id);
|
|
111971
|
-
node.setSelected(true);
|
|
111972
|
-
});
|
|
111973
|
-
}
|
|
111968
|
+
onViewportChanged: () => {
|
|
111969
|
+
if (this._dataUnit) {
|
|
111970
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
111974
111971
|
}
|
|
111975
111972
|
}
|
|
111976
111973
|
};
|
|
@@ -112011,6 +112008,58 @@ class AgGridController {
|
|
|
112011
112008
|
}
|
|
112012
112009
|
this._gridOptions.api.setRowData(data);
|
|
112013
112010
|
}
|
|
112011
|
+
addRows(rows) {
|
|
112012
|
+
if (this._grid === undefined) {
|
|
112013
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112014
|
+
}
|
|
112015
|
+
this._gridOptions.api.applyServerSideTransaction({ add: rows });
|
|
112016
|
+
}
|
|
112017
|
+
selectRows(rowIds) {
|
|
112018
|
+
if (this._grid === undefined) {
|
|
112019
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112020
|
+
}
|
|
112021
|
+
if (rowIds && rowIds.length > 0) {
|
|
112022
|
+
rowIds.forEach(rowId => {
|
|
112023
|
+
const row = this._gridOptions.api.getRowNode(rowId);
|
|
112024
|
+
if (row) {
|
|
112025
|
+
row.setSelected(true);
|
|
112026
|
+
}
|
|
112027
|
+
});
|
|
112028
|
+
}
|
|
112029
|
+
}
|
|
112030
|
+
removeRows(rowIds) {
|
|
112031
|
+
if (this._grid === undefined) {
|
|
112032
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112033
|
+
}
|
|
112034
|
+
this._gridOptions.api.applyServerSideTransaction({ remove: rowIds });
|
|
112035
|
+
}
|
|
112036
|
+
changeValues(changes, rowIds) {
|
|
112037
|
+
if (this._grid === undefined) {
|
|
112038
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
112039
|
+
}
|
|
112040
|
+
if (changes) {
|
|
112041
|
+
let rowNodes;
|
|
112042
|
+
if (rowIds) {
|
|
112043
|
+
rowNodes = [];
|
|
112044
|
+
rowIds.forEach(id => {
|
|
112045
|
+
const rowNode = this._gridOptions.api.getRowNode(id);
|
|
112046
|
+
if (rowNode) {
|
|
112047
|
+
rowNodes.push(rowNode);
|
|
112048
|
+
}
|
|
112049
|
+
});
|
|
112050
|
+
}
|
|
112051
|
+
else {
|
|
112052
|
+
rowNodes = this._gridOptions.api.getSelectedNodes();
|
|
112053
|
+
}
|
|
112054
|
+
rowNodes.forEach(r => {
|
|
112055
|
+
const data = r.data;
|
|
112056
|
+
Object.entries(changes).forEach(([field, value]) => {
|
|
112057
|
+
data[field] = value;
|
|
112058
|
+
});
|
|
112059
|
+
r.setData(data);
|
|
112060
|
+
});
|
|
112061
|
+
}
|
|
112062
|
+
}
|
|
112014
112063
|
refresh() {
|
|
112015
112064
|
if (this._grid === undefined) {
|
|
112016
112065
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
@@ -112218,12 +112267,25 @@ class DataUnitBridge {
|
|
|
112218
112267
|
this._gridController.setColumnsDef(this.buildColumnDefs(), true);
|
|
112219
112268
|
break;
|
|
112220
112269
|
case Action.RECORDS_REMOVED:
|
|
112221
|
-
|
|
112270
|
+
const { records } = action.payload;
|
|
112271
|
+
this._gridController.removeRows(records);
|
|
112272
|
+
break;
|
|
112222
112273
|
case Action.RECORDS_ADDED:
|
|
112223
112274
|
case Action.RECORDS_COPIED:
|
|
112275
|
+
this._gridController.addRows(action.payload);
|
|
112276
|
+
break;
|
|
112277
|
+
case Action.EDITION_CANCELED:
|
|
112224
112278
|
case Action.DATA_SAVED:
|
|
112225
112279
|
this._gridController.refresh();
|
|
112226
112280
|
break;
|
|
112281
|
+
case Action.SELECTION_CHANGED:
|
|
112282
|
+
const { selection } = action.payload;
|
|
112283
|
+
this._gridController.selectRows(selection);
|
|
112284
|
+
break;
|
|
112285
|
+
case Action.DATA_CHANGED:
|
|
112286
|
+
const changes = Object.assign({}, action.payload);
|
|
112287
|
+
delete changes.records;
|
|
112288
|
+
this._gridController.changeValues(changes, action.payload.records);
|
|
112227
112289
|
}
|
|
112228
112290
|
}
|
|
112229
112291
|
buildColumnDefs() {
|
|
@@ -113305,6 +113367,10 @@ let EzSearch$1 = class extends HTMLElement$1 {
|
|
|
113305
113367
|
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
113306
113368
|
*/
|
|
113307
113369
|
this.showOptionValue = true;
|
|
113370
|
+
/**
|
|
113371
|
+
* Remove a opção vazia da lista de opções
|
|
113372
|
+
*/
|
|
113373
|
+
this.suppressEmptyOption = false;
|
|
113308
113374
|
}
|
|
113309
113375
|
updateValue() {
|
|
113310
113376
|
if (this._comboElement) {
|
|
@@ -113332,7 +113398,7 @@ let EzSearch$1 = class extends HTMLElement$1 {
|
|
|
113332
113398
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
113333
113399
|
}
|
|
113334
113400
|
render() {
|
|
113335
|
-
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 }));
|
|
113401
|
+
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 }));
|
|
113336
113402
|
}
|
|
113337
113403
|
;
|
|
113338
113404
|
get _elem() { return this; }
|
|
@@ -114711,7 +114777,7 @@ const EzModal = /*@__PURE__*/proxyCustomElement(EzModal$1, [1,"ez-modal",{"modal
|
|
|
114711
114777
|
const EzNumberInput = /*@__PURE__*/proxyCustomElement(EzNumberInput$1, [1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"]}]);
|
|
114712
114778
|
const EzPopover = /*@__PURE__*/proxyCustomElement(EzPopover$1, [1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540]}]);
|
|
114713
114779
|
const EzPopup = /*@__PURE__*/proxyCustomElement(EzPopup$1, [1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]);
|
|
114714
|
-
const EzSearch = /*@__PURE__*/proxyCustomElement(EzSearch$1, [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"]}]);
|
|
114780
|
+
const EzSearch = /*@__PURE__*/proxyCustomElement(EzSearch$1, [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"]}]);
|
|
114715
114781
|
const EzTabselector = /*@__PURE__*/proxyCustomElement(EzTabselector$1, [1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]);
|
|
114716
114782
|
const EzTextArea = /*@__PURE__*/proxyCustomElement(EzTextArea$1, [1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538]}]);
|
|
114717
114783
|
const EzTextInput = /*@__PURE__*/proxyCustomElement(EzTextInput$1, [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]}]);
|
|
@@ -23,7 +23,7 @@ function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
|
23
23
|
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
26
|
+
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
27
27
|
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
28
28
|
let options;
|
|
29
29
|
if (typeof prop === "string") {
|
|
@@ -34,12 +34,12 @@ const buildComboBox = ({ name, label, readOnly }, properties) => {
|
|
|
34
34
|
options = prop;
|
|
35
35
|
}
|
|
36
36
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
|
|
37
|
-
h("ez-combo-box", { enabled: !readOnly, label: label, "data-field-name": name, key: name, options: options })));
|
|
37
|
+
h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
const buildSearch = ({ name, label, readOnly }) => {
|
|
40
|
+
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
41
41
|
return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
|
|
42
|
-
h("ez-search", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
42
|
+
h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
const buildFile = ({ name, label, readOnly }) => {
|
|
@@ -110057,11 +110057,14 @@ class DataSource {
|
|
|
110057
110057
|
class AgGridController {
|
|
110058
110058
|
constructor(enterprise) {
|
|
110059
110059
|
this._menuItems = [];
|
|
110060
|
+
this._idAttribName = "__record__id__";
|
|
110060
110061
|
this._enterprise = enterprise;
|
|
110061
110062
|
}
|
|
110062
110063
|
getSort() {
|
|
110063
110064
|
const sortedColumns = [];
|
|
110064
|
-
this._gridOptions.
|
|
110065
|
+
this._gridOptions.columnApi.getColumnState()
|
|
110066
|
+
.sort((colA, colB) => colA.sortIndex - colB.sortIndex)
|
|
110067
|
+
.forEach(({ colId, sort }) => {
|
|
110065
110068
|
if (sort) {
|
|
110066
110069
|
const field = this._dataUnit.getField(colId);
|
|
110067
110070
|
const mode = sort === "asc" ? SortMode.ASC : SortMode.DESC;
|
|
@@ -110086,10 +110089,9 @@ class AgGridController {
|
|
|
110086
110089
|
this._gridOptions = {
|
|
110087
110090
|
localeText: gridTerms,
|
|
110088
110091
|
rowModelType: "serverSide",
|
|
110089
|
-
serverSideStoreType: "partial",
|
|
110090
110092
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
110091
110093
|
serverSideDatasource: new DataSource(this._dataUnit, this._serverURL),
|
|
110092
|
-
getRowNodeId: (params) => params.
|
|
110094
|
+
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
110093
110095
|
getMainMenuItems: (params) => {
|
|
110094
110096
|
const column = params.column;
|
|
110095
110097
|
const items = [column.isPinned() ? "clearPinned" : "pinLeft", "separator"];
|
|
@@ -110099,14 +110101,9 @@ class AgGridController {
|
|
|
110099
110101
|
}));
|
|
110100
110102
|
return items;
|
|
110101
110103
|
},
|
|
110102
|
-
onViewportChanged: (
|
|
110103
|
-
if (this.
|
|
110104
|
-
|
|
110105
|
-
this._dataUnit.getSelection().forEach(id => {
|
|
110106
|
-
let node = evt.api.getRowNode(id);
|
|
110107
|
-
node.setSelected(true);
|
|
110108
|
-
});
|
|
110109
|
-
}
|
|
110104
|
+
onViewportChanged: () => {
|
|
110105
|
+
if (this._dataUnit) {
|
|
110106
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
110110
110107
|
}
|
|
110111
110108
|
}
|
|
110112
110109
|
};
|
|
@@ -110147,6 +110144,58 @@ class AgGridController {
|
|
|
110147
110144
|
}
|
|
110148
110145
|
this._gridOptions.api.setRowData(data);
|
|
110149
110146
|
}
|
|
110147
|
+
addRows(rows) {
|
|
110148
|
+
if (this._grid === undefined) {
|
|
110149
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110150
|
+
}
|
|
110151
|
+
this._gridOptions.api.applyServerSideTransaction({ add: rows });
|
|
110152
|
+
}
|
|
110153
|
+
selectRows(rowIds) {
|
|
110154
|
+
if (this._grid === undefined) {
|
|
110155
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110156
|
+
}
|
|
110157
|
+
if (rowIds && rowIds.length > 0) {
|
|
110158
|
+
rowIds.forEach(rowId => {
|
|
110159
|
+
const row = this._gridOptions.api.getRowNode(rowId);
|
|
110160
|
+
if (row) {
|
|
110161
|
+
row.setSelected(true);
|
|
110162
|
+
}
|
|
110163
|
+
});
|
|
110164
|
+
}
|
|
110165
|
+
}
|
|
110166
|
+
removeRows(rowIds) {
|
|
110167
|
+
if (this._grid === undefined) {
|
|
110168
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110169
|
+
}
|
|
110170
|
+
this._gridOptions.api.applyServerSideTransaction({ remove: rowIds });
|
|
110171
|
+
}
|
|
110172
|
+
changeValues(changes, rowIds) {
|
|
110173
|
+
if (this._grid === undefined) {
|
|
110174
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110175
|
+
}
|
|
110176
|
+
if (changes) {
|
|
110177
|
+
let rowNodes;
|
|
110178
|
+
if (rowIds) {
|
|
110179
|
+
rowNodes = [];
|
|
110180
|
+
rowIds.forEach(id => {
|
|
110181
|
+
const rowNode = this._gridOptions.api.getRowNode(id);
|
|
110182
|
+
if (rowNode) {
|
|
110183
|
+
rowNodes.push(rowNode);
|
|
110184
|
+
}
|
|
110185
|
+
});
|
|
110186
|
+
}
|
|
110187
|
+
else {
|
|
110188
|
+
rowNodes = this._gridOptions.api.getSelectedNodes();
|
|
110189
|
+
}
|
|
110190
|
+
rowNodes.forEach(r => {
|
|
110191
|
+
const data = r.data;
|
|
110192
|
+
Object.entries(changes).forEach(([field, value]) => {
|
|
110193
|
+
data[field] = value;
|
|
110194
|
+
});
|
|
110195
|
+
r.setData(data);
|
|
110196
|
+
});
|
|
110197
|
+
}
|
|
110198
|
+
}
|
|
110150
110199
|
refresh() {
|
|
110151
110200
|
if (this._grid === undefined) {
|
|
110152
110201
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
@@ -110354,12 +110403,25 @@ class DataUnitBridge {
|
|
|
110354
110403
|
this._gridController.setColumnsDef(this.buildColumnDefs(), true);
|
|
110355
110404
|
break;
|
|
110356
110405
|
case Action.RECORDS_REMOVED:
|
|
110357
|
-
|
|
110406
|
+
const { records } = action.payload;
|
|
110407
|
+
this._gridController.removeRows(records);
|
|
110408
|
+
break;
|
|
110358
110409
|
case Action.RECORDS_ADDED:
|
|
110359
110410
|
case Action.RECORDS_COPIED:
|
|
110411
|
+
this._gridController.addRows(action.payload);
|
|
110412
|
+
break;
|
|
110413
|
+
case Action.EDITION_CANCELED:
|
|
110360
110414
|
case Action.DATA_SAVED:
|
|
110361
110415
|
this._gridController.refresh();
|
|
110362
110416
|
break;
|
|
110417
|
+
case Action.SELECTION_CHANGED:
|
|
110418
|
+
const { selection } = action.payload;
|
|
110419
|
+
this._gridController.selectRows(selection);
|
|
110420
|
+
break;
|
|
110421
|
+
case Action.DATA_CHANGED:
|
|
110422
|
+
const changes = Object.assign({}, action.payload);
|
|
110423
|
+
delete changes.records;
|
|
110424
|
+
this._gridController.changeValues(changes, action.payload.records);
|
|
110363
110425
|
}
|
|
110364
110426
|
}
|
|
110365
110427
|
buildColumnDefs() {
|
|
@@ -20,6 +20,10 @@ let EzSearch = class {
|
|
|
20
20
|
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
21
21
|
*/
|
|
22
22
|
this.showOptionValue = true;
|
|
23
|
+
/**
|
|
24
|
+
* Remove a opção vazia da lista de opções
|
|
25
|
+
*/
|
|
26
|
+
this.suppressEmptyOption = false;
|
|
23
27
|
}
|
|
24
28
|
updateValue() {
|
|
25
29
|
if (this._comboElement) {
|
|
@@ -47,7 +51,7 @@ let EzSearch = class {
|
|
|
47
51
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
48
52
|
}
|
|
49
53
|
render() {
|
|
50
|
-
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 }));
|
|
54
|
+
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 }));
|
|
51
55
|
}
|
|
52
56
|
;
|
|
53
57
|
get _elem() { return getElement(this); }
|
package/dist/esm/ezui.js
CHANGED
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["ez-grid",[[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",[[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",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application",[[0,"ez-application"]]],["ez-label-chip",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover",[[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",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]]],["ez-modal",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input",[[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",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input",[[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",[[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",[[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",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-number-input",[[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",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["ez-list",[[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",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"setFocus":[64],"setBlur":[64]}]]],["ez-upload",[[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",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box",[[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",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du",[[0,"test-du"]]]], options);
|
|
16
|
+
return bootstrapLazy([["ez-grid",[[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",[[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",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application",[[0,"ez-application"]]],["ez-label-chip",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover",[[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",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]]],["ez-modal",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input",[[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",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input",[[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",[[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",[[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",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-number-input",[[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",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["ez-list",[[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",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"setFocus":[64],"setBlur":[64]}]]],["ez-upload",[[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",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box",[[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",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du",[[0,"test-du"]]]], options);
|
|
17
17
|
});
|
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["ez-grid",[[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",[[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",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application",[[0,"ez-application"]]],["ez-label-chip",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover",[[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",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]]],["ez-modal",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input",[[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",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input",[[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",[[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",[[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",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-number-input",[[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",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["ez-list",[[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",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"setFocus":[64],"setBlur":[64]}]]],["ez-upload",[[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",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box",[[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",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du",[[0,"test-du"]]]], options);
|
|
13
|
+
return bootstrapLazy([["ez-grid",[[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",[[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",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-application",[[0,"ez-application"]]],["ez-label-chip",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popover",[[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",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["grid-config",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040]}]]],["ez-modal",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-text-input",[[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",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input",[[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",[[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",[[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",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["ez-number-input",[[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",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"showHide":[64]}]]],["ez-list",[[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",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"setFocus":[64],"setBlur":[64]}]]],["ez-upload",[[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",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-check",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-combo-box",[[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",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-form",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]],["test-du",[[0,"test-du"]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as s}from"./p-89a57641.js";(()=>{const s=import.meta.url,a={};return""!==s&&(a.resourcesUrl=new URL(".",s).href),e(a)})().then((e=>s([["p-
|
|
1
|
+
import{p as e,b as s}from"./p-89a57641.js";(()=>{const s=import.meta.url,a={};return""!==s&&(a.resourcesUrl=new URL(".",s).href),e(a)})().then((e=>s([["p-3cd17150",[[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]}]]],["p-24ff7d92",[[1,"ez-dialog",{confirm:[1028],critical:[1028],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],handleButtonClick:[64],show:[64]}]]],["p-b8678ee6",[[1,"ez-action-chip",{label:[513],enabled:[516]}]]],["p-95fc543c",[[0,"ez-application"]]],["p-542d3d29",[[1,"ez-label-chip",{label:[513],enabled:[516],removable:[516],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-080045a0",[[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]}]]],["p-502d7e0d",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[1540,"use-header"],ezTitle:[1,"ez-title"]}]]],["p-9ea5b22e",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-363fc3af",[[2,"grid-config",{selectedTab:[1025,"selected-tab"],columns:[1040]}]]],["p-f78c7ec9",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-bc2834fa",[[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]}]]],["p-c27495d9",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],setFocus:[64],setBlur:[64]}]]],["p-3a8bf0a8",[[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],setFocus:[64],setBlur:[64]}]]],["p-fb73f557",[[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]}]]],["p-9aecc079",[[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]}]]],["p-31b0e21a",[[1,"select-box",{selectedOption:[1,"selected-option"]}]]],["p-44d4f8d6",[[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"],setFocus:[64],setBlur:[64]}]]],["p-a5f1f9c4",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],showHide:[64]}]]],["p-c6f2aa6c",[[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]}]]],["p-25e87823",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],loading:[516],errorMessage:[1537,"error-message"],rows:[1538],setFocus:[64],setBlur:[64]}]]],["p-f26f6d67",[[1,"ez-upload",{label:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64],setFocus:[64],setBlur:[64]}]]],["p-73d45b12",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]}]]],["p-804c118a",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-f3f9c7e6",[[1,"ez-check",{label:[513],value:[1540],enabled:[516],mode:[513],getMode:[64],setFocus:[64]}]]],["p-97f77023",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1]}]]],["p-65893e25",[[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]}]]],["p-59a8448a",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-3602ab8c",[[0,"ez-form",{dataUnit:[1040],config:[16],submit:[64],cancel:[64],validate:[64]}]]],["p-73d3f767",[[0,"test-du"]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as t,f as n,H as r,g as i}from"./p-89a57641.js";import{UserInterface as o,ApplicationContext as a,Action as l,DataUnitAction as s,DataUnit as c}from"@sankhyalabs/core";import{A as d}from"./p-62daf508.js";const u=({name:t,label:n})=>e("div",{class:"col col--sd-12 col--tb-3 padding-horizontal--small"},e("ez-text-input",{label:n,"data-field-name":t,key:t}));function h(t,n,r,i=!1){return e("div",{class:"col col--sd-12 col--tb-3 align--middle padding-horizontal--small padding-bottom--large"},e("ez-check",{enabled:!r,label:n,mode:i?"switch":"regular","data-field-name":t,key:t}))}function f(t,n,r,i,o){return e("div",{class:"col col--sd-12 col--tb-3 padding-horizontal--small"},e("ez-number-input",{enabled:!r,label:n,precision:i,prettyPrecision:o,"data-field-name":t,key:t}))}const b=new Map;b.set(o.LONGTEXT,(({name:t,label:n,readOnly:r})=>e("div",{class:"col col--sd-12 padding-horizontal--small",key:t},e("ez-text-area",{enabled:!r,label:n,"data-field-name":t})))),b.set(o.CHECKBOX,(e=>h(e.name,e.label,e.readOnly,!1))),b.set(o.SWITCH,(e=>h(e.name,e.label,e.readOnly,!0))),b.set(o.OPTIONSELECTOR,(({name:t,label:n,readOnly:r,required:i},o)=>{const a=null==o?void 0:o.options;let l;if("string"==typeof a){const e=JSON.parse(a);l=Object.keys(e).map((t=>({value:t,label:e[t]})))}else l=a;return e("div",{class:"col col--sd-12 col--tb-3 padding-horizontal--small"},e("ez-combo-box",{enabled:!r,suppressEmptyOption:i,label:n,"data-field-name":t,key:t,options:l}))})),b.set(o.SEARCH,(({name:t,label:n,readOnly:r,required:i})=>e("div",{class:"col col--sd-12 col--tb-3 padding-horizontal--small"},e("ez-search",{enabled:!r,suppressEmptyOption:i,label:n,"data-field-name":t,key:t})))),b.set(o.FILE,(({name:t,label:n,readOnly:r})=>e("div",{class:"col col--sd-12 padding-horizontal--small"},e("ez-upload",{enabled:!r,label:n,urlUpload:"",requestHeaders:"",maxFiles:10,"data-field-name":t,key:t})))),b.set(o.DATE,(({name:t,label:n,readOnly:r})=>e("div",{class:"col col--sd-12 col--tb-3 padding-horizontal--small"},e("ez-date-input",{enabled:!r,label:n,"data-field-name":t,key:t})))),b.set(o.TIME,(({name:t,label:n})=>e("div",{class:"col col--sd-12 col--tb-3 padding-horizontal--small"},e("ez-time-input",{label:n,"data-field-name":t,key:t})))),b.set(o.DATETIME,(({name:t,label:n})=>e("div",{class:"col col--sd-12 col--tb-3 padding-horizontal--small"},e("ez-date-time-input",{label:n,"data-field-name":t,key:t})))),b.set(o.DECIMALNUMBER,(({name:e,label:t,readOnly:n},r)=>{const i=Number((null==r?void 0:r.precision)||2);return f(e,t,n,i,Number((null==r?void 0:r.prettyPrecision)||i))})),b.set(o.INTEGERNUMBER,(({name:e,label:t,readOnly:n})=>f(e,t,n,0,0)));const p=e=>{const t=e.descriptor,n=Object.assign({},e.config);let r,i;return t&&(n.label||(n.label=t.label),n.name||(n.name=t.name),void 0===n.required&&(n.required=t.required),void 0===n.readOnly&&(n.readOnly=t.readOnly),i=t.properties,r=b.get(t.userInterface)),n.required&&(n.label=`* ${n.label} (obrigatório)`),r||(r=u),r(n,i)},m=({source:t})=>"items"in t?e("ez-collapsible-box",{label:t.label},t.items.map((e=>p(e)))):p(t),v=({store:t,source:n})=>e("div",{class:"box__container"},e("div",{class:"row padding-vertical--small"},n.items.map((n=>e(m,{store:t,source:n})))));class y{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[]}getSheet(e){return this._sheets.get(e)}getAllSheets(){return this._sheets}addSheet(e){this._sheets.set(e.name,e),this._requiredFields=this._requiredFields.concat(e.requiredFields),this._cleanOnCopyFields=this._cleanOnCopyFields.concat(e.cleanOnCopyFields)}getRequiredFields(){return this._requiredFields}getCleanOnCopyFields(){return this._cleanOnCopyFields}}function w(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var g="function"==typeof Symbol&&Symbol.observable||"@@observable",O=function(){return Math.random().toString(36).substring(7).split("").join(".")},E={INIT:"@@redux/INIT"+O(),REPLACE:"@@redux/REPLACE"+O(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+O()}};function z(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function A(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(w(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(w(1));return n(A)(e,t)}if("function"!=typeof e)throw new Error(w(2));var i=e,o=t,a=[],l=a,s=!1;function c(){l===a&&(l=a.slice())}function d(){if(s)throw new Error(w(3));return o}function u(e){if("function"!=typeof e)throw new Error(w(4));if(s)throw new Error(w(5));var t=!0;return c(),l.push(e),function(){if(t){if(s)throw new Error(w(6));t=!1,c();var n=l.indexOf(e);l.splice(n,1),a=null}}}function h(e){if(!z(e))throw new Error(w(7));if(void 0===e.type)throw new Error(w(8));if(s)throw new Error(w(9));try{s=!0,o=i(o,e)}finally{s=!1}for(var t=a=l,n=0;n<t.length;n++)(0,t[n])();return e}function f(e){if("function"!=typeof e)throw new Error(w(10));i=e,h({type:E.REPLACE})}function b(){var e,t=u;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(w(11));function n(){e.next&&e.next(d())}return n(),{unsubscribe:t(n)}}})[g]=function(){return this},e}return h({type:E.INIT}),(r={dispatch:h,subscribe:u,getState:d,replaceReducer:f})[g]=b,r}const _={};function C(e=_,t){switch(t.type){case N.METADATA_LOADED:return Object.assign(Object.assign({},e),{formMetadata:t.payload});case N.CHANGE_TAB:return Object.assign(Object.assign({},e),{currentSheet:t.payload});default:return e}}function j(e){return e.formMetadata}var N;!function(e){e.METADATA_LOADED="FORM/METADATA_LOADED",e.CHANGE_TAB="FORM/CHANGE_TAB"}(N||(N={}));class x{constructor(e){this._fields=new Map,this._dataUnit=e,this._dataUnit.subscribe((()=>{var e;null===(e=this._fields)||void 0===e||e.forEach((e=>{this.updateValue(e.fieldName,e.field)}))}))}bind(e){e.forEach((e=>{const t=e.dataset.fieldName;this.updateBind(t,e),this.updateValue(t,e)}))}updateValue(e,t){t.value=this._dataUnit.getFieldValue(e)}updateBind(e,t){const n=this._fields.get(e);n&&n.destroy(),this._fields.set(e,R.create(e,t,((e,t)=>this.setFieldValue(e,t)))),this.bindSearchOptionsLoader(e,t)}setFieldValue(e,t){0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._dataUnit.setFieldValue(e,t)}bindSearchOptionsLoader(e,t){if("EZ-SEARCH"===t.nodeName&&void 0===t.optionLoader){const n=a.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");n&&(t.optionLoader=t=>n(t,e,this._dataUnit))}}}class R{destroy(){this.field.removeEventListener(this.eventName,this.eventListener)}static create(e,t,n){const r=new R;return r.fieldName=e,r.field=t,r.eventListener=t=>{n(e,t.detail)},r.eventName="ezChange",r.field.addEventListener(r.eventName,r.eventListener),r}}let k=class{constructor(e){t(this,e)}submit(){return Promise.resolve()}cancel(){return Promise.resolve()}validate(){return new Promise(((e,t)=>{const n=j(this._store.getState()),r=this._staticFields.filter((e=>e.dataset.required)).map((e=>e.dataset.fieldName)).concat(n.getRequiredFields()),i=this.dataUnit.records;for(let e=0;e<i.length;e++)if(!this.validateRequired(r,i[e])){t();break}e()}))}configChanged(){this.processMetadata()}validateRequired(e,t){const n=[];e.forEach((e=>{const r=t[e],i=this._element.querySelector(`[data-field-name=${e}]`);null==r||""===r?(n.push(e),i.errorMessage="Essa informação é obrigatória"):i.errorMessage=""}));const r=0===n.length;return r||d.info("Há pelo menos um campo obrigatório não preenchido."),r}getDynamicContent(){var t;const n=j(this._store.getState());if(!n)return null;const r=(i=null===(t=this._store)||void 0===t?void 0:t.getState()).currentSheet?i.formMetadata.getSheet(i.currentSheet):Array.from(i.formMetadata.getAllSheets().values())[0];var i;if(!r)return null;const o=Array.from(n.getAllSheets().values()),a=[];return o.length>1&&a.push(e("ez-tabselector",{onEzChange:e=>this._store.dispatch(function(e){return{type:N.CHANGE_TAB,payload:e.tabKey}}(e.detail)),selectedTab:r.name},o.map((t=>e("ez-tab",{tabKey:t.name,label:t.label}))))),a.push(e(v,{store:this._store,source:r})),a}processMetadata(){if(!this.isStatic()){const e=this.config&&this.config.length>0?((e,t)=>{const n=new Map,r=[],i=[];e.forEach((e=>{var o;if(!1!==e.visible){const a=function(e,t){return("string"==typeof e?Array.from(t.keys()).find((t=>t.label===e)):e)||{label:e,visible:!0}}(e.tab||"Geral",n),l=t.getField(e.name);if(l&&a.visible){n.has(a)||n.set(a,new Map);const t=n.get(a);(void 0===e.required?l.required:e.required)&&r.push(e.name),(void 0===e.cleanOnCopy?null===(o=l.properties)||void 0===o?void 0:o.cleanOnCopy:e.cleanOnCopy)&&i.push(e.name);const s={config:e,descriptor:l},c=e.group;if(c){const e=`group::${c}`;t.has(e)?t.get(e).items.push(s):t.set(e,{label:c,items:[s]})}else t.set(e.name,s)}}}));const o=new y;return Array.from(n.entries()).sort(((e,t)=>(e[0].order||1e4)-(t[0].order||1e4))).forEach((([e,t])=>{o.addSheet({label:e.label,name:e.label,items:Array.from(t.values()),requiredFields:r,cleanOnCopyFields:i})})),o})(this.config,this.dataUnit):(()=>{var e;const t=this.dataUnit.metadata,n=new y;if(t){const r=null===(e=t.fields)||void 0===e?void 0:e.filter((e=>!1!==e.visible));n.addSheet({label:t.label,name:t.name,items:r.map((e=>({descriptor:e}))),requiredFields:r.filter((e=>e.required)).map((e=>e.name)),cleanOnCopyFields:r.filter((e=>{var t;return null===(t=e.properties)||void 0===t?void 0:t.cleanOnCopy})).map((e=>e.name))})}return n})();this._store.dispatch({type:N.METADATA_LOADED,payload:e})}}isStatic(){var e;return(null===(e=this._staticFields)||void 0===e?void 0:e.length)>0}interceptAction(e){if(e.type===l.RECORDS_COPIED){const t=j(this._store.getState()).getCleanOnCopyFields();if(t)return new s(l.RECORDS_COPIED,e.payload.map((e=>{const n=Object.assign({},e);return t.forEach((e=>delete n[e])),n})))}return e}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new c("ez-form")),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe((e=>{e.type===l.METADATA_LOADED&&this.processMetadata()})),this._dataBinder=new x(this.dataUnit),this._store=A(C),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata()}componentDidRender(){this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")))}render(){return e(r,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return i(this)}static get watchers(){return{config:["configChanged"]}}};k.style="ez-form{display:flex;flex-direction:column;width:100%}";export{k as ez_form}
|