@sankhyalabs/ezui 1.1.159 → 1.1.160

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.
Files changed (78) hide show
  1. package/dist/cjs/ez-combo-box.cjs.entry.js +62 -27
  2. package/dist/cjs/ez-date-input.cjs.entry.js +71 -25
  3. package/dist/cjs/ez-date-time-input.cjs.entry.js +94 -31
  4. package/dist/cjs/ez-filter-input.cjs.entry.js +10 -4
  5. package/dist/cjs/ez-form.cjs.entry.js +54 -9
  6. package/dist/cjs/ez-grid.cjs.entry.js +9 -6
  7. package/dist/cjs/ez-number-input.cjs.entry.js +69 -25
  8. package/dist/cjs/ez-search.cjs.entry.js +20 -5
  9. package/dist/cjs/ez-text-area.cjs.entry.js +8 -2
  10. package/dist/cjs/ez-text-input.cjs.entry.js +30 -21
  11. package/dist/cjs/ez-time-input.cjs.entry.js +75 -40
  12. package/dist/cjs/ezui.cjs.js +1 -1
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/collection/components/ez-combo-box/ez-combo-box.js +81 -28
  15. package/dist/collection/components/ez-date-input/ez-date-input.js +87 -25
  16. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +108 -31
  17. package/dist/collection/components/ez-filter-input/ez-filter-input.js +26 -4
  18. package/dist/collection/components/ez-form/DataBinder.js +12 -3
  19. package/dist/collection/components/ez-form/ez-form.js +43 -6
  20. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +1 -1
  21. package/dist/collection/components/ez-grid/ez-grid.js +14 -7
  22. package/dist/collection/components/ez-number-input/ez-number-input.js +83 -25
  23. package/dist/collection/components/ez-search/ez-search.js +38 -5
  24. package/dist/collection/components/ez-text-area/ez-text-area.css +1 -1
  25. package/dist/collection/components/ez-text-area/ez-text-area.js +23 -1
  26. package/dist/collection/components/ez-text-input/ez-text-input.css +1 -1
  27. package/dist/collection/components/ez-text-input/ez-text-input.js +45 -38
  28. package/dist/collection/components/ez-time-input/ez-time-input.js +95 -59
  29. package/dist/custom-elements/index.js +504 -197
  30. package/dist/esm/ez-combo-box.entry.js +62 -27
  31. package/dist/esm/ez-date-input.entry.js +71 -25
  32. package/dist/esm/ez-date-time-input.entry.js +94 -31
  33. package/dist/esm/ez-filter-input.entry.js +10 -4
  34. package/dist/esm/ez-form.entry.js +54 -9
  35. package/dist/esm/ez-grid.entry.js +9 -6
  36. package/dist/esm/ez-number-input.entry.js +69 -25
  37. package/dist/esm/ez-search.entry.js +20 -5
  38. package/dist/esm/ez-text-area.entry.js +8 -2
  39. package/dist/esm/ez-text-input.entry.js +30 -21
  40. package/dist/esm/ez-time-input.entry.js +76 -41
  41. package/dist/esm/ezui.js +1 -1
  42. package/dist/esm/loader.js +1 -1
  43. package/dist/ezui/ezui.esm.js +1 -1
  44. package/dist/ezui/p-003d53b1.entry.js +1 -0
  45. package/dist/ezui/p-267fa515.entry.js +1 -0
  46. package/dist/ezui/p-2acf7d59.entry.js +1 -0
  47. package/dist/ezui/p-403de0a4.entry.js +1 -0
  48. package/dist/ezui/p-4c3d136c.entry.js +1 -0
  49. package/dist/ezui/p-53bbba8e.entry.js +1 -0
  50. package/dist/ezui/p-6668c3b0.entry.js +1 -0
  51. package/dist/ezui/p-7fd6deec.entry.js +1 -0
  52. package/dist/ezui/p-ad6cc559.entry.js +1 -0
  53. package/dist/ezui/{p-be87ac5e.entry.js → p-ae2fea4c.entry.js} +1 -1
  54. package/dist/ezui/p-ff7b4b13.entry.js +1 -0
  55. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +13 -7
  56. package/dist/types/components/ez-date-input/ez-date-input.d.ts +10 -3
  57. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +15 -7
  58. package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +5 -1
  59. package/dist/types/components/ez-form/DataBinder.d.ts +1 -1
  60. package/dist/types/components/ez-form/ez-form.d.ts +1 -0
  61. package/dist/types/components/ez-grid/ez-grid.d.ts +4 -1
  62. package/dist/types/components/ez-number-input/ez-number-input.d.ts +14 -5
  63. package/dist/types/components/ez-search/ez-search.d.ts +6 -1
  64. package/dist/types/components/ez-text-area/ez-text-area.d.ts +4 -0
  65. package/dist/types/components/ez-text-input/ez-text-input.d.ts +7 -6
  66. package/dist/types/components/ez-time-input/ez-time-input.d.ts +17 -13
  67. package/dist/types/components.d.ts +43 -20
  68. package/package.json +1 -1
  69. package/dist/ezui/p-1859a3d8.entry.js +0 -1
  70. package/dist/ezui/p-49fdfa4b.entry.js +0 -1
  71. package/dist/ezui/p-4fdceb7d.entry.js +0 -1
  72. package/dist/ezui/p-6d4b1628.entry.js +0 -1
  73. package/dist/ezui/p-8f4fac31.entry.js +0 -1
  74. package/dist/ezui/p-91377c65.entry.js +0 -1
  75. package/dist/ezui/p-b524dfca.entry.js +0 -1
  76. package/dist/ezui/p-bc8aa27f.entry.js +0 -1
  77. package/dist/ezui/p-ec21ecce.entry.js +0 -1
  78. package/dist/ezui/p-fc9b9487.entry.js +0 -1
