@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-77126.0 → 0.0.0-bugfix-dev-KB-77074.0
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/RecordValidationProcessor-10846595.js +108 -0
- package/dist/cjs/ez-card-item_3.cjs.entry.js +19 -12
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +10 -46
- package/dist/cjs/ez-date-input.cjs.entry.js +2 -8
- package/dist/cjs/ez-date-time-input.cjs.entry.js +2 -8
- package/dist/cjs/ez-dialog.cjs.entry.js +2 -10
- package/dist/cjs/ez-form-view.cjs.entry.js +2 -2
- package/dist/cjs/ez-form.cjs.entry.js +324 -4
- package/dist/cjs/ez-grid.cjs.entry.js +70542 -14645
- package/dist/cjs/ez-list.cjs.entry.js +100 -151
- package/dist/cjs/ez-number-input.cjs.entry.js +0 -7
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +12 -28
- package/dist/cjs/ez-text-area.cjs.entry.js +4 -66
- package/dist/cjs/ez-text-input.cjs.entry.js +7 -49
- package/dist/cjs/ez-time-input.cjs.entry.js +0 -6
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-card-item/ez-card-item.css +5 -14
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +14 -75
- package/dist/collection/components/ez-date-input/ez-date-input.js +4 -35
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +4 -35
- package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
- package/dist/collection/components/ez-dialog/ez-dialog.js +1 -9
- package/dist/collection/components/ez-filter-input/ez-filter-input.css +11 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +52 -22
- package/dist/collection/components/ez-form/ez-form.js +0 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +25 -80
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +0 -8
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +46 -167
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +0 -7
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +1 -4
- package/dist/collection/components/ez-grid/ez-grid.js +3 -90
- package/dist/collection/components/ez-list/ez-list.css +5 -5
- package/dist/collection/components/ez-list/ez-list.js +170 -152
- package/dist/collection/components/ez-number-input/ez-number-input.js +0 -25
- package/dist/collection/components/ez-popover/ez-popover.css +10 -3
- package/dist/collection/components/ez-popup/ez-popup.js +1 -1
- package/dist/collection/components/ez-search/ez-search.css +1 -1
- package/dist/collection/components/ez-search/ez-search.js +14 -55
- package/dist/collection/components/ez-text-area/ez-text-area.css +0 -49
- package/dist/collection/components/ez-text-area/ez-text-area.js +2 -102
- package/dist/collection/components/ez-text-input/ez-text-input.css +53 -27
- package/dist/collection/components/ez-text-input/ez-text-input.js +6 -84
- package/dist/collection/components/ez-time-input/ez-time-input.js +0 -24
- package/dist/collection/utils/form/DataBinder.js +3 -18
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/custom-elements/index.js +70890 -15272
- package/dist/esm/RecordValidationProcessor-9c6cc267.js +105 -0
- package/dist/esm/ez-card-item_3.entry.js +19 -12
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +11 -47
- package/dist/esm/ez-date-input.entry.js +2 -8
- package/dist/esm/ez-date-time-input.entry.js +2 -8
- package/dist/esm/ez-dialog.entry.js +2 -10
- package/dist/esm/ez-form-view.entry.js +2 -2
- package/dist/esm/ez-form.entry.js +323 -3
- package/dist/esm/ez-grid.entry.js +70542 -14645
- package/dist/esm/ez-list.entry.js +101 -152
- package/dist/esm/ez-number-input.entry.js +0 -7
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +12 -28
- package/dist/esm/ez-text-area.entry.js +4 -66
- package/dist/esm/ez-text-input.entry.js +7 -49
- package/dist/esm/ez-time-input.entry.js +0 -6
- 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-188f1c4c.entry.js +1 -0
- package/dist/ezui/p-49456b34.entry.js +1 -0
- package/dist/ezui/p-5a90d7d1.entry.js +1 -0
- package/dist/ezui/p-5b205c80.entry.js +1 -0
- package/dist/ezui/p-62732269.entry.js +1 -0
- package/dist/ezui/p-86b6aa01.entry.js +1 -0
- package/dist/ezui/p-b3b94f72.entry.js +1 -0
- package/dist/ezui/p-b95632e8.entry.js +1 -0
- package/dist/ezui/p-bcd47eda.entry.js +1 -0
- package/dist/ezui/p-c3c3d640.entry.js +304 -0
- package/dist/ezui/p-cdc472cc.entry.js +1 -0
- package/dist/ezui/p-d2c06f38.entry.js +1 -0
- package/dist/ezui/p-d8f64bb7.entry.js +1 -0
- package/dist/ezui/p-dc4ada32.entry.js +1 -0
- package/dist/ezui/p-e85c48d7.entry.js +1 -0
- package/dist/ezui/p-f299c608.entry.js +1 -0
- package/dist/ezui/p-f42855b9.js +1 -0
- package/dist/ezui/p-f80ac647.entry.js +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -7
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +1 -6
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +1 -6
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +0 -2
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +11 -4
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +0 -12
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -7
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -2
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -19
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +1 -3
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +0 -1
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +1 -11
- package/dist/types/components/ez-list/ez-list.d.ts +26 -3
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +0 -4
- package/dist/types/components/ez-search/ez-search.d.ts +1 -6
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +0 -17
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +0 -9
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +0 -4
- package/dist/types/components.d.ts +42 -107
- package/dist/types/utils/form/DataBinder.d.ts +0 -3
- package/package.json +4 -11
- package/dist/cjs/DataBinder-3b083480.js +0 -445
- package/dist/cjs/FocusResolver-885f2173.js +0 -35
- package/dist/collection/utils/FocusResolver.js +0 -31
- package/dist/esm/DataBinder-02fa9bb9.js +0 -441
- package/dist/esm/FocusResolver-1ccbf850.js +0 -33
- package/dist/ezui/p-0a75bb05.entry.js +0 -1
- package/dist/ezui/p-0db68715.entry.js +0 -1
- package/dist/ezui/p-19098a3f.entry.js +0 -1
- package/dist/ezui/p-1f830a2f.entry.js +0 -1
- package/dist/ezui/p-2aa8e4b2.entry.js +0 -1
- package/dist/ezui/p-3dd919b7.entry.js +0 -1
- package/dist/ezui/p-455e737c.js +0 -1
- package/dist/ezui/p-8d0f02c7.entry.js +0 -309
- package/dist/ezui/p-91266ddd.entry.js +0 -1
- package/dist/ezui/p-97af4b13.entry.js +0 -1
- package/dist/ezui/p-a5b91a77.entry.js +0 -1
- package/dist/ezui/p-a80b1287.entry.js +0 -1
- package/dist/ezui/p-b54e17d2.entry.js +0 -1
- package/dist/ezui/p-bfad39eb.entry.js +0 -1
- package/dist/ezui/p-c27b2e17.entry.js +0 -1
- package/dist/ezui/p-cd2e78f0.entry.js +0 -1
- package/dist/ezui/p-d0ca26fe.entry.js +0 -1
- package/dist/ezui/p-dc628ed3.js +0 -1
- package/dist/ezui/p-ffd246f5.entry.js +0 -1
- package/dist/types/utils/FocusResolver.d.ts +0 -5
|
@@ -7,13 +7,11 @@ export class EzTextInput {
|
|
|
7
7
|
this.enabled = true;
|
|
8
8
|
this.errorMessage = undefined;
|
|
9
9
|
this.mask = undefined;
|
|
10
|
-
this.cleanValueMask = false;
|
|
11
10
|
this.canShowError = true;
|
|
12
11
|
this.restrict = undefined;
|
|
13
12
|
this.mode = "regular";
|
|
14
13
|
this.noBorder = false;
|
|
15
14
|
this.password = false;
|
|
16
|
-
this.autoFocus = false;
|
|
17
15
|
}
|
|
18
16
|
observeErrorMessage() {
|
|
19
17
|
if (this._inputElem) {
|
|
@@ -123,12 +121,7 @@ export class EzTextInput {
|
|
|
123
121
|
const value = this._inputElem.value;
|
|
124
122
|
if (value && this._maskFormatter) {
|
|
125
123
|
try {
|
|
126
|
-
|
|
127
|
-
this.applyMask(value);
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
this._inputElem.value = this._maskFormatter.format(value);
|
|
131
|
-
}
|
|
124
|
+
this._inputElem.value = this._maskFormatter.format(value);
|
|
132
125
|
}
|
|
133
126
|
catch (e) {
|
|
134
127
|
this.errorMessage = e.message;
|
|
@@ -146,34 +139,8 @@ export class EzTextInput {
|
|
|
146
139
|
}
|
|
147
140
|
controlChangeValue() {
|
|
148
141
|
if (this._inputElem && (this.value || '') !== this._inputElem.value) {
|
|
149
|
-
|
|
150
|
-
this.value = this._maskFormatter.removeMask(this._inputElem.value);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
this.value = this._inputElem.value;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
applyMask(value) {
|
|
158
|
-
if (!value || value === "")
|
|
159
|
-
return value;
|
|
160
|
-
if (this._maskFormatter) {
|
|
161
|
-
try {
|
|
162
|
-
const formattedValue = this._maskFormatter.applyMask(this._maskFormatter.removeMask(value));
|
|
163
|
-
if (this._inputElem) {
|
|
164
|
-
this._inputElem.value = formattedValue;
|
|
165
|
-
return this._inputElem.value;
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
this.value = formattedValue;
|
|
169
|
-
return this.value;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
catch (e) {
|
|
173
|
-
this.errorMessage = e.message;
|
|
174
|
-
}
|
|
142
|
+
this.value = this._inputElem.value;
|
|
175
143
|
}
|
|
176
|
-
return value;
|
|
177
144
|
}
|
|
178
145
|
handleChange() {
|
|
179
146
|
if (!this._inputElem) {
|
|
@@ -198,9 +165,9 @@ export class EzTextInput {
|
|
|
198
165
|
content.style.justifyContent = "center";
|
|
199
166
|
content.style.overflow = "hidden";
|
|
200
167
|
content.style.top = "0px";
|
|
201
|
-
content.style.width = "var(--ez-text-input__icon--width)";
|
|
202
168
|
content.style.height = this.mode != "slim" ? "var(--ez-text-input--height)" : "var(--ez-text-input--height--slim)";
|
|
203
169
|
if (slot.name == "leftIcon") {
|
|
170
|
+
content.style.width = "var(--ez-text-input__icon--left--width)";
|
|
204
171
|
content.style.left = "0px";
|
|
205
172
|
content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
|
|
206
173
|
this._inputElem.classList.add("icon--left");
|
|
@@ -210,6 +177,7 @@ export class EzTextInput {
|
|
|
210
177
|
this._contentLeftSlot = content;
|
|
211
178
|
}
|
|
212
179
|
else if (slot.name == "rightIcon") {
|
|
180
|
+
content.style.width = "var(--ez-text-input__icon--right--width)";
|
|
213
181
|
content.style.right = "0px";
|
|
214
182
|
content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
|
|
215
183
|
this._inputElem.classList.add("icon--right");
|
|
@@ -235,11 +203,6 @@ export class EzTextInput {
|
|
|
235
203
|
this.observeMask();
|
|
236
204
|
this.adjustFloatingLabel();
|
|
237
205
|
this.adjustBorderInput();
|
|
238
|
-
if (this.autoFocus) {
|
|
239
|
-
requestAnimationFrame(() => {
|
|
240
|
-
this.setFocus({ selectText: true });
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
206
|
this._inputElem.addEventListener('focus', () => {
|
|
244
207
|
this._inputElem.setSelectionRange(0, this._inputElem.value.length);
|
|
245
208
|
});
|
|
@@ -249,12 +212,7 @@ export class EzTextInput {
|
|
|
249
212
|
if (this.value) {
|
|
250
213
|
if (this._maskFormatter) {
|
|
251
214
|
try {
|
|
252
|
-
|
|
253
|
-
this.applyMask(this.value);
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
this.value = this._maskFormatter.format(this.value);
|
|
257
|
-
}
|
|
215
|
+
this.value = this._maskFormatter.format(this.value);
|
|
258
216
|
}
|
|
259
217
|
catch (e) {
|
|
260
218
|
this.errorMessage = e.message;
|
|
@@ -270,7 +228,7 @@ export class EzTextInput {
|
|
|
270
228
|
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
271
229
|
return (h(Host, { style: this._hostElement.classList.contains("grid_editor") ? { "height": "100%" } : null }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label && this.mode != "slim" ?
|
|
272
230
|
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
273
|
-
: null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.
|
|
231
|
+
: null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError && this.mode != "slim" &&
|
|
274
232
|
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage, "data-element-id": ElementIDUtils.getInternalIDInfo("message_box") }, this.errorMessage)));
|
|
275
233
|
}
|
|
276
234
|
static get is() { return "ez-text-input"; }
|
|
@@ -373,24 +331,6 @@ export class EzTextInput {
|
|
|
373
331
|
"attribute": "mask",
|
|
374
332
|
"reflect": false
|
|
375
333
|
},
|
|
376
|
-
"cleanValueMask": {
|
|
377
|
-
"type": "boolean",
|
|
378
|
-
"mutable": false,
|
|
379
|
-
"complexType": {
|
|
380
|
-
"original": "boolean",
|
|
381
|
-
"resolved": "boolean",
|
|
382
|
-
"references": {}
|
|
383
|
-
},
|
|
384
|
-
"required": false,
|
|
385
|
-
"optional": false,
|
|
386
|
-
"docs": {
|
|
387
|
-
"tags": [],
|
|
388
|
-
"text": "Para remover a m\u00E1scara quando fizer um apply no formul\u00E1rio."
|
|
389
|
-
},
|
|
390
|
-
"attribute": "clean-value-mask",
|
|
391
|
-
"reflect": false,
|
|
392
|
-
"defaultValue": "false"
|
|
393
|
-
},
|
|
394
334
|
"canShowError": {
|
|
395
335
|
"type": "boolean",
|
|
396
336
|
"mutable": false,
|
|
@@ -479,24 +419,6 @@ export class EzTextInput {
|
|
|
479
419
|
"attribute": "password",
|
|
480
420
|
"reflect": false,
|
|
481
421
|
"defaultValue": "false"
|
|
482
|
-
},
|
|
483
|
-
"autoFocus": {
|
|
484
|
-
"type": "boolean",
|
|
485
|
-
"mutable": false,
|
|
486
|
-
"complexType": {
|
|
487
|
-
"original": "boolean",
|
|
488
|
-
"resolved": "boolean",
|
|
489
|
-
"references": {}
|
|
490
|
-
},
|
|
491
|
-
"required": false,
|
|
492
|
-
"optional": false,
|
|
493
|
-
"docs": {
|
|
494
|
-
"tags": [],
|
|
495
|
-
"text": "Se true o campo receber\u00E1 o foco ao ser renderizado."
|
|
496
|
-
},
|
|
497
|
-
"attribute": "auto-focus",
|
|
498
|
-
"reflect": false,
|
|
499
|
-
"defaultValue": "false"
|
|
500
422
|
}
|
|
501
423
|
};
|
|
502
424
|
}
|
|
@@ -10,7 +10,6 @@ export class EzTimeInput {
|
|
|
10
10
|
this.showSeconds = false;
|
|
11
11
|
this.mode = "regular";
|
|
12
12
|
this.canShowError = true;
|
|
13
|
-
this.autoFocus = false;
|
|
14
13
|
}
|
|
15
14
|
observeErrorMessage() {
|
|
16
15
|
var _a;
|
|
@@ -131,11 +130,6 @@ export class EzTimeInput {
|
|
|
131
130
|
//---------------------------------------------
|
|
132
131
|
componentDidLoad() {
|
|
133
132
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
134
|
-
if (this.autoFocus) {
|
|
135
|
-
requestAnimationFrame(() => {
|
|
136
|
-
this.setFocus({ selectText: true });
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
133
|
}
|
|
140
134
|
componentWillLoad() {
|
|
141
135
|
this.observeShowSeconds();
|
|
@@ -287,24 +281,6 @@ export class EzTimeInput {
|
|
|
287
281
|
"attribute": "can-show-error",
|
|
288
282
|
"reflect": true,
|
|
289
283
|
"defaultValue": "true"
|
|
290
|
-
},
|
|
291
|
-
"autoFocus": {
|
|
292
|
-
"type": "boolean",
|
|
293
|
-
"mutable": false,
|
|
294
|
-
"complexType": {
|
|
295
|
-
"original": "boolean",
|
|
296
|
-
"resolved": "boolean",
|
|
297
|
-
"references": {}
|
|
298
|
-
},
|
|
299
|
-
"required": false,
|
|
300
|
-
"optional": false,
|
|
301
|
-
"docs": {
|
|
302
|
-
"tags": [],
|
|
303
|
-
"text": "Se true o campo de texto receber\u00E1 o foco ao ser renderizado."
|
|
304
|
-
},
|
|
305
|
-
"attribute": "auto-focus",
|
|
306
|
-
"reflect": false,
|
|
307
|
-
"defaultValue": "false"
|
|
308
284
|
}
|
|
309
285
|
};
|
|
310
286
|
}
|
|
@@ -22,7 +22,6 @@ export default class DataBinder {
|
|
|
22
22
|
(_a = this._fields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
|
|
23
23
|
this.updateValue(field.fieldName, field.field);
|
|
24
24
|
});
|
|
25
|
-
this.clearFieldError(Object.keys(action.payload)[0]);
|
|
26
25
|
break;
|
|
27
26
|
case Action.FIELD_INVALIDATED:
|
|
28
27
|
(_b = this._fields) === null || _b === void 0 ? void 0 : _b.forEach(field => {
|
|
@@ -68,14 +67,11 @@ export default class DataBinder {
|
|
|
68
67
|
});
|
|
69
68
|
this._formMetadata = formMetadata;
|
|
70
69
|
this._recordValidatorProcessor = new RecordValidationProcessor(this._dataUnit, {
|
|
71
|
-
getRequiredFields: () => this.
|
|
70
|
+
getRequiredFields: () => this._formMetadata.getRequiredFields(),
|
|
72
71
|
markAsInvalid: field => this.markInvalid(field),
|
|
73
72
|
getMessageForField: field => this.getErrorMessage(field),
|
|
74
73
|
}, recordsValidator);
|
|
75
74
|
}
|
|
76
|
-
getFormRequiredFields() {
|
|
77
|
-
return this._formMetadata.getRequiredFields();
|
|
78
|
-
}
|
|
79
75
|
disconnectDataUnit() {
|
|
80
76
|
const dataBindersByDataUnit = ApplicationContext.getContextValue("__DATABINDER_BY_DATAUNIT__") || new Map();
|
|
81
77
|
const dataBinders = dataBindersByDataUnit.get(this._dataUnit.dataUnitId);
|
|
@@ -115,14 +111,6 @@ export default class DataBinder {
|
|
|
115
111
|
fieldElement["errorMessage"] = "";
|
|
116
112
|
});
|
|
117
113
|
}
|
|
118
|
-
clearFieldError(fieldName) {
|
|
119
|
-
var _a;
|
|
120
|
-
const field = (_a = this._fields.get(fieldName)) === null || _a === void 0 ? void 0 : _a.field;
|
|
121
|
-
if (field["errorMessage"]) {
|
|
122
|
-
field["errorMessage"] = "";
|
|
123
|
-
this._dataUnit.clearInvalid(this.getCurrentRecordId(), fieldName);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
114
|
updateValue(fieldName, field) {
|
|
127
115
|
const bind = this._fields.get(fieldName);
|
|
128
116
|
try {
|
|
@@ -143,7 +131,8 @@ export default class DataBinder {
|
|
|
143
131
|
}
|
|
144
132
|
static async validateByDataunit(dataUnit) {
|
|
145
133
|
try {
|
|
146
|
-
const
|
|
134
|
+
const dataBindersByDataUnit = ApplicationContext.getContextValue("__DATABINDER_BY_DATAUNIT__");
|
|
135
|
+
const dataBinders = dataBindersByDataUnit.get(dataUnit.dataUnitId) || [];
|
|
147
136
|
await Promise.all(dataBinders.map((dataBinder) => dataBinder.validate()));
|
|
148
137
|
return true;
|
|
149
138
|
}
|
|
@@ -151,10 +140,6 @@ export default class DataBinder {
|
|
|
151
140
|
return false;
|
|
152
141
|
}
|
|
153
142
|
}
|
|
154
|
-
static getDataBindersByDataUnit(dataUnit) {
|
|
155
|
-
const dataBindersByDataUnit = ApplicationContext.getContextValue("__DATABINDER_BY_DATAUNIT__");
|
|
156
|
-
return dataBindersByDataUnit.get(dataUnit.dataUnitId) || [];
|
|
157
|
-
}
|
|
158
143
|
updateErrorMessage(fieldName, field, message) {
|
|
159
144
|
if (message == undefined) {
|
|
160
145
|
message = this._dataUnit.getInvalidMessage(this.getCurrentRecordId(), fieldName);
|