@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-66441.1 → 0.0.0-bugfix-dev-KB-38445.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/ez-chart.cjs.entry.js +2 -0
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +5 -2
- package/dist/cjs/ez-search.cjs.entry.js +31 -33
- package/dist/collection/components/ez-chart/ez-chart.js +2 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +5 -2
- package/dist/collection/components/ez-search/ez-search.js +31 -33
- package/dist/custom-elements/index.js +38 -35
- package/dist/esm/ez-chart.entry.js +2 -0
- package/dist/esm/ez-custom-form-input_2.entry.js +5 -2
- package/dist/esm/ez-search.entry.js +31 -33
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-1c462106.entry.js +1 -0
- package/dist/ezui/p-4d5235f1.entry.js +1 -0
- package/dist/ezui/{p-ffef392d.entry.js → p-5b205c80.entry.js} +1 -1
- package/dist/types/components/ez-search/ez-search.d.ts +1 -2
- package/package.json +1 -1
- package/dist/ezui/p-2b0f9845.entry.js +0 -1
- package/dist/ezui/p-5264876b.entry.js +0 -1
|
@@ -80,7 +80,9 @@ const EzCustomFormInput = class {
|
|
|
80
80
|
if (typeof gui === 'string') {
|
|
81
81
|
gui = core.HTMLBuilder.parseElement(gui);
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
if (this.value) {
|
|
84
|
+
gui.setAttribute('value', typeof this.value === 'object' ? this.value.value : this.value);
|
|
85
|
+
}
|
|
84
86
|
this.gui = index.h("div", { key: core.StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
|
|
85
87
|
}
|
|
86
88
|
setValue(value) {
|
|
@@ -90,8 +92,9 @@ const EzCustomFormInput = class {
|
|
|
90
92
|
return this.value;
|
|
91
93
|
}
|
|
92
94
|
handleValue(gui) {
|
|
95
|
+
var _a;
|
|
93
96
|
//@ts-ignore
|
|
94
|
-
gui.$children
|
|
97
|
+
(_a = gui.$children$) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
95
98
|
child.$attrs$.value = this.value;
|
|
96
99
|
});
|
|
97
100
|
}
|
|
@@ -24,6 +24,7 @@ const EzSearch = class {
|
|
|
24
24
|
this._tabPressed = false;
|
|
25
25
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
26
26
|
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
27
|
+
this._lookupMode = false;
|
|
27
28
|
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
28
29
|
this._endHighlightTag = "</span>";
|
|
29
30
|
this._preSelection = undefined;
|
|
@@ -52,35 +53,36 @@ const EzSearch = class {
|
|
|
52
53
|
var _a;
|
|
53
54
|
if (this._textInput) {
|
|
54
55
|
this._textInput.errorMessage = this.errorMessage;
|
|
55
|
-
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())
|
|
56
|
+
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
56
57
|
this.setInputValue();
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
validateNewValue(newValue, oldValue) {
|
|
61
|
-
if (typeof newValue == 'string' && typeof oldValue == 'object' && newValue === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.value))
|
|
62
|
-
return false;
|
|
63
|
-
if (typeof newValue == 'object' && typeof oldValue == 'string' && (newValue === null || newValue === void 0 ? void 0 : newValue.value) === oldValue)
|
|
64
|
-
return false;
|
|
65
|
-
if (typeof newValue == 'object' && typeof oldValue == 'object' && (newValue === null || newValue === void 0 ? void 0 : newValue.value) === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.value))
|
|
66
|
-
return false;
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
61
|
async observeValue(newValue, oldValue) {
|
|
70
|
-
if (this._textInput && newValue != oldValue
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
if (this._textInput && newValue != oldValue) {
|
|
63
|
+
try {
|
|
64
|
+
if (typeof newValue === "string") {
|
|
65
|
+
await this.handleValueAsString(newValue);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const newValueSelected = this.getSelectedOption(newValue);
|
|
69
|
+
const oldValueSelected = this.getSelectedOption(oldValue);
|
|
70
|
+
const currentValue = this.getSelectedOption(this.value);
|
|
71
|
+
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
72
|
+
this.value = newValueSelected;
|
|
73
|
+
}
|
|
74
|
+
if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
|
|
75
|
+
this.setInputValue();
|
|
76
|
+
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
77
|
+
if (!this._lookupMode) {
|
|
78
|
+
this.ezChange.emit(valueEmitted);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this.resetOptions();
|
|
74
82
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
78
|
-
this._currentValue = newValueSelected;
|
|
79
|
-
this.setInputValue();
|
|
80
|
-
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
81
|
-
this.ezChange.emit(valueEmitted);
|
|
83
|
+
finally {
|
|
84
|
+
this._lookupMode = false;
|
|
82
85
|
}
|
|
83
|
-
this.resetOptions();
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
observeOptions(newOptions, oldOptions) {
|
|
@@ -153,9 +155,7 @@ const EzSearch = class {
|
|
|
153
155
|
return;
|
|
154
156
|
}
|
|
155
157
|
await this.loadDescriptionValue(value);
|
|
156
|
-
this.setInputValue();
|
|
157
158
|
this.ezChange.emit(this.value);
|
|
158
|
-
this._currentValue = this.value;
|
|
159
159
|
}
|
|
160
160
|
updateListPosition() {
|
|
161
161
|
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
@@ -212,7 +212,7 @@ const EzSearch = class {
|
|
|
212
212
|
return text;
|
|
213
213
|
}
|
|
214
214
|
getText() {
|
|
215
|
-
const currentValue = this.getSelectedOption(this.
|
|
215
|
+
const currentValue = this.getSelectedOption(this.value);
|
|
216
216
|
const text = this.getFormattedText(currentValue);
|
|
217
217
|
if (text == undefined) {
|
|
218
218
|
return;
|
|
@@ -387,7 +387,6 @@ const EzSearch = class {
|
|
|
387
387
|
|| (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
|
|
388
388
|
const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
|
|
389
389
|
this.value = adjustedOpt;
|
|
390
|
-
this._currentValue = adjustedOpt;
|
|
391
390
|
}
|
|
392
391
|
else {
|
|
393
392
|
this.setInputValue();
|
|
@@ -408,7 +407,7 @@ const EzSearch = class {
|
|
|
408
407
|
}
|
|
409
408
|
}
|
|
410
409
|
cancelPreselection() {
|
|
411
|
-
if (!this._textInput.value && this.
|
|
410
|
+
if (!this._textInput.value && this.value) {
|
|
412
411
|
this.selectOption(undefined);
|
|
413
412
|
}
|
|
414
413
|
else {
|
|
@@ -429,7 +428,6 @@ const EzSearch = class {
|
|
|
429
428
|
}
|
|
430
429
|
clearSearch() {
|
|
431
430
|
this.value = null;
|
|
432
|
-
this._currentValue = null;
|
|
433
431
|
}
|
|
434
432
|
controlListWithOnlyOne() {
|
|
435
433
|
var _a, _b;
|
|
@@ -459,13 +457,13 @@ const EzSearch = class {
|
|
|
459
457
|
if (core.StringUtils.isEmpty(this.value)) {
|
|
460
458
|
return;
|
|
461
459
|
}
|
|
462
|
-
if (!this.validateNewValue(this.value, this._currentValue)) {
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
460
|
let value = this.value;
|
|
466
461
|
if (typeof value === "object") {
|
|
467
462
|
return;
|
|
468
463
|
}
|
|
464
|
+
if (core.StringUtils.isEmpty(value)) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
469
467
|
this.loadDescriptionValue(value);
|
|
470
468
|
}
|
|
471
469
|
async loadDescriptionValue(argument) {
|
|
@@ -500,8 +498,8 @@ const EzSearch = class {
|
|
|
500
498
|
this.showNoResultMessage();
|
|
501
499
|
return;
|
|
502
500
|
}
|
|
503
|
-
this.
|
|
504
|
-
this.value = this.
|
|
501
|
+
this._lookupMode = true;
|
|
502
|
+
this.value = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
505
503
|
}
|
|
506
504
|
loadOptionValue(argument) {
|
|
507
505
|
var _a;
|
|
@@ -71,7 +71,9 @@ export class EzCustomFormInput {
|
|
|
71
71
|
if (typeof gui === 'string') {
|
|
72
72
|
gui = HTMLBuilder.parseElement(gui);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
if (this.value) {
|
|
75
|
+
gui.setAttribute('value', typeof this.value === 'object' ? this.value.value : this.value);
|
|
76
|
+
}
|
|
75
77
|
this.gui = h("div", { key: StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
|
|
76
78
|
}
|
|
77
79
|
setValue(value) {
|
|
@@ -81,8 +83,9 @@ export class EzCustomFormInput {
|
|
|
81
83
|
return this.value;
|
|
82
84
|
}
|
|
83
85
|
handleValue(gui) {
|
|
86
|
+
var _a;
|
|
84
87
|
//@ts-ignore
|
|
85
|
-
gui.$children
|
|
88
|
+
(_a = gui.$children$) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
86
89
|
child.$attrs$.value = this.value;
|
|
87
90
|
});
|
|
88
91
|
}
|
|
@@ -12,6 +12,7 @@ export class EzSearch {
|
|
|
12
12
|
this._tabPressed = false;
|
|
13
13
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
14
14
|
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
15
|
+
this._lookupMode = false;
|
|
15
16
|
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
16
17
|
this._endHighlightTag = "</span>";
|
|
17
18
|
this._preSelection = undefined;
|
|
@@ -40,35 +41,36 @@ export class EzSearch {
|
|
|
40
41
|
var _a;
|
|
41
42
|
if (this._textInput) {
|
|
42
43
|
this._textInput.errorMessage = this.errorMessage;
|
|
43
|
-
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())
|
|
44
|
+
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
44
45
|
this.setInputValue();
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
validateNewValue(newValue, oldValue) {
|
|
49
|
-
if (typeof newValue == 'string' && typeof oldValue == 'object' && newValue === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.value))
|
|
50
|
-
return false;
|
|
51
|
-
if (typeof newValue == 'object' && typeof oldValue == 'string' && (newValue === null || newValue === void 0 ? void 0 : newValue.value) === oldValue)
|
|
52
|
-
return false;
|
|
53
|
-
if (typeof newValue == 'object' && typeof oldValue == 'object' && (newValue === null || newValue === void 0 ? void 0 : newValue.value) === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.value))
|
|
54
|
-
return false;
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
49
|
async observeValue(newValue, oldValue) {
|
|
58
|
-
if (this._textInput && newValue != oldValue
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
if (this._textInput && newValue != oldValue) {
|
|
51
|
+
try {
|
|
52
|
+
if (typeof newValue === "string") {
|
|
53
|
+
await this.handleValueAsString(newValue);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const newValueSelected = this.getSelectedOption(newValue);
|
|
57
|
+
const oldValueSelected = this.getSelectedOption(oldValue);
|
|
58
|
+
const currentValue = this.getSelectedOption(this.value);
|
|
59
|
+
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
60
|
+
this.value = newValueSelected;
|
|
61
|
+
}
|
|
62
|
+
if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
|
|
63
|
+
this.setInputValue();
|
|
64
|
+
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
65
|
+
if (!this._lookupMode) {
|
|
66
|
+
this.ezChange.emit(valueEmitted);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
this.resetOptions();
|
|
62
70
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
66
|
-
this._currentValue = newValueSelected;
|
|
67
|
-
this.setInputValue();
|
|
68
|
-
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
69
|
-
this.ezChange.emit(valueEmitted);
|
|
71
|
+
finally {
|
|
72
|
+
this._lookupMode = false;
|
|
70
73
|
}
|
|
71
|
-
this.resetOptions();
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
observeOptions(newOptions, oldOptions) {
|
|
@@ -141,9 +143,7 @@ export class EzSearch {
|
|
|
141
143
|
return;
|
|
142
144
|
}
|
|
143
145
|
await this.loadDescriptionValue(value);
|
|
144
|
-
this.setInputValue();
|
|
145
146
|
this.ezChange.emit(this.value);
|
|
146
|
-
this._currentValue = this.value;
|
|
147
147
|
}
|
|
148
148
|
updateListPosition() {
|
|
149
149
|
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
@@ -200,7 +200,7 @@ export class EzSearch {
|
|
|
200
200
|
return text;
|
|
201
201
|
}
|
|
202
202
|
getText() {
|
|
203
|
-
const currentValue = this.getSelectedOption(this.
|
|
203
|
+
const currentValue = this.getSelectedOption(this.value);
|
|
204
204
|
const text = this.getFormattedText(currentValue);
|
|
205
205
|
if (text == undefined) {
|
|
206
206
|
return;
|
|
@@ -375,7 +375,6 @@ export class EzSearch {
|
|
|
375
375
|
|| (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
|
|
376
376
|
const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
|
|
377
377
|
this.value = adjustedOpt;
|
|
378
|
-
this._currentValue = adjustedOpt;
|
|
379
378
|
}
|
|
380
379
|
else {
|
|
381
380
|
this.setInputValue();
|
|
@@ -396,7 +395,7 @@ export class EzSearch {
|
|
|
396
395
|
}
|
|
397
396
|
}
|
|
398
397
|
cancelPreselection() {
|
|
399
|
-
if (!this._textInput.value && this.
|
|
398
|
+
if (!this._textInput.value && this.value) {
|
|
400
399
|
this.selectOption(undefined);
|
|
401
400
|
}
|
|
402
401
|
else {
|
|
@@ -417,7 +416,6 @@ export class EzSearch {
|
|
|
417
416
|
}
|
|
418
417
|
clearSearch() {
|
|
419
418
|
this.value = null;
|
|
420
|
-
this._currentValue = null;
|
|
421
419
|
}
|
|
422
420
|
controlListWithOnlyOne() {
|
|
423
421
|
var _a, _b;
|
|
@@ -447,13 +445,13 @@ export class EzSearch {
|
|
|
447
445
|
if (StringUtils.isEmpty(this.value)) {
|
|
448
446
|
return;
|
|
449
447
|
}
|
|
450
|
-
if (!this.validateNewValue(this.value, this._currentValue)) {
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
448
|
let value = this.value;
|
|
454
449
|
if (typeof value === "object") {
|
|
455
450
|
return;
|
|
456
451
|
}
|
|
452
|
+
if (StringUtils.isEmpty(value)) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
457
455
|
this.loadDescriptionValue(value);
|
|
458
456
|
}
|
|
459
457
|
async loadDescriptionValue(argument) {
|
|
@@ -488,8 +486,8 @@ export class EzSearch {
|
|
|
488
486
|
this.showNoResultMessage();
|
|
489
487
|
return;
|
|
490
488
|
}
|
|
491
|
-
this.
|
|
492
|
-
this.value = this.
|
|
489
|
+
this._lookupMode = true;
|
|
490
|
+
this.value = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
493
491
|
}
|
|
494
492
|
loadOptionValue(argument) {
|
|
495
493
|
var _a;
|
|
@@ -2491,6 +2491,8 @@ const EzChart$1 = class extends HTMLElement$1 {
|
|
|
2491
2491
|
subTitle: this.chartSubTitle,
|
|
2492
2492
|
legendEnabled: this.legendEnabled,
|
|
2493
2493
|
onClickSerie: this.ezSerieClick,
|
|
2494
|
+
width: this.width,
|
|
2495
|
+
height: this.height
|
|
2494
2496
|
});
|
|
2495
2497
|
}
|
|
2496
2498
|
componentWillLoad() {
|
|
@@ -3456,7 +3458,9 @@ const EzCustomFormInput$1 = class extends HTMLElement$1 {
|
|
|
3456
3458
|
if (typeof gui === 'string') {
|
|
3457
3459
|
gui = HTMLBuilder.parseElement(gui);
|
|
3458
3460
|
}
|
|
3459
|
-
|
|
3461
|
+
if (this.value) {
|
|
3462
|
+
gui.setAttribute('value', typeof this.value === 'object' ? this.value.value : this.value);
|
|
3463
|
+
}
|
|
3460
3464
|
this.gui = h("div", { key: StringUtils$1.generateUUID(), ref: el => el && el.appendChild(gui) });
|
|
3461
3465
|
}
|
|
3462
3466
|
setValue(value) {
|
|
@@ -3466,8 +3470,9 @@ const EzCustomFormInput$1 = class extends HTMLElement$1 {
|
|
|
3466
3470
|
return this.value;
|
|
3467
3471
|
}
|
|
3468
3472
|
handleValue(gui) {
|
|
3473
|
+
var _a;
|
|
3469
3474
|
//@ts-ignore
|
|
3470
|
-
gui.$children
|
|
3475
|
+
(_a = gui.$children$) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
3471
3476
|
child.$attrs$.value = this.value;
|
|
3472
3477
|
});
|
|
3473
3478
|
}
|
|
@@ -128687,6 +128692,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
128687
128692
|
this._tabPressed = false;
|
|
128688
128693
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
128689
128694
|
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
128695
|
+
this._lookupMode = false;
|
|
128690
128696
|
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
128691
128697
|
this._endHighlightTag = "</span>";
|
|
128692
128698
|
this._preSelection = undefined;
|
|
@@ -128715,35 +128721,36 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
128715
128721
|
var _a;
|
|
128716
128722
|
if (this._textInput) {
|
|
128717
128723
|
this._textInput.errorMessage = this.errorMessage;
|
|
128718
|
-
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())
|
|
128724
|
+
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
128719
128725
|
this.setInputValue();
|
|
128720
128726
|
}
|
|
128721
128727
|
}
|
|
128722
128728
|
}
|
|
128723
|
-
validateNewValue(newValue, oldValue) {
|
|
128724
|
-
if (typeof newValue == 'string' && typeof oldValue == 'object' && newValue === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.value))
|
|
128725
|
-
return false;
|
|
128726
|
-
if (typeof newValue == 'object' && typeof oldValue == 'string' && (newValue === null || newValue === void 0 ? void 0 : newValue.value) === oldValue)
|
|
128727
|
-
return false;
|
|
128728
|
-
if (typeof newValue == 'object' && typeof oldValue == 'object' && (newValue === null || newValue === void 0 ? void 0 : newValue.value) === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.value))
|
|
128729
|
-
return false;
|
|
128730
|
-
return true;
|
|
128731
|
-
}
|
|
128732
128729
|
async observeValue(newValue, oldValue) {
|
|
128733
|
-
if (this._textInput && newValue != oldValue
|
|
128734
|
-
|
|
128735
|
-
|
|
128736
|
-
|
|
128730
|
+
if (this._textInput && newValue != oldValue) {
|
|
128731
|
+
try {
|
|
128732
|
+
if (typeof newValue === "string") {
|
|
128733
|
+
await this.handleValueAsString(newValue);
|
|
128734
|
+
return;
|
|
128735
|
+
}
|
|
128736
|
+
const newValueSelected = this.getSelectedOption(newValue);
|
|
128737
|
+
const oldValueSelected = this.getSelectedOption(oldValue);
|
|
128738
|
+
const currentValue = this.getSelectedOption(this.value);
|
|
128739
|
+
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
128740
|
+
this.value = newValueSelected;
|
|
128741
|
+
}
|
|
128742
|
+
if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
|
|
128743
|
+
this.setInputValue();
|
|
128744
|
+
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
128745
|
+
if (!this._lookupMode) {
|
|
128746
|
+
this.ezChange.emit(valueEmitted);
|
|
128747
|
+
}
|
|
128748
|
+
}
|
|
128749
|
+
this.resetOptions();
|
|
128737
128750
|
}
|
|
128738
|
-
|
|
128739
|
-
|
|
128740
|
-
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
128741
|
-
this._currentValue = newValueSelected;
|
|
128742
|
-
this.setInputValue();
|
|
128743
|
-
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
128744
|
-
this.ezChange.emit(valueEmitted);
|
|
128751
|
+
finally {
|
|
128752
|
+
this._lookupMode = false;
|
|
128745
128753
|
}
|
|
128746
|
-
this.resetOptions();
|
|
128747
128754
|
}
|
|
128748
128755
|
}
|
|
128749
128756
|
observeOptions(newOptions, oldOptions) {
|
|
@@ -128816,9 +128823,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
128816
128823
|
return;
|
|
128817
128824
|
}
|
|
128818
128825
|
await this.loadDescriptionValue(value);
|
|
128819
|
-
this.setInputValue();
|
|
128820
128826
|
this.ezChange.emit(this.value);
|
|
128821
|
-
this._currentValue = this.value;
|
|
128822
128827
|
}
|
|
128823
128828
|
updateListPosition() {
|
|
128824
128829
|
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
@@ -128875,7 +128880,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
128875
128880
|
return text;
|
|
128876
128881
|
}
|
|
128877
128882
|
getText() {
|
|
128878
|
-
const currentValue = this.getSelectedOption(this.
|
|
128883
|
+
const currentValue = this.getSelectedOption(this.value);
|
|
128879
128884
|
const text = this.getFormattedText(currentValue);
|
|
128880
128885
|
if (text == undefined) {
|
|
128881
128886
|
return;
|
|
@@ -129050,7 +129055,6 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129050
129055
|
|| (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
|
|
129051
129056
|
const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
|
|
129052
129057
|
this.value = adjustedOpt;
|
|
129053
|
-
this._currentValue = adjustedOpt;
|
|
129054
129058
|
}
|
|
129055
129059
|
else {
|
|
129056
129060
|
this.setInputValue();
|
|
@@ -129071,7 +129075,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129071
129075
|
}
|
|
129072
129076
|
}
|
|
129073
129077
|
cancelPreselection() {
|
|
129074
|
-
if (!this._textInput.value && this.
|
|
129078
|
+
if (!this._textInput.value && this.value) {
|
|
129075
129079
|
this.selectOption(undefined);
|
|
129076
129080
|
}
|
|
129077
129081
|
else {
|
|
@@ -129092,7 +129096,6 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129092
129096
|
}
|
|
129093
129097
|
clearSearch() {
|
|
129094
129098
|
this.value = null;
|
|
129095
|
-
this._currentValue = null;
|
|
129096
129099
|
}
|
|
129097
129100
|
controlListWithOnlyOne() {
|
|
129098
129101
|
var _a, _b;
|
|
@@ -129122,13 +129125,13 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129122
129125
|
if (StringUtils$1.isEmpty(this.value)) {
|
|
129123
129126
|
return;
|
|
129124
129127
|
}
|
|
129125
|
-
if (!this.validateNewValue(this.value, this._currentValue)) {
|
|
129126
|
-
return;
|
|
129127
|
-
}
|
|
129128
129128
|
let value = this.value;
|
|
129129
129129
|
if (typeof value === "object") {
|
|
129130
129130
|
return;
|
|
129131
129131
|
}
|
|
129132
|
+
if (StringUtils$1.isEmpty(value)) {
|
|
129133
|
+
return;
|
|
129134
|
+
}
|
|
129132
129135
|
this.loadDescriptionValue(value);
|
|
129133
129136
|
}
|
|
129134
129137
|
async loadDescriptionValue(argument) {
|
|
@@ -129163,8 +129166,8 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
129163
129166
|
this.showNoResultMessage();
|
|
129164
129167
|
return;
|
|
129165
129168
|
}
|
|
129166
|
-
this.
|
|
129167
|
-
this.value = this.
|
|
129169
|
+
this._lookupMode = true;
|
|
129170
|
+
this.value = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
129168
129171
|
}
|
|
129169
129172
|
loadOptionValue(argument) {
|
|
129170
129173
|
var _a;
|
|
@@ -76,7 +76,9 @@ const EzCustomFormInput = class {
|
|
|
76
76
|
if (typeof gui === 'string') {
|
|
77
77
|
gui = HTMLBuilder.parseElement(gui);
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
if (this.value) {
|
|
80
|
+
gui.setAttribute('value', typeof this.value === 'object' ? this.value.value : this.value);
|
|
81
|
+
}
|
|
80
82
|
this.gui = h("div", { key: StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
|
|
81
83
|
}
|
|
82
84
|
setValue(value) {
|
|
@@ -86,8 +88,9 @@ const EzCustomFormInput = class {
|
|
|
86
88
|
return this.value;
|
|
87
89
|
}
|
|
88
90
|
handleValue(gui) {
|
|
91
|
+
var _a;
|
|
89
92
|
//@ts-ignore
|
|
90
|
-
gui.$children
|
|
93
|
+
(_a = gui.$children$) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
91
94
|
child.$attrs$.value = this.value;
|
|
92
95
|
});
|
|
93
96
|
}
|
|
@@ -20,6 +20,7 @@ const EzSearch = class {
|
|
|
20
20
|
this._tabPressed = false;
|
|
21
21
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
22
22
|
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
23
|
+
this._lookupMode = false;
|
|
23
24
|
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
24
25
|
this._endHighlightTag = "</span>";
|
|
25
26
|
this._preSelection = undefined;
|
|
@@ -48,35 +49,36 @@ const EzSearch = class {
|
|
|
48
49
|
var _a;
|
|
49
50
|
if (this._textInput) {
|
|
50
51
|
this._textInput.errorMessage = this.errorMessage;
|
|
51
|
-
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())
|
|
52
|
+
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
52
53
|
this.setInputValue();
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
validateNewValue(newValue, oldValue) {
|
|
57
|
-
if (typeof newValue == 'string' && typeof oldValue == 'object' && newValue === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.value))
|
|
58
|
-
return false;
|
|
59
|
-
if (typeof newValue == 'object' && typeof oldValue == 'string' && (newValue === null || newValue === void 0 ? void 0 : newValue.value) === oldValue)
|
|
60
|
-
return false;
|
|
61
|
-
if (typeof newValue == 'object' && typeof oldValue == 'object' && (newValue === null || newValue === void 0 ? void 0 : newValue.value) === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.value))
|
|
62
|
-
return false;
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
57
|
async observeValue(newValue, oldValue) {
|
|
66
|
-
if (this._textInput && newValue != oldValue
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
if (this._textInput && newValue != oldValue) {
|
|
59
|
+
try {
|
|
60
|
+
if (typeof newValue === "string") {
|
|
61
|
+
await this.handleValueAsString(newValue);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const newValueSelected = this.getSelectedOption(newValue);
|
|
65
|
+
const oldValueSelected = this.getSelectedOption(oldValue);
|
|
66
|
+
const currentValue = this.getSelectedOption(this.value);
|
|
67
|
+
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
68
|
+
this.value = newValueSelected;
|
|
69
|
+
}
|
|
70
|
+
if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
|
|
71
|
+
this.setInputValue();
|
|
72
|
+
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
73
|
+
if (!this._lookupMode) {
|
|
74
|
+
this.ezChange.emit(valueEmitted);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
this.resetOptions();
|
|
70
78
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
74
|
-
this._currentValue = newValueSelected;
|
|
75
|
-
this.setInputValue();
|
|
76
|
-
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
77
|
-
this.ezChange.emit(valueEmitted);
|
|
79
|
+
finally {
|
|
80
|
+
this._lookupMode = false;
|
|
78
81
|
}
|
|
79
|
-
this.resetOptions();
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
observeOptions(newOptions, oldOptions) {
|
|
@@ -149,9 +151,7 @@ const EzSearch = class {
|
|
|
149
151
|
return;
|
|
150
152
|
}
|
|
151
153
|
await this.loadDescriptionValue(value);
|
|
152
|
-
this.setInputValue();
|
|
153
154
|
this.ezChange.emit(this.value);
|
|
154
|
-
this._currentValue = this.value;
|
|
155
155
|
}
|
|
156
156
|
updateListPosition() {
|
|
157
157
|
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
@@ -208,7 +208,7 @@ const EzSearch = class {
|
|
|
208
208
|
return text;
|
|
209
209
|
}
|
|
210
210
|
getText() {
|
|
211
|
-
const currentValue = this.getSelectedOption(this.
|
|
211
|
+
const currentValue = this.getSelectedOption(this.value);
|
|
212
212
|
const text = this.getFormattedText(currentValue);
|
|
213
213
|
if (text == undefined) {
|
|
214
214
|
return;
|
|
@@ -383,7 +383,6 @@ const EzSearch = class {
|
|
|
383
383
|
|| (currentValue == undefined && newOptionsReplaced != undefined && "value" in newOptionsReplaced)) {
|
|
384
384
|
const adjustedOpt = !(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value) ? undefined : newOptionsReplaced;
|
|
385
385
|
this.value = adjustedOpt;
|
|
386
|
-
this._currentValue = adjustedOpt;
|
|
387
386
|
}
|
|
388
387
|
else {
|
|
389
388
|
this.setInputValue();
|
|
@@ -404,7 +403,7 @@ const EzSearch = class {
|
|
|
404
403
|
}
|
|
405
404
|
}
|
|
406
405
|
cancelPreselection() {
|
|
407
|
-
if (!this._textInput.value && this.
|
|
406
|
+
if (!this._textInput.value && this.value) {
|
|
408
407
|
this.selectOption(undefined);
|
|
409
408
|
}
|
|
410
409
|
else {
|
|
@@ -425,7 +424,6 @@ const EzSearch = class {
|
|
|
425
424
|
}
|
|
426
425
|
clearSearch() {
|
|
427
426
|
this.value = null;
|
|
428
|
-
this._currentValue = null;
|
|
429
427
|
}
|
|
430
428
|
controlListWithOnlyOne() {
|
|
431
429
|
var _a, _b;
|
|
@@ -455,13 +453,13 @@ const EzSearch = class {
|
|
|
455
453
|
if (StringUtils.isEmpty(this.value)) {
|
|
456
454
|
return;
|
|
457
455
|
}
|
|
458
|
-
if (!this.validateNewValue(this.value, this._currentValue)) {
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
456
|
let value = this.value;
|
|
462
457
|
if (typeof value === "object") {
|
|
463
458
|
return;
|
|
464
459
|
}
|
|
460
|
+
if (StringUtils.isEmpty(value)) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
465
463
|
this.loadDescriptionValue(value);
|
|
466
464
|
}
|
|
467
465
|
async loadDescriptionValue(argument) {
|
|
@@ -496,8 +494,8 @@ const EzSearch = class {
|
|
|
496
494
|
this.showNoResultMessage();
|
|
497
495
|
return;
|
|
498
496
|
}
|
|
499
|
-
this.
|
|
500
|
-
this.value = this.
|
|
497
|
+
this._lookupMode = true;
|
|
498
|
+
this.value = value ? Object.assign(Object.assign({}, value), { value: this.replaceHighlight(value.value), label: this.replaceHighlight(value.label) }) : value;
|
|
501
499
|
}
|
|
502
500
|
loadOptionValue(argument) {
|
|
503
501
|
var _a;
|