@@ -19,7 +19,7 @@ let EzTimeInput = class {
19
19
  */
20
20
  this.enabled = true;
21
21
  /**
22
- * Define se o componente irá ou não considerar os segundos
22
+ * Define se o componente irá ou não considerar os segundos.
23
23
  */
24
24
  this.showSeconds = false;
25
25
  /**
@@ -27,6 +27,18 @@ let EzTimeInput = class {
27
27
  */
28
28
  this.mode = "regular";
29
29
  }
30
+ observeErrorMessage() {
31
+ var _a;
32
+ if (this._textInput) {
33
+ this._textInput.errorMessage = this.errorMessage;
34
+ if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
35
+ this.prepareValue(this._viewValue);
36
+ if ((this._textInput.value || '') !== this._viewValue) {
37
+ this._textInput.value = this._viewValue;
38
+ }
39
+ }
40
+ }
41
+ }
30
42
  observeShowSeconds() {
31
43
  if (this.showSeconds) {
32
44
  this.prepareMask("##:##:##");
@@ -35,9 +47,23 @@ let EzTimeInput = class {
35
47
  this.prepareMask("##:##");
36
48
  }
37
49
  }
38
- observeValue() {
39
- if (isNaN(this.value)) {
40
- this.value = undefined;
50
+ observeValue(newValue, oldValue) {
51
+ if (this._textInput && newValue != oldValue) {
52
+ let newValueValidated = this.validateValue(newValue);
53
+ const oldValueValidated = this.validateValue(oldValue);
54
+ if (newValueValidated != oldValueValidated) {
55
+ this._viewValue = newValueValidated == undefined ? "" : newValueValidated.toString();
56
+ this.prepareValue(this._viewValue);
57
+ if (this._viewValue && !core.TimeFormatter.validateTime(this._viewValue, this.showSeconds)) {
58
+ this.setError("Favor inserir um horário válido.");
59
+ newValueValidated = undefined;
60
+ }
61
+ else {
62
+ this.setError("");
63
+ }
64
+ const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
65
+ this.ezChange.emit(valueEmitted);
66
+ }
41
67
  }
42
68
  }
43
69
  //---------------------------------------------
@@ -51,79 +77,88 @@ let EzTimeInput = class {
51
77
  this._maskFormatter.mask = mask;
52
78
  }
53
79
  }
80
+ validateValue(value) {
81
+ return isNaN(value) || value === undefined ? null : value;
82
+ }
83
+ setError(msg) {
84
+ this.errorMessage = msg;
85
+ if (this._textInput && (msg === null || msg === void 0 ? void 0 : msg.trim())) {
86
+ this.ezCancelWaitingChange.emit();
87
+ }
88
+ }
54
89
  //---------------------------------------------
55
90
  // Public methods
56
91
  //---------------------------------------------
92
+ getViewValue() {
93
+ return this._viewValue;
94
+ }
95
+ prepareValue(value) {
96
+ try {
97
+ this._viewValue = core.TimeFormatter.prepareValue(value, this.showSeconds);
98
+ if (this._textInput && this._textInput.value !== this._viewValue) {
99
+ this._textInput.value = this._viewValue;
100
+ }
101
+ }
102
+ catch (e) {
103
+ this.setError(e.message);
104
+ }
105
+ }
57
106
  /**
58
107
  * Faz o foco no componente de input
59
108
  */
60
109
  async setFocus() {
61
- this._inputElem.setFocus();
110
+ this._textInput.setFocus();
62
111
  }
63
112
  /**
64
113
  * Remove o foco no componente de input
65
114
  */
66
115
  async setBlur() {
67
- this._inputElem.setBlur();
116
+ this._textInput.setBlur();
117
+ }
118
+ /**
119
+ * Retorna informando se o campo está inválido (true | false)
120
+ */
121
+ async isInvalid() {
122
+ return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
68
123
  }
69
124
  //---------------------------------------------
70
125
  // Event handlers
71
126
  //---------------------------------------------
72
- handleFocusout() {
73
- this.errorMessage = "";
74
- this.prepareValue(this.viewValue);
75
- if (this.viewValue && !core.TimeFormatter.validateTime(this.viewValue, this.showSeconds)) {
76
- this._oldViewValue = this.viewValue;
77
- this.ezCancelWaitingChange.emit();
78
- this.errorMessage = "Favor inserir um horário válido.";
79
- }
80
- else {
81
- if (this.viewValue === this._oldViewValue) {
82
- this.ezCancelWaitingChange.emit();
83
- return;
84
- }
85
- this._oldViewValue = this.viewValue;
86
- if (this.viewValue === "00:00" && this.value == undefined) {
87
- this.value = 0;
88
- }
89
- this.ezChange.emit(this.value);
127
+ handleBlur() {
128
+ if (this._textInput) {
129
+ this._viewValue = this._textInput.value;
130
+ this.prepareValue(this._viewValue);
131
+ this.value = core.NumberUtils.stringToNumber(this._viewValue.replace(/\D/g, ""));
90
132
  }
91
133
  }
92
- prepareValue(value) {
93
- try {
94
- this.viewValue = core.TimeFormatter.prepareValue(value, this.showSeconds);
134
+ handleInput() {
135
+ const parsedNumber = core.NumberUtils.stringToNumber(this._textInput.value.replace(/\D/g, ""));
136
+ if (parsedNumber !== this.value) {
137
+ this.ezStartChange.emit({ waitmessage: "", blocking: false });
95
138
  }
96
- catch (e) {
97
- this.errorMessage = e.message;
98
- }
99
- }
100
- handleChange() {
101
- this.ezStartChange.emit({ waitmessage: "", blocking: false });
102
- this.viewValue = this._inputElem.value;
103
- this.value = core.NumberUtils.stringToNumber(this.viewValue.replace(/\D/g, ""));
104
139
  }
105
140
  //---------------------------------------------
106
141
  // Lifecycle web component
107
142
  //---------------------------------------------
108
143
  componentDidLoad() {
109
- this.observeValue();
110
- CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._inputElem);
144
+ CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
111
145
  }
112
146
  componentWillLoad() {
113
147
  this.observeShowSeconds();
114
148
  if (this.value) {
115
149
  this.prepareValue(this.value.toString());
116
150
  }
117
- else if (this.viewValue) {
118
- this.prepareValue(this.viewValue);
151
+ else if (this._viewValue) {
152
+ this.prepareValue(this._viewValue);
119
153
  }
120
154
  }
121
155
  render() {
122
- return (index.h(index.Host, null, index.h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, restrict: "0123456789:", onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }, index.h("ez-icon", { slot: "leftIcon", iconName: "timer-outline" }))));
156
+ return (index.h(index.Host, null, index.h("ez-text-input", { ref: (el) => this._textInput = el, "data-slave-mode": "true", value: this._viewValue, enabled: this.enabled, label: this.label, restrict: "0123456789:", onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), errorMessage: this.errorMessage, mode: this.mode }, index.h("ez-icon", { slot: "leftIcon", iconName: "timer-outline" }))));
123
157
  }
124
158
  static get assetsDirs() { return ["../assets"]; }
125
159
  get _elem() { return index.getElement(this); }
126
160
  static get watchers() { return {
161
+ "errorMessage": ["observeErrorMessage"],
127
162
  "showSeconds": ["observeShowSeconds"],
128
163
  "value": ["observeValue"]
129
164
  }; }
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["test-du.cjs",[[0,"test-du",{"isDirty":[32]}]]],["ez-filter-input.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"loading":[516],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"stretchTitle":[516,"stretch-title"],"showHide":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpGridConfig":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"refresh":[64],"quickFilter":[64],"nextPage":[64],"previousPage":[64],"hasNextPage":[64],"hasPreviousPage":[64],"isLastOfPage":[64],"isFirstOfPage":[64],"nextRecord":[64],"previousRecord":[64],"hasNextRecord":[64],"hasPreviousRecord":[64],"openGridConfig":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"slaveMode":[516,"slave-mode"],"setFocus":[64],"setBlur":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040],"config":[1040]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]]], options);
18
+ return index.bootstrapLazy([["test-du.cjs",[[0,"test-du",{"isDirty":[32]}]]],["ez-filter-input.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"loading":[516],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"stretchTitle":[516,"stretch-title"],"showHide":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpGridConfig":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"refresh":[64],"quickFilter":[64],"nextPage":[64],"previousPage":[64],"hasNextPage":[64],"hasPreviousPage":[64],"isLastOfPage":[64],"isFirstOfPage":[64],"nextRecord":[64],"previousRecord":[64],"hasNextRecord":[64],"hasPreviousRecord":[64],"openGridConfig":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040],"config":[1040]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]]], options);
19
19
  });
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["test-du.cjs",[[0,"test-du",{"isDirty":[32]}]]],["ez-filter-input.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"loading":[516],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"stretchTitle":[516,"stretch-title"],"showHide":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpGridConfig":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"refresh":[64],"quickFilter":[64],"nextPage":[64],"previousPage":[64],"hasNextPage":[64],"hasPreviousPage":[64],"isLastOfPage":[64],"isFirstOfPage":[64],"nextRecord":[64],"previousRecord":[64],"hasNextRecord":[64],"hasPreviousRecord":[64],"openGridConfig":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"slaveMode":[516,"slave-mode"],"setFocus":[64],"setBlur":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040],"config":[1040]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]]], options);
17
+ return index.bootstrapLazy([["test-du.cjs",[[0,"test-du",{"isDirty":[32]}]]],["ez-filter-input.cjs",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"loading":[516],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-application.cjs",[[0,"ez-application"]]],["ez-card-item.cjs",[[1,"ez-card-item",{"item":[16]}]]],["ez-loading-bar.cjs",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["ez-view-stack.cjs",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]]],["ez-collapsible-box.cjs",[[1,"ez-collapsible-box",{"value":[1540],"label":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"stretchTitle":[516,"stretch-title"],"showHide":[64]}]]],["ez-list.cjs",[[1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64]}]]],["ez-button.cjs",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]}]]],["ez-grid.cjs",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"pageSize":[2,"page-size"],"serverUrl":[1,"server-url"],"dataUnit":[16],"_navigationHasPrevious":[32],"_navigationHasNext":[32],"_navigationFirstRow":[32],"_navigationLastRow":[32],"_navigationTotalRows":[32],"_popUpGridConfig":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"refresh":[64],"quickFilter":[64],"nextPage":[64],"previousPage":[64],"hasNextPage":[64],"hasPreviousPage":[64],"isLastOfPage":[64],"isFirstOfPage":[64],"nextRecord":[64],"previousRecord":[64],"hasNextRecord":[64],"hasPreviousRecord":[64],"openGridConfig":[64]}]]],["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-chip.cjs",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-text-input.cjs",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["select-box.cjs",[[1,"select-box",{"selectedOption":[1,"selected-option"]}]]],["grid-config.cjs",[[2,"grid-config",{"selectedTab":[1025,"selected-tab"],"columns":[1040],"config":[1040]}]]],["ez-search.cjs",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-calendar.cjs",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"hide":[64]}]]],["ez-date-input.cjs",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-date-time-input.cjs",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-text-area.cjs",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-upload.cjs",[[1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["ez-check.cjs",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"mode":[513],"getMode":[64],"setFocus":[64]}]]],["ez-tabselector.cjs",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1]}]]],["ez-icon.cjs",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["ez-combo-box.cjs",[[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["ez-form.cjs",[[0,"ez-form",{"dataUnit":[1040],"config":[16],"submit":[64],"cancel":[64],"validate":[64]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -40,40 +40,66 @@ export class EzComboBox {
40
40
  */
41
41
  this.mode = "regular";
42
42
  }
43
- observeValue() {
44
- if (this._inputElement) {
45
- this._inputElement.value = this.getText();
43
+ observeErrorMessage() {
44
+ var _a;
45
+ if (this._textInput) {
46
+ this._textInput.errorMessage = this.errorMessage;
47
+ if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
48
+ this.setInputValue();
49
+ }
50
+ }
51
+ }
52
+ observeValue(newValue, oldValue) {
53
+ var _a, _b, _c, _d;
54
+ if (this._textInput && newValue != oldValue) {
55
+ const newValueSelected = this.getSelectedOption(newValue);
56
+ const oldValueSelected = this.getSelectedOption(oldValue);
57
+ const currentValue = this.getSelectedOption(this.value);
58
+ if (((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) != ((_b = newValueSelected === null || newValueSelected === void 0 ? void 0 : newValueSelected.value) === null || _b === void 0 ? void 0 : _b.toString())) {
59
+ this.value = newValueSelected;
60
+ }
61
+ if (((_c = newValueSelected === null || newValueSelected === void 0 ? void 0 : newValueSelected.value) === null || _c === void 0 ? void 0 : _c.toString()) !== ((_d = oldValueSelected === null || oldValueSelected === void 0 ? void 0 : oldValueSelected.value) === null || _d === void 0 ? void 0 : _d.toString())) {
62
+ this.setInputValue();
63
+ const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
64
+ this.ezChange.emit(valueEmitted);
65
+ }
66
+ this.hideOptions();
67
+ this._criteria = undefined;
68
+ this._preSelection = undefined;
69
+ this.updateVisibleOptions();
46
70
  }
47
- this.hideOptions();
48
- this._criteria = undefined;
49
- this._preSelection = undefined;
50
- this.updateVisibleOptions();
51
71
  }
52
72
  /**
53
73
  * Realiza o foco no componente de seleção
54
74
  */
55
75
  async setFocus() {
56
- this._inputElement.setFocus();
76
+ this._textInput.setFocus();
57
77
  }
58
78
  /**
59
79
  * Remove o foco no componente de seleção
60
80
  */
61
81
  async setBlur() {
62
- this._inputElement.setBlur();
82
+ this._textInput.setBlur();
83
+ }
84
+ /**
85
+ * Retorna informando se o campo está inválido (true | false)
86
+ */
87
+ async isInvalid() {
88
+ return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
63
89
  }
64
90
  getText() {
65
91
  let text = "";
66
- const selected = this.getSelectedOption();
67
- if (selected) {
68
- text = this.showSelectedValue ? `${selected.value} - ${selected.label}` : selected.label;
92
+ const currentValue = this.getSelectedOption(this.value);
93
+ if (currentValue) {
94
+ text = this.showSelectedValue ? `${currentValue.value} - ${currentValue.label}` : currentValue.label;
69
95
  }
70
96
  return text;
71
97
  }
72
- getSelectedOption() {
73
- if (typeof this.value === "string" || this.value instanceof String) {
74
- return this._visibleOptions.find(o => o.value === this.value);
98
+ getSelectedOption(value) {
99
+ if (typeof value === "string" || value instanceof String) {
100
+ return this._visibleOptions.find(o => o.value === value);
75
101
  }
76
- return this.value;
102
+ return value;
77
103
  }
78
104
  updateVisibleOptions() {
79
105
  let opts = this._source || [];
@@ -130,7 +156,7 @@ export class EzComboBox {
130
156
  //FIXME: Provavelmente isso fará com que o popup abra em uma
131
157
  //posição errada no futuro. Preferi fazer simples no começo,
132
158
  //porque não quis onerar o text input com essa funcionalidade...
133
- const top = (this.errorMessage || !this.canShowError || this.mode == "slim") ? "0px" : "-19px";
159
+ const top = (this.errorMessage || !this.canShowError || this.mode === "slim") ? "0px" : "-19px";
134
160
  this._floatingID = FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: true, top });
135
161
  window.requestAnimationFrame(() => {
136
162
  this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
@@ -213,15 +239,13 @@ export class EzComboBox {
213
239
  }
214
240
  selectOption(newOption) {
215
241
  var _a, _b;
216
- const currentOpt = this.getSelectedOption();
217
- if (((_a = currentOpt === null || currentOpt === void 0 ? void 0 : currentOpt.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString())) {
242
+ const currentValue = this.getSelectedOption(this.value);
243
+ if (((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString())) {
218
244
  const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
219
245
  this.value = adjustedOpt;
220
- this.errorMessage = "";
221
- this.ezChange.emit(this.value);
222
246
  }
223
247
  else {
224
- this.observeValue();
248
+ this.setInputValue();
225
249
  }
226
250
  if (this.searchMode) {
227
251
  this._visibleOptions = [];
@@ -238,11 +262,20 @@ export class EzComboBox {
238
262
  }
239
263
  }
240
264
  cancelPreselection() {
241
- if (!this._inputElement.value && this.value) {
265
+ if (!this._textInput.value && this.value) {
242
266
  this.selectOption(undefined);
243
267
  }
244
268
  else {
245
- this.observeValue();
269
+ this.setInputValue();
270
+ }
271
+ }
272
+ setInputValue(clearError = true) {
273
+ const textValue = this.getText();
274
+ if ((this._textInput.value || '') !== textValue) {
275
+ this._textInput.value = textValue;
276
+ if (clearError) {
277
+ this.errorMessage = "";
278
+ }
246
279
  }
247
280
  }
248
281
  clearSearch() {
@@ -300,7 +333,8 @@ export class EzComboBox {
300
333
  }
301
334
  }
302
335
  componentDidLoad() {
303
- CSSVarsUtils.applyVarsTextInput(this.el, this._inputElement);
336
+ CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
337
+ this.setInputValue(false);
304
338
  }
305
339
  //---------------------------------------------
306
340
  // Event handlers
@@ -320,7 +354,7 @@ export class EzComboBox {
320
354
  const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
321
355
  const argumentNumber = Number(argument || undefined);
322
356
  if (!this._criteria) {
323
- this._inputElement.value = event.data || argument;
357
+ this._textInput.value = event.data || argument;
324
358
  }
325
359
  this._criteria = argument;
326
360
  if (argument && (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch)) {
@@ -379,10 +413,10 @@ export class EzComboBox {
379
413
  render() {
380
414
  var _a;
381
415
  return (h(Host, null,
382
- h("ez-text-input", { class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._inputElement = elem, enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true },
416
+ h("ez-text-input", { class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode },
383
417
  h("button", { class: "btn", slot: this.searchMode ? "leftIcon" : "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() },
384
418
  h("ez-icon", { iconName: this.searchMode ? "search" : "chevron-down" })),
385
- this.searchMode && ((_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value)
419
+ this.searchMode && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value)
386
420
  ? h("button", { class: "btn", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() },
387
421
  h("ez-icon", { iconName: "close" }))
388
422
  : undefined),
@@ -706,10 +740,29 @@ export class EzComboBox {
706
740
  "text": "Remove o foco no componente de sele\u00E7\u00E3o",
707
741
  "tags": []
708
742
  }
743
+ },
744
+ "isInvalid": {
745
+ "complexType": {
746
+ "signature": "() => Promise<boolean>",
747
+ "parameters": [],
748
+ "references": {
749
+ "Promise": {
750
+ "location": "global"
751
+ }
752
+ },
753
+ "return": "Promise<boolean>"
754
+ },
755
+ "docs": {
756
+ "text": "Retorna informando se o campo est\u00E1 inv\u00E1lido (true | false)",
757
+ "tags": []
758
+ }
709
759
  }
710
760
  }; }
711
761
  static get elementRef() { return "el"; }
712
762
  static get watchers() { return [{
763
+ "propName": "errorMessage",
764
+ "methodName": "observeErrorMessage"
765
+ }, {
713
766
  "propName": "value",
714
767
  "methodName": "observeValue"
715
768
  }]; }