@sankhyalabs/ezui 6.4.0-dev.2 → 6.4.0-dev.3

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 (160) hide show
  1. package/dist/cjs/{ApplicationUtils-6a76ac09.js → ApplicationUtils-e920876b.js} +1 -1
  2. package/dist/cjs/{app-globals-0a67e214.js → app-globals-cc9fa51a.js} +1 -1
  3. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
  4. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  7. package/dist/cjs/{ez-card-item_2.cjs.entry.js → ez-card-item.cjs.entry.js} +0 -205
  8. package/dist/cjs/ez-classic-combo-box.cjs.entry.js +324 -0
  9. package/dist/cjs/ez-classic-input.cjs.entry.js +26 -9
  10. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
  11. package/dist/cjs/ez-combo-box-list_4.cjs.entry.js +2 -2
  12. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
  13. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-form.cjs.entry.js +3 -3
  20. package/dist/cjs/ez-grid.cjs.entry.js +3 -3
  21. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  24. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -2
  27. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-popover-core.cjs.entry.js +211 -0
  29. package/dist/cjs/ez-search-plus.cjs.entry.js +2 -2
  30. package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-search.cjs.entry.js +2 -2
  32. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-split-item.cjs.entry.js +2 -2
  37. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-tree.cjs.entry.js +1 -1
  39. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  40. package/dist/cjs/ezui.cjs.js +3 -3
  41. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  42. package/dist/cjs/index-a7b0c73d.js +12 -4
  43. package/dist/cjs/{index-425b1f67.js → index-a8b00749.js} +12 -0
  44. package/dist/cjs/loader.cjs.js +3 -3
  45. package/dist/cjs/{search-column-78dd20d5.js → search-column-ac3e37a1.js} +2 -2
  46. package/dist/collection/collection-manifest.json +1 -0
  47. package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.css +99 -0
  48. package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js +798 -0
  49. package/dist/collection/components/ez-classic-combo-box/interfaces/IOption.js +1 -0
  50. package/dist/collection/components/ez-classic-input/ez-classic-input.css +29 -0
  51. package/dist/collection/components/ez-classic-input/ez-classic-input.js +42 -8
  52. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +1 -1
  53. package/dist/collection/utils/i18n/locales/en-us.js +4 -0
  54. package/dist/collection/utils/i18n/locales/es-es.js +4 -0
  55. package/dist/collection/utils/i18n/locales/pt-br.js +4 -0
  56. package/dist/custom-elements/index.d.ts +6 -0
  57. package/dist/custom-elements/index.js +360 -12
  58. package/dist/esm/{ApplicationUtils-1fd662ab.js → ApplicationUtils-70608555.js} +1 -1
  59. package/dist/esm/{app-globals-8a94d86c.js → app-globals-ba0c56ec.js} +1 -1
  60. package/dist/esm/ez-actions-button.entry.js +2 -2
  61. package/dist/esm/ez-alert-list.entry.js +1 -1
  62. package/dist/esm/ez-avatar.entry.js +1 -1
  63. package/dist/esm/ez-calendar.entry.js +1 -1
  64. package/dist/esm/{ez-card-item_2.entry.js → ez-card-item.entry.js} +1 -205
  65. package/dist/esm/ez-classic-combo-box.entry.js +320 -0
  66. package/dist/esm/ez-classic-input.entry.js +26 -9
  67. package/dist/esm/ez-collapsible-box.entry.js +2 -2
  68. package/dist/esm/ez-combo-box-list_4.entry.js +2 -2
  69. package/dist/esm/ez-combo-box.entry.js +2 -2
  70. package/dist/esm/ez-date-input.entry.js +1 -1
  71. package/dist/esm/ez-date-time-input.entry.js +1 -1
  72. package/dist/esm/ez-dialog.entry.js +1 -1
  73. package/dist/esm/ez-double-list.entry.js +1 -1
  74. package/dist/esm/ez-file-item.entry.js +1 -1
  75. package/dist/esm/ez-form-view.entry.js +1 -1
  76. package/dist/esm/ez-form.entry.js +3 -3
  77. package/dist/esm/ez-grid.entry.js +3 -3
  78. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  79. package/dist/esm/ez-link-builder_6.entry.js +1 -1
  80. package/dist/esm/ez-list.entry.js +1 -1
  81. package/dist/esm/ez-modal-container.entry.js +1 -1
  82. package/dist/esm/ez-modal.entry.js +1 -1
  83. package/dist/esm/ez-multi-selection-list.entry.js +2 -2
  84. package/dist/esm/ez-number-input.entry.js +1 -1
  85. package/dist/esm/ez-popover-core.entry.js +207 -0
  86. package/dist/esm/ez-search-plus.entry.js +2 -2
  87. package/dist/esm/ez-search-result-list.entry.js +1 -1
  88. package/dist/esm/ez-search.entry.js +2 -2
  89. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  90. package/dist/esm/ez-skeleton.entry.js +1 -1
  91. package/dist/esm/ez-sortable-list.entry.js +1 -1
  92. package/dist/esm/ez-split-button.entry.js +1 -1
  93. package/dist/esm/ez-split-item.entry.js +2 -2
  94. package/dist/esm/ez-time-input.entry.js +1 -1
  95. package/dist/esm/ez-tree.entry.js +1 -1
  96. package/dist/esm/ez-upload.entry.js +2 -2
  97. package/dist/esm/ezui.js +3 -3
  98. package/dist/esm/filter-column.entry.js +1 -1
  99. package/dist/esm/{index-498e0126.js → index-5004bd27.js} +12 -0
  100. package/dist/esm/index-baa5e267.js +12 -4
  101. package/dist/esm/loader.js +3 -3
  102. package/dist/esm/{search-column-729f3655.js → search-column-eadd8a51.js} +2 -2
  103. package/dist/ezui/ezui.esm.js +1 -1
  104. package/dist/ezui/{p-9dc31fc6.js → p-0e539c0f.js} +1 -1
  105. package/dist/ezui/{p-7e5c7b4c.js → p-0e6cbfc8.js} +1 -1
  106. package/dist/ezui/{p-e5e623d9.entry.js → p-0ff1bee4.entry.js} +1 -1
  107. package/dist/ezui/{p-31450a28.entry.js → p-25e71e8c.entry.js} +1 -1
  108. package/dist/ezui/{p-0c1a288c.entry.js → p-26e898c9.entry.js} +1 -1
  109. package/dist/ezui/{p-da4419a6.entry.js → p-2a265ae2.entry.js} +1 -1
  110. package/dist/ezui/{p-86b065e6.entry.js → p-314e3bfe.entry.js} +1 -1
  111. package/dist/ezui/{p-52d9b604.entry.js → p-35ca0988.entry.js} +1 -1
  112. package/dist/ezui/{p-2879c45f.entry.js → p-3b296bad.entry.js} +1 -1
  113. package/dist/ezui/p-3bf7f94b.entry.js +1 -0
  114. package/dist/ezui/{p-d512cb84.entry.js → p-4476b0ac.entry.js} +1 -1
  115. package/dist/ezui/{p-5dd12c80.entry.js → p-4638d099.entry.js} +1 -1
  116. package/dist/ezui/{p-1e21d31b.entry.js → p-47962426.entry.js} +1 -1
  117. package/dist/ezui/{p-24732fea.entry.js → p-47c7b561.entry.js} +1 -1
  118. package/dist/ezui/p-4c619e2d.js +1 -0
  119. package/dist/ezui/{p-5172793a.entry.js → p-50a2fa06.entry.js} +1 -1
  120. package/dist/ezui/{p-82fa431b.entry.js → p-59700a63.entry.js} +1 -1
  121. package/dist/ezui/{p-94630d41.entry.js → p-5ac4e99a.entry.js} +1 -1
  122. package/dist/ezui/{p-d845fa56.entry.js → p-5bdaa387.entry.js} +1 -1
  123. package/dist/ezui/{p-762a1033.entry.js → p-5bf5da85.entry.js} +1 -1
  124. package/dist/ezui/{p-39b16566.entry.js → p-69c1f7db.entry.js} +1 -1
  125. package/dist/ezui/{p-ec04285e.entry.js → p-6d3fa2dd.entry.js} +1 -1
  126. package/dist/ezui/{p-5ac7c4b3.entry.js → p-740b4ff5.entry.js} +1 -1
  127. package/dist/ezui/{p-66b00dec.entry.js → p-777b23fa.entry.js} +1 -1
  128. package/dist/ezui/{p-559b915a.entry.js → p-7999daa0.entry.js} +1 -1
  129. package/dist/ezui/{p-af47458b.js → p-8031e29e.js} +1 -1
  130. package/dist/ezui/{p-7aed8d32.entry.js → p-875d0bd2.entry.js} +1 -1
  131. package/dist/ezui/{p-3cecb4cb.entry.js → p-9adcab8a.entry.js} +1 -1
  132. package/dist/ezui/{p-bc22f56d.entry.js → p-9ae1f716.entry.js} +1 -1
  133. package/dist/ezui/p-9b2e6438.entry.js +1 -0
  134. package/dist/ezui/{p-4e6e0740.entry.js → p-9e35c475.entry.js} +1 -1
  135. package/dist/ezui/{p-57b40333.entry.js → p-a429a86c.entry.js} +1 -1
  136. package/dist/ezui/{p-5b9060ad.entry.js → p-ab52e931.entry.js} +1 -1
  137. package/dist/ezui/{p-60f5483c.entry.js → p-b1c4bbf2.entry.js} +1 -1
  138. package/dist/ezui/{p-e20ad35d.entry.js → p-b297d3f8.entry.js} +1 -1
  139. package/dist/ezui/{p-451a17ad.entry.js → p-b881cb64.entry.js} +1 -1
  140. package/dist/ezui/{p-3751da14.entry.js → p-b9158a92.entry.js} +1 -1
  141. package/dist/ezui/p-baf90704.entry.js +1 -0
  142. package/dist/ezui/p-d6f50207.entry.js +1 -0
  143. package/dist/ezui/{p-c2d38fbf.entry.js → p-db324ab1.entry.js} +1 -1
  144. package/dist/ezui/{p-4c5cb0da.entry.js → p-e1ee0b5a.entry.js} +1 -1
  145. package/dist/ezui/{p-02e1efa8.entry.js → p-f5ed1a75.entry.js} +1 -1
  146. package/dist/types/components/ez-classic-combo-box/ez-classic-combo-box.d.ts +115 -0
  147. package/dist/types/components/ez-classic-combo-box/interfaces/IOption.d.ts +4 -0
  148. package/dist/types/components/ez-classic-input/ez-classic-input.d.ts +7 -0
  149. package/dist/types/components.d.ts +199 -20
  150. package/dist/types/utils/i18n/locales/en-us.d.ts +4 -0
  151. package/dist/types/utils/i18n/locales/es-es.d.ts +4 -0
  152. package/dist/types/utils/i18n/locales/pt-br.d.ts +4 -0
  153. package/dist/types/utils/i18n/translations.d.ts +12 -0
  154. package/package.json +1 -1
  155. package/react/components.d.ts +1 -0
  156. package/react/components.js +1 -0
  157. package/react/components.js.map +1 -1
  158. package/dist/ezui/p-07819d50.js +0 -1
  159. package/dist/ezui/p-5e495d47.entry.js +0 -1
  160. package/dist/ezui/p-e78e87f5.entry.js +0 -1
@@ -0,0 +1,798 @@
1
+ import { ElementIDUtils, KeyboardManager } from '@sankhyalabs/core';
2
+ import { Host, h } from '@stencil/core';
3
+ import initI18n from '../../utils/i18n';
4
+ export class EzClassicComboBox {
5
+ constructor() {
6
+ this._keyboardManager = undefined;
7
+ this._boundHandleDocumentClick = this.handleDocumentClick.bind(this);
8
+ this.popoverVisible = false;
9
+ this.hasSlotContent = false;
10
+ this.highlightedIndex = 0;
11
+ this.filteredOptions = [];
12
+ this.inputValue = '';
13
+ this.value = null;
14
+ this.label = undefined;
15
+ this.placeholder = undefined;
16
+ this.enabled = true;
17
+ this.readonly = false;
18
+ this.name = undefined;
19
+ this.state = "default";
20
+ this.helpText = undefined;
21
+ this.iconName = undefined;
22
+ this.titleIcon = undefined;
23
+ this.iconClickable = false;
24
+ this.suppressSearch = false;
25
+ this.options = undefined;
26
+ this.textEmptyOption = undefined;
27
+ this.suppressEmptyOption = false;
28
+ }
29
+ /**
30
+ * Aplica o foco no campo.
31
+ */
32
+ async setFocus(option) {
33
+ var _a;
34
+ await ((_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.setFocus(option));
35
+ }
36
+ /**
37
+ * Remove o foco do campo.
38
+ */
39
+ async setBlur() {
40
+ var _a;
41
+ await ((_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.setBlur());
42
+ await this.hidePopover();
43
+ }
44
+ /**
45
+ * Exibe o popover abaixo do input.
46
+ */
47
+ async showPopover() {
48
+ var _a, _b, _c;
49
+ if (!this._popoverElem || !this._inputElem || this.popoverVisible) {
50
+ return;
51
+ }
52
+ this.popoverVisible = true;
53
+ const inputContainer = (_b = (_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.input-container');
54
+ await ((_c = this._popoverElem) === null || _c === void 0 ? void 0 : _c.showUnder(inputContainer !== null && inputContainer !== void 0 ? inputContainer : this._inputElem));
55
+ }
56
+ /**
57
+ * Oculta o popover.
58
+ */
59
+ async hidePopover() {
60
+ var _a;
61
+ this.popoverVisible = false;
62
+ await ((_a = this._popoverElem) === null || _a === void 0 ? void 0 : _a.hide());
63
+ }
64
+ compareOptionValues(option1, option2) {
65
+ var _a, _b;
66
+ return JSON.stringify((_a = option1 === null || option1 === void 0 ? void 0 : option1.value) !== null && _a !== void 0 ? _a : null) === JSON.stringify((_b = option2 === null || option2 === void 0 ? void 0 : option2.value) !== null && _b !== void 0 ? _b : null);
67
+ }
68
+ setEmptyValue() {
69
+ this.value = null;
70
+ this.inputValue = '';
71
+ }
72
+ async setValue(option) {
73
+ if (!option || !this.options) {
74
+ this.setEmptyValue();
75
+ await this.hidePopover();
76
+ return;
77
+ }
78
+ if (this.compareOptionValues(this.value, option)) {
79
+ await this.hidePopover();
80
+ return;
81
+ }
82
+ if (!option.value) {
83
+ this.setEmptyValue();
84
+ }
85
+ else {
86
+ this.value = option;
87
+ this.inputValue = option.label;
88
+ }
89
+ this.ezChange.emit(this.value);
90
+ await this.hidePopover();
91
+ }
92
+ async optionsChanged() {
93
+ this.filterOptions('');
94
+ }
95
+ async valueChanged(newValue) {
96
+ if (newValue) {
97
+ this.inputValue = newValue.label;
98
+ this.setHighlightedIndexToValue();
99
+ }
100
+ else {
101
+ this.inputValue = '';
102
+ this.highlightedIndex = 0;
103
+ }
104
+ }
105
+ async handleIconClick(event) {
106
+ event.stopPropagation();
107
+ event.preventDefault();
108
+ if (event.detail.icon === 'right') {
109
+ if (!this.popoverVisible) {
110
+ await this.showPopover();
111
+ }
112
+ else {
113
+ await this.hidePopover();
114
+ }
115
+ }
116
+ else {
117
+ this.iconClick.emit();
118
+ }
119
+ }
120
+ async handleEzChange(event) {
121
+ event.stopPropagation();
122
+ this.inputValue = event.detail;
123
+ if (!this.popoverVisible && this.inputValue.length > 0) {
124
+ await this.showPopover();
125
+ }
126
+ this.ezType.emit(this.inputValue);
127
+ this.highlightedIndex = 0;
128
+ this.filterOptions(this.inputValue);
129
+ }
130
+ async handleEzBlur(event) {
131
+ var _a, _b;
132
+ event.stopPropagation();
133
+ if (((_a = this.value) === null || _a === void 0 ? void 0 : _a.label) !== this.inputValue) {
134
+ this.inputValue = ((_b = this.value) === null || _b === void 0 ? void 0 : _b.label) || '';
135
+ }
136
+ this.ezBlur.emit(this.value);
137
+ }
138
+ filterOptions(searchTerm) {
139
+ if (!this.options) {
140
+ this.filteredOptions = [];
141
+ return;
142
+ }
143
+ let currentOptions = [];
144
+ if (!searchTerm || searchTerm.trim() === '') {
145
+ currentOptions = currentOptions.concat([...this.options]);
146
+ }
147
+ else {
148
+ const term = searchTerm.toLowerCase().trim();
149
+ currentOptions = currentOptions.concat(this.options.filter(option => option.label.toLowerCase().includes(term) ||
150
+ option.value.toLowerCase().includes(term)));
151
+ }
152
+ if (!this.suppressEmptyOption && currentOptions.length > 0) {
153
+ currentOptions = [
154
+ {
155
+ value: null,
156
+ label: this.textEmptyOption || this.i18n('ez-classic-combo-box.emptyOption')
157
+ },
158
+ ...currentOptions
159
+ ];
160
+ }
161
+ this.filteredOptions = currentOptions;
162
+ this.setHighlightedIndexToValue();
163
+ this.scrollToHighlightedOption();
164
+ }
165
+ scrollToHighlightedOption() {
166
+ if (this.highlightedIndex < 0 || !this._listElem) {
167
+ return;
168
+ }
169
+ const highlightedOption = this._listElem.children[this.highlightedIndex];
170
+ if (highlightedOption) {
171
+ highlightedOption.scrollIntoView({
172
+ behavior: 'smooth',
173
+ block: 'nearest',
174
+ inline: 'start'
175
+ });
176
+ }
177
+ }
178
+ async selectOption(option) {
179
+ if (!option || this.readonly || !this.enabled) {
180
+ return;
181
+ }
182
+ await this.setValue(option);
183
+ }
184
+ async handleArrowUp() {
185
+ var _a;
186
+ if (!this.popoverVisible) {
187
+ await this.showPopover();
188
+ return;
189
+ }
190
+ const optionsLength = ((_a = this.filteredOptions) === null || _a === void 0 ? void 0 : _a.length) || 0;
191
+ if (optionsLength <= 0 || this.highlightedIndex <= 0) {
192
+ return;
193
+ }
194
+ this.highlightedIndex = Math.max(0, this.highlightedIndex - 1);
195
+ this.scrollToHighlightedOption();
196
+ }
197
+ handleArrowDown() {
198
+ var _a;
199
+ if (!this.popoverVisible) {
200
+ this.showPopover();
201
+ return;
202
+ }
203
+ const optionsLength = ((_a = this.filteredOptions) === null || _a === void 0 ? void 0 : _a.length) || 0;
204
+ if (optionsLength <= 0) {
205
+ return;
206
+ }
207
+ this.highlightedIndex = Math.min(optionsLength - 1, this.highlightedIndex + 1);
208
+ this.scrollToHighlightedOption();
209
+ }
210
+ async selectCurrentItem() {
211
+ if (!this.popoverVisible || this.highlightedIndex < 0) {
212
+ return;
213
+ }
214
+ if (this.hasSlotContent || this.filteredOptions.length === 0 || this.readonly || !this.enabled) {
215
+ await this.hidePopover();
216
+ return;
217
+ }
218
+ if (this.filteredOptions && this.filteredOptions[this.highlightedIndex]) {
219
+ this.selectOption(this.filteredOptions[this.highlightedIndex]);
220
+ }
221
+ }
222
+ handleVisibilityChange(event) {
223
+ this.popoverVisible = event.detail;
224
+ this.ezVisibilityChange.emit(this.popoverVisible);
225
+ }
226
+ checkSlotContent() {
227
+ const slot = this._element.querySelector('slot') || this._element;
228
+ if (slot instanceof HTMLSlotElement) {
229
+ this.hasSlotContent = slot.assignedNodes().length > 0;
230
+ }
231
+ else {
232
+ this.hasSlotContent = slot.children.length > 0;
233
+ }
234
+ }
235
+ setHighlightedIndexToValue() {
236
+ if (this.value && this.filteredOptions) {
237
+ const index = this.filteredOptions.findIndex(opt => opt.value === this.value.value);
238
+ if (index >= 0) {
239
+ this.highlightedIndex = index;
240
+ return;
241
+ }
242
+ this.highlightedIndex = 0;
243
+ }
244
+ }
245
+ async handleDocumentClick(event) {
246
+ const target = event.target;
247
+ if (!this._element.contains(target) && !this._popoverElem.contains(target)) {
248
+ await this.hidePopover();
249
+ }
250
+ }
251
+ addInfoId() {
252
+ const dataInfo = { id: 'embedded' };
253
+ if (this._element) {
254
+ ElementIDUtils.addIDInfo(this._element);
255
+ }
256
+ if (this._inputElem) {
257
+ ElementIDUtils.addIDInfo(this._inputElem, 'classic-combo-box-input', dataInfo);
258
+ }
259
+ if (this._popoverElem) {
260
+ ElementIDUtils.addIDInfo(this._popoverElem, 'classic-combo-box-popover', dataInfo);
261
+ }
262
+ }
263
+ async initKeyboardManager() {
264
+ this._keyboardManager = new KeyboardManager({ element: this._element, propagate: true });
265
+ this._keyboardManager
266
+ .bind("ArrowUp", () => this.handleArrowUp(), { propagate: false })
267
+ .bind("ArrowDown", () => this.handleArrowDown(), { propagate: false })
268
+ .bind("Enter", () => this.selectCurrentItem(), { propagate: false })
269
+ .bind("Tab", () => this.selectCurrentItem())
270
+ .bind("shift+Tab", () => this.selectCurrentItem())
271
+ .bind("Escape", () => this.hidePopover());
272
+ }
273
+ async connectedCallback() {
274
+ this.i18n = await initI18n();
275
+ await this.initKeyboardManager();
276
+ document.addEventListener('mouseup', this._boundHandleDocumentClick);
277
+ }
278
+ disconnectedCallback() {
279
+ this._keyboardManager.unbindAllShortcutKeys();
280
+ document.removeEventListener('mouseup', this._boundHandleDocumentClick);
281
+ }
282
+ componentWillLoad() {
283
+ this.filterOptions('');
284
+ }
285
+ componentDidLoad() {
286
+ this.addInfoId();
287
+ this.checkSlotContent();
288
+ if (this.value) {
289
+ this.inputValue = this.value.label;
290
+ this.setHighlightedIndexToValue();
291
+ }
292
+ }
293
+ render() {
294
+ var _a;
295
+ return (h(Host, null, h("ez-classic-input", { ref: ref => this._inputElem = ref, name: this.name, label: this.label, placeholder: this.placeholder, value: this.inputValue, state: this.state, enabled: this.enabled, readonly: this.readonly || this.suppressSearch, leftIconName: this.iconName, leftIconTooltip: this.titleIcon, leftIconClickable: this.iconClickable, rightIconClickable: true, helpText: this.helpText, rightIconName: this.popoverVisible ? 'angle-up' : 'angle-down', onIconClick: this.handleIconClick.bind(this), onEzChange: this.handleEzChange.bind(this), onEzFocus: this.showPopover.bind(this), onEzBlur: this.handleEzBlur.bind(this) }), h("ez-popover-core", { ref: ref => this._popoverElem = ref, useAnchorSize: true, onEzVisibilityChange: this.handleVisibilityChange.bind(this), overlayType: "none", options: { verticalGap: 2, horizontalGap: 0 }, autoClose: false }, h("slot", { onSlotchange: this.checkSlotContent.bind(this) }), !this.hasSlotContent && (((_a = this.filteredOptions) === null || _a === void 0 ? void 0 : _a.length) > 0 ? (h("ul", { ref: ref => this._listElem = ref, tabIndex: -1 }, this.filteredOptions.map((option, index) => {
296
+ var _a, _b;
297
+ return (h("li", { key: (_a = option.value) !== null && _a !== void 0 ? _a : '__empty__', value: option.value, class: {
298
+ 'highlighted': this.highlightedIndex === index,
299
+ 'selected': ((_b = this.value) === null || _b === void 0 ? void 0 : _b.value) === option.value
300
+ }, onMouseDown: () => this.selectOption(option) }, option.label));
301
+ }))) : (h("span", { class: "no-results" }, this.i18n('ez-classic-combo-box.noResults')))))));
302
+ }
303
+ static get is() { return "ez-classic-combo-box"; }
304
+ static get encapsulation() { return "shadow"; }
305
+ static get originalStyleUrls() {
306
+ return {
307
+ "$": ["ez-classic-combo-box.css"]
308
+ };
309
+ }
310
+ static get styleUrls() {
311
+ return {
312
+ "$": ["ez-classic-combo-box.css"]
313
+ };
314
+ }
315
+ static get properties() {
316
+ return {
317
+ "value": {
318
+ "type": "unknown",
319
+ "mutable": true,
320
+ "complexType": {
321
+ "original": "IOption",
322
+ "resolved": "IOption",
323
+ "references": {
324
+ "IOption": {
325
+ "location": "import",
326
+ "path": "./interfaces/IOption"
327
+ }
328
+ }
329
+ },
330
+ "required": false,
331
+ "optional": true,
332
+ "docs": {
333
+ "tags": [],
334
+ "text": "Valor do combo box."
335
+ },
336
+ "defaultValue": "null"
337
+ },
338
+ "label": {
339
+ "type": "string",
340
+ "mutable": false,
341
+ "complexType": {
342
+ "original": "string",
343
+ "resolved": "string",
344
+ "references": {}
345
+ },
346
+ "required": false,
347
+ "optional": true,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": "Texto do label exibido acima do combo box."
351
+ },
352
+ "attribute": "label",
353
+ "reflect": false
354
+ },
355
+ "placeholder": {
356
+ "type": "string",
357
+ "mutable": true,
358
+ "complexType": {
359
+ "original": "string",
360
+ "resolved": "string",
361
+ "references": {}
362
+ },
363
+ "required": false,
364
+ "optional": true,
365
+ "docs": {
366
+ "tags": [],
367
+ "text": "Placeholder do combo box"
368
+ },
369
+ "attribute": "placeholder",
370
+ "reflect": false
371
+ },
372
+ "enabled": {
373
+ "type": "boolean",
374
+ "mutable": false,
375
+ "complexType": {
376
+ "original": "boolean",
377
+ "resolved": "boolean",
378
+ "references": {}
379
+ },
380
+ "required": false,
381
+ "optional": true,
382
+ "docs": {
383
+ "tags": [],
384
+ "text": "Define se o combo box est\u00E1 habilitado."
385
+ },
386
+ "attribute": "enabled",
387
+ "reflect": false,
388
+ "defaultValue": "true"
389
+ },
390
+ "readonly": {
391
+ "type": "boolean",
392
+ "mutable": false,
393
+ "complexType": {
394
+ "original": "boolean",
395
+ "resolved": "boolean",
396
+ "references": {}
397
+ },
398
+ "required": false,
399
+ "optional": true,
400
+ "docs": {
401
+ "tags": [],
402
+ "text": "Define se o combo box \u00E9 somente leitura."
403
+ },
404
+ "attribute": "readonly",
405
+ "reflect": false,
406
+ "defaultValue": "false"
407
+ },
408
+ "name": {
409
+ "type": "string",
410
+ "mutable": false,
411
+ "complexType": {
412
+ "original": "string",
413
+ "resolved": "string",
414
+ "references": {}
415
+ },
416
+ "required": false,
417
+ "optional": true,
418
+ "docs": {
419
+ "tags": [],
420
+ "text": "Nome do combo box."
421
+ },
422
+ "attribute": "name",
423
+ "reflect": false
424
+ },
425
+ "state": {
426
+ "type": "string",
427
+ "mutable": false,
428
+ "complexType": {
429
+ "original": "\"default\" | \"error\" | \"success\" | \"warning\"",
430
+ "resolved": "\"default\" | \"error\" | \"success\" | \"warning\"",
431
+ "references": {}
432
+ },
433
+ "required": false,
434
+ "optional": true,
435
+ "docs": {
436
+ "tags": [],
437
+ "text": "Estado visual do combo box: default, error, success ou warning."
438
+ },
439
+ "attribute": "state",
440
+ "reflect": false,
441
+ "defaultValue": "\"default\""
442
+ },
443
+ "helpText": {
444
+ "type": "string",
445
+ "mutable": false,
446
+ "complexType": {
447
+ "original": "string",
448
+ "resolved": "string",
449
+ "references": {}
450
+ },
451
+ "required": false,
452
+ "optional": true,
453
+ "docs": {
454
+ "tags": [],
455
+ "text": "Texto de ajuda exibido abaixo do combo box."
456
+ },
457
+ "attribute": "help-text",
458
+ "reflect": false
459
+ },
460
+ "iconName": {
461
+ "type": "string",
462
+ "mutable": false,
463
+ "complexType": {
464
+ "original": "string",
465
+ "resolved": "string",
466
+ "references": {}
467
+ },
468
+ "required": false,
469
+ "optional": true,
470
+ "docs": {
471
+ "tags": [],
472
+ "text": "Nome do \u00EDcone."
473
+ },
474
+ "attribute": "icon-name",
475
+ "reflect": false
476
+ },
477
+ "titleIcon": {
478
+ "type": "string",
479
+ "mutable": false,
480
+ "complexType": {
481
+ "original": "string",
482
+ "resolved": "string",
483
+ "references": {}
484
+ },
485
+ "required": false,
486
+ "optional": true,
487
+ "docs": {
488
+ "tags": [],
489
+ "text": "T\u00EDtulo do \u00EDcone (tooltip)."
490
+ },
491
+ "attribute": "title-icon",
492
+ "reflect": false
493
+ },
494
+ "iconClickable": {
495
+ "type": "boolean",
496
+ "mutable": false,
497
+ "complexType": {
498
+ "original": "boolean",
499
+ "resolved": "boolean",
500
+ "references": {}
501
+ },
502
+ "required": false,
503
+ "optional": true,
504
+ "docs": {
505
+ "tags": [],
506
+ "text": "Define se o \u00EDcone \u00E9 clic\u00E1vel"
507
+ },
508
+ "attribute": "icon-clickable",
509
+ "reflect": false,
510
+ "defaultValue": "false"
511
+ },
512
+ "suppressSearch": {
513
+ "type": "boolean",
514
+ "mutable": false,
515
+ "complexType": {
516
+ "original": "boolean",
517
+ "resolved": "boolean",
518
+ "references": {}
519
+ },
520
+ "required": false,
521
+ "optional": true,
522
+ "docs": {
523
+ "tags": [],
524
+ "text": "Se true desabilita a digita\u00E7\u00E3o dentro do componente."
525
+ },
526
+ "attribute": "suppress-search",
527
+ "reflect": false,
528
+ "defaultValue": "false"
529
+ },
530
+ "options": {
531
+ "type": "unknown",
532
+ "mutable": false,
533
+ "complexType": {
534
+ "original": "Array<IOption>",
535
+ "resolved": "IOption[]",
536
+ "references": {
537
+ "Array": {
538
+ "location": "global"
539
+ },
540
+ "IOption": {
541
+ "location": "import",
542
+ "path": "./interfaces/IOption"
543
+ }
544
+ }
545
+ },
546
+ "required": false,
547
+ "optional": false,
548
+ "docs": {
549
+ "tags": [],
550
+ "text": "Array com as op\u00E7\u00F5es do ez-classic-combo-box. Os elementos devem obedecer\no formato: `{value: string, label: string}`."
551
+ }
552
+ },
553
+ "textEmptyOption": {
554
+ "type": "string",
555
+ "mutable": false,
556
+ "complexType": {
557
+ "original": "string",
558
+ "resolved": "string",
559
+ "references": {}
560
+ },
561
+ "required": false,
562
+ "optional": false,
563
+ "docs": {
564
+ "tags": [],
565
+ "text": "Texto a ser apresentado na op\u00E7\u00E3o de valor nulo."
566
+ },
567
+ "attribute": "text-empty-option",
568
+ "reflect": false
569
+ },
570
+ "suppressEmptyOption": {
571
+ "type": "boolean",
572
+ "mutable": false,
573
+ "complexType": {
574
+ "original": "boolean",
575
+ "resolved": "boolean",
576
+ "references": {}
577
+ },
578
+ "required": false,
579
+ "optional": false,
580
+ "docs": {
581
+ "tags": [],
582
+ "text": "Se true remove a op\u00E7\u00E3o vazia da lista."
583
+ },
584
+ "attribute": "suppress-empty-option",
585
+ "reflect": false,
586
+ "defaultValue": "false"
587
+ }
588
+ };
589
+ }
590
+ static get states() {
591
+ return {
592
+ "popoverVisible": {},
593
+ "hasSlotContent": {},
594
+ "highlightedIndex": {},
595
+ "filteredOptions": {},
596
+ "inputValue": {}
597
+ };
598
+ }
599
+ static get events() {
600
+ return [{
601
+ "method": "ezChange",
602
+ "name": "ezChange",
603
+ "bubbles": true,
604
+ "cancelable": true,
605
+ "composed": true,
606
+ "docs": {
607
+ "tags": [],
608
+ "text": "Evento disparado quando o valor do combo box muda."
609
+ },
610
+ "complexType": {
611
+ "original": "IOption",
612
+ "resolved": "IOption",
613
+ "references": {
614
+ "IOption": {
615
+ "location": "import",
616
+ "path": "./interfaces/IOption"
617
+ }
618
+ }
619
+ }
620
+ }, {
621
+ "method": "ezBlur",
622
+ "name": "ezBlur",
623
+ "bubbles": true,
624
+ "cancelable": true,
625
+ "composed": true,
626
+ "docs": {
627
+ "tags": [],
628
+ "text": "Evento disparado quando o combo box perde o foco."
629
+ },
630
+ "complexType": {
631
+ "original": "IOption",
632
+ "resolved": "IOption",
633
+ "references": {
634
+ "IOption": {
635
+ "location": "import",
636
+ "path": "./interfaces/IOption"
637
+ }
638
+ }
639
+ }
640
+ }, {
641
+ "method": "iconClick",
642
+ "name": "iconClick",
643
+ "bubbles": true,
644
+ "cancelable": true,
645
+ "composed": true,
646
+ "docs": {
647
+ "tags": [],
648
+ "text": "Evento disparado quando o \u00EDcone \u00E9 clicado."
649
+ },
650
+ "complexType": {
651
+ "original": "void",
652
+ "resolved": "void",
653
+ "references": {}
654
+ }
655
+ }, {
656
+ "method": "ezVisibilityChange",
657
+ "name": "ezVisibilityChange",
658
+ "bubbles": true,
659
+ "cancelable": true,
660
+ "composed": true,
661
+ "docs": {
662
+ "tags": [],
663
+ "text": "Emitido quando acontece a altera\u00E7\u00E3o de estado do popover."
664
+ },
665
+ "complexType": {
666
+ "original": "boolean",
667
+ "resolved": "boolean",
668
+ "references": {}
669
+ }
670
+ }, {
671
+ "method": "ezType",
672
+ "name": "ezType",
673
+ "bubbles": true,
674
+ "cancelable": true,
675
+ "composed": true,
676
+ "docs": {
677
+ "tags": [],
678
+ "text": "Emitido quando \u00E9 digitado no campo de entrada."
679
+ },
680
+ "complexType": {
681
+ "original": "string",
682
+ "resolved": "string",
683
+ "references": {}
684
+ }
685
+ }];
686
+ }
687
+ static get methods() {
688
+ return {
689
+ "setFocus": {
690
+ "complexType": {
691
+ "signature": "(option?: OptionsSetFocus) => Promise<void>",
692
+ "parameters": [{
693
+ "tags": [],
694
+ "text": ""
695
+ }],
696
+ "references": {
697
+ "Promise": {
698
+ "location": "global"
699
+ },
700
+ "OptionsSetFocus": {
701
+ "location": "import",
702
+ "path": "../ez-classic-input/interfaces/optionsSetFocus"
703
+ }
704
+ },
705
+ "return": "Promise<void>"
706
+ },
707
+ "docs": {
708
+ "text": "Aplica o foco no campo.",
709
+ "tags": []
710
+ }
711
+ },
712
+ "setBlur": {
713
+ "complexType": {
714
+ "signature": "() => Promise<void>",
715
+ "parameters": [],
716
+ "references": {
717
+ "Promise": {
718
+ "location": "global"
719
+ }
720
+ },
721
+ "return": "Promise<void>"
722
+ },
723
+ "docs": {
724
+ "text": "Remove o foco do campo.",
725
+ "tags": []
726
+ }
727
+ },
728
+ "showPopover": {
729
+ "complexType": {
730
+ "signature": "() => Promise<void>",
731
+ "parameters": [],
732
+ "references": {
733
+ "Promise": {
734
+ "location": "global"
735
+ },
736
+ "HTMLElement": {
737
+ "location": "global"
738
+ }
739
+ },
740
+ "return": "Promise<void>"
741
+ },
742
+ "docs": {
743
+ "text": "Exibe o popover abaixo do input.",
744
+ "tags": []
745
+ }
746
+ },
747
+ "hidePopover": {
748
+ "complexType": {
749
+ "signature": "() => Promise<void>",
750
+ "parameters": [],
751
+ "references": {
752
+ "Promise": {
753
+ "location": "global"
754
+ }
755
+ },
756
+ "return": "Promise<void>"
757
+ },
758
+ "docs": {
759
+ "text": "Oculta o popover.",
760
+ "tags": []
761
+ }
762
+ },
763
+ "setValue": {
764
+ "complexType": {
765
+ "signature": "(option: IOption) => Promise<void>",
766
+ "parameters": [{
767
+ "tags": [],
768
+ "text": ""
769
+ }],
770
+ "references": {
771
+ "Promise": {
772
+ "location": "global"
773
+ },
774
+ "IOption": {
775
+ "location": "import",
776
+ "path": "./interfaces/IOption"
777
+ }
778
+ },
779
+ "return": "Promise<void>"
780
+ },
781
+ "docs": {
782
+ "text": "",
783
+ "tags": []
784
+ }
785
+ }
786
+ };
787
+ }
788
+ static get elementRef() { return "_element"; }
789
+ static get watchers() {
790
+ return [{
791
+ "propName": "options",
792
+ "methodName": "optionsChanged"
793
+ }, {
794
+ "propName": "value",
795
+ "methodName": "valueChanged"
796
+ }];
797
+ }
798
+ }