@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-6165.0 → 0.0.0-bugfix-dev-KB-17130.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.
Files changed (273) hide show
  1. package/README.md +8 -10
  2. package/dist/cjs/{ApplicationUtils-2e444734.js → ApplicationUtils-c9d1205c.js} +56 -6
  3. package/dist/cjs/{RecordValidationProcessor-edd23705.js → RecordValidationProcessor-4c893e04.js} +1 -1
  4. package/dist/cjs/{constants-3a1d64fb.js → constants-2714478b.js} +2 -0
  5. package/dist/cjs/ez-actions-button.cjs.entry.js +56 -28
  6. package/dist/cjs/ez-alert-list.cjs.entry.js +148 -0
  7. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-badge.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-card-item_3.cjs.entry.js +182 -0
  14. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-collapsible-box.cjs.entry.js +3 -4
  17. package/dist/cjs/ez-combo-box.cjs.entry.js +17 -152
  18. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-dialog.cjs.entry.js +31 -5
  21. package/dist/cjs/ez-dropdown.cjs.entry.js +12 -6
  22. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-form-view.cjs.entry.js +44 -3
  24. package/dist/cjs/ez-form.cjs.entry.js +36 -4
  25. package/dist/cjs/ez-grid.cjs.entry.js +246 -64
  26. package/dist/cjs/ez-guide-navigator.cjs.entry.js +7 -1
  27. package/dist/cjs/ez-icon.cjs.entry.js +2 -2
  28. package/dist/cjs/ez-list.cjs.entry.js +5 -3
  29. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-modal.cjs.entry.js +2 -2
  32. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +23 -10
  33. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-popup.cjs.entry.js +2 -2
  36. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-scroller_3.cjs.entry.js +8 -6
  38. package/dist/cjs/ez-search.cjs.entry.js +615 -32
  39. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  40. package/dist/cjs/ez-split-item.cjs.entry.js +19 -0
  41. package/dist/cjs/ez-split-panel.cjs.entry.js +776 -0
  42. package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
  43. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  44. package/dist/cjs/ez-text-edit.cjs.entry.js +2 -2
  45. package/dist/cjs/ez-text-input.cjs.entry.js +3 -2
  46. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  49. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  50. package/dist/cjs/ezui.cjs.js +2 -2
  51. package/dist/cjs/filter-column.cjs.entry.js +47 -12
  52. package/dist/cjs/{index-1064511f.js → index-a7b0c73d.js} +16 -6
  53. package/dist/cjs/loader.cjs.js +2 -2
  54. package/dist/collection/collection-manifest.json +6 -3
  55. package/dist/collection/components/ez-actions-button/ez-actions-button.css +17 -3
  56. package/dist/collection/components/ez-actions-button/ez-actions-button.js +105 -27
  57. package/dist/collection/components/ez-alert-list/ez-alert-list.css +87 -0
  58. package/dist/collection/components/ez-alert-list/ez-alert-list.js +268 -0
  59. package/dist/collection/components/ez-card-item/ez-card-item.css +17 -0
  60. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +1 -1
  61. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +0 -1
  62. package/dist/collection/components/ez-combo-box/ez-combo-box.js +71 -169
  63. package/dist/collection/components/ez-dialog/ez-dialog.css +1 -1
  64. package/dist/collection/components/ez-dialog/ez-dialog.js +39 -4
  65. package/dist/collection/components/ez-dropdown/ez-dropdown.css +4 -3
  66. package/dist/collection/components/ez-dropdown/ez-dropdown.js +33 -4
  67. package/dist/collection/components/ez-form/ez-form.js +93 -0
  68. package/dist/collection/components/ez-form-view/ez-form-view.js +23 -0
  69. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +4 -1
  70. package/dist/collection/components/ez-form-view/structure/index.js +34 -0
  71. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +21 -9
  72. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +23 -1
  73. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +1 -1
  74. package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRendererStatus.js +1 -1
  75. package/dist/collection/components/ez-grid/ez-grid.css +1 -4
  76. package/dist/collection/components/ez-grid/ez-grid.js +91 -51
  77. package/dist/collection/components/ez-grid/interfaces/IColumnFilter.js +1 -0
  78. package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
  79. package/dist/collection/components/ez-grid/subcomponents/filter-column.js +66 -12
  80. package/dist/collection/components/ez-grid/utils/ColumnFilterManager.js +62 -0
  81. package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js +94 -0
  82. package/dist/collection/components/ez-grid/utils/index.js +1 -0
  83. package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js +22 -0
  84. package/dist/collection/components/ez-icon/ez-icon.css +148 -139
  85. package/dist/collection/components/ez-list/ez-list.css +12 -7
  86. package/dist/collection/components/ez-list/ez-list.js +3 -1
  87. package/dist/collection/components/ez-modal/ez-modal.css +1 -1
  88. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +41 -10
  89. package/dist/collection/components/ez-popup/ez-popup.css +2 -2
  90. package/dist/collection/components/ez-search/ez-search.css +330 -0
  91. package/dist/collection/components/ez-search/ez-search.js +746 -55
  92. package/dist/collection/components/ez-split-panel/ez-split-panel.css +8 -0
  93. package/dist/collection/components/ez-split-panel/ez-split-panel.js +122 -0
  94. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +12 -0
  95. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +17 -0
  96. package/dist/collection/components/ez-text-input/ez-text-input.js +20 -1
  97. package/dist/collection/components/ez-tree/ez-tree.css +33 -0
  98. package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +3 -3
  99. package/dist/collection/utils/ApplicationUtils.js +56 -6
  100. package/dist/collection/utils/constants.js +1 -0
  101. package/dist/collection/utils/form/DataBinder.js +12 -1
  102. package/dist/collection/utils/interfaces/IAction.js +1 -0
  103. package/dist/custom-elements/index.d.ts +18 -0
  104. package/dist/custom-elements/index.js +2138 -339
  105. package/dist/esm/{ApplicationUtils-d9a34a16.js → ApplicationUtils-eaf91331.js} +56 -6
  106. package/dist/esm/{RecordValidationProcessor-abc814af.js → RecordValidationProcessor-b00b8b77.js} +1 -1
  107. package/dist/esm/constants-4e0d35b7.js +5 -0
  108. package/dist/esm/ez-actions-button.entry.js +56 -28
  109. package/dist/esm/ez-alert-list.entry.js +144 -0
  110. package/dist/esm/ez-alert.entry.js +1 -1
  111. package/dist/esm/ez-application.entry.js +1 -1
  112. package/dist/esm/ez-badge.entry.js +1 -1
  113. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  114. package/dist/esm/ez-button.entry.js +1 -1
  115. package/dist/esm/ez-calendar.entry.js +1 -1
  116. package/dist/esm/ez-card-item_3.entry.js +176 -0
  117. package/dist/esm/ez-check.entry.js +1 -1
  118. package/dist/esm/ez-chip.entry.js +1 -1
  119. package/dist/esm/ez-collapsible-box.entry.js +3 -4
  120. package/dist/esm/ez-combo-box.entry.js +18 -153
  121. package/dist/esm/ez-date-input.entry.js +1 -1
  122. package/dist/esm/ez-date-time-input.entry.js +1 -1
  123. package/dist/esm/ez-dialog.entry.js +31 -5
  124. package/dist/esm/ez-dropdown.entry.js +12 -6
  125. package/dist/esm/ez-file-item.entry.js +1 -1
  126. package/dist/esm/ez-form-view.entry.js +44 -3
  127. package/dist/esm/ez-form.entry.js +36 -4
  128. package/dist/esm/ez-grid.entry.js +247 -65
  129. package/dist/esm/ez-guide-navigator.entry.js +7 -1
  130. package/dist/esm/ez-icon.entry.js +2 -2
  131. package/dist/esm/ez-list.entry.js +5 -3
  132. package/dist/esm/ez-loading-bar.entry.js +1 -1
  133. package/dist/esm/ez-modal-container.entry.js +1 -1
  134. package/dist/esm/ez-modal.entry.js +2 -2
  135. package/dist/esm/ez-multi-selection-list.entry.js +23 -10
  136. package/dist/esm/ez-number-input.entry.js +1 -1
  137. package/dist/esm/ez-popover.entry.js +1 -1
  138. package/dist/esm/ez-popup.entry.js +2 -2
  139. package/dist/esm/ez-radio-button.entry.js +1 -1
  140. package/dist/esm/ez-scroller_3.entry.js +8 -6
  141. package/dist/esm/ez-search.entry.js +616 -33
  142. package/dist/esm/ez-skeleton.entry.js +1 -1
  143. package/dist/esm/ez-split-item.entry.js +15 -0
  144. package/dist/esm/ez-split-panel.entry.js +772 -0
  145. package/dist/esm/ez-tabselector.entry.js +1 -1
  146. package/dist/esm/ez-text-area.entry.js +1 -1
  147. package/dist/esm/ez-text-edit.entry.js +2 -2
  148. package/dist/esm/ez-text-input.entry.js +3 -2
  149. package/dist/esm/ez-time-input.entry.js +1 -1
  150. package/dist/esm/ez-toast.entry.js +1 -1
  151. package/dist/esm/ez-upload.entry.js +2 -2
  152. package/dist/esm/ez-view-stack.entry.js +1 -1
  153. package/dist/esm/ezui.js +3 -3
  154. package/dist/esm/filter-column.entry.js +47 -12
  155. package/dist/esm/{index-296b8458.js → index-baa5e267.js} +16 -6
  156. package/dist/esm/loader.js +3 -3
  157. package/dist/ezui/ezui.esm.js +1 -1
  158. package/dist/ezui/{p-5cef0264.entry.js → p-0306dff7.entry.js} +1 -1
  159. package/dist/ezui/p-0447d17c.entry.js +1 -0
  160. package/dist/ezui/{p-86a2036d.js → p-04f24913.js} +1 -1
  161. package/dist/ezui/p-05e1f4e7.js +1 -0
  162. package/dist/ezui/p-072e6347.entry.js +1 -0
  163. package/dist/ezui/p-133fae4a.entry.js +1 -0
  164. package/dist/ezui/{p-f4208819.entry.js → p-17be134a.entry.js} +1 -1
  165. package/dist/ezui/{p-cd19a6f8.entry.js → p-1e7a8633.entry.js} +1 -1
  166. package/dist/ezui/{p-60ba28ea.entry.js → p-1f50fa05.entry.js} +1 -1
  167. package/dist/ezui/{p-a5e09759.entry.js → p-20ec22c0.entry.js} +1 -1
  168. package/dist/ezui/p-2187f86c.js +1 -0
  169. package/dist/ezui/{p-e318d280.js → p-23a36bb6.js} +1 -1
  170. package/dist/ezui/{p-ce035beb.entry.js → p-24d3fede.entry.js} +1 -1
  171. package/dist/ezui/p-2a1a0e04.entry.js +1 -0
  172. package/dist/ezui/p-40f72de4.entry.js +1 -0
  173. package/dist/ezui/p-43b03119.entry.js +1 -0
  174. package/dist/ezui/{p-9b347f04.entry.js → p-44caad9a.entry.js} +1 -1
  175. package/dist/ezui/p-49456b34.entry.js +1 -0
  176. package/dist/ezui/p-4a7f113d.entry.js +1 -0
  177. package/dist/ezui/p-51c5e071.entry.js +1 -0
  178. package/dist/ezui/{p-ccb4ccd9.entry.js → p-555c9018.entry.js} +1 -1
  179. package/dist/ezui/{p-d43b22f3.entry.js → p-596634e9.entry.js} +1 -1
  180. package/dist/ezui/p-5bd5e68f.entry.js +1 -0
  181. package/dist/ezui/{p-a01068e1.entry.js → p-5d692ed1.entry.js} +1 -1
  182. package/dist/ezui/{p-95426f93.entry.js → p-5d86cca9.entry.js} +1 -1
  183. package/dist/ezui/p-5e1d036e.entry.js +1 -0
  184. package/dist/ezui/{p-7525e604.entry.js → p-5ed81457.entry.js} +1 -1
  185. package/dist/ezui/{p-c49dbf23.entry.js → p-650e4b6d.entry.js} +1 -1
  186. package/dist/ezui/{p-fd54b5b4.entry.js → p-6e2f8e6b.entry.js} +2 -2
  187. package/dist/ezui/p-6e429cff.entry.js +1 -0
  188. package/dist/ezui/p-76ba9d67.entry.js +1 -0
  189. package/dist/ezui/{p-37673563.entry.js → p-77a4bd35.entry.js} +1 -1
  190. package/dist/ezui/p-796c1a88.entry.js +1 -0
  191. package/dist/ezui/{p-5d6f2550.entry.js → p-85c8baae.entry.js} +1 -1
  192. package/dist/ezui/{p-fa571a4e.entry.js → p-8becebf8.entry.js} +1 -1
  193. package/dist/ezui/p-8defa6d3.entry.js +1 -0
  194. package/dist/ezui/{p-391de0e4.entry.js → p-9050d2cd.entry.js} +1 -1
  195. package/dist/ezui/{p-028f264f.entry.js → p-9cad9b6e.entry.js} +1 -1
  196. package/dist/ezui/{p-b11f035c.entry.js → p-9f5fa3f9.entry.js} +1 -1
  197. package/dist/ezui/p-a08b309b.entry.js +1 -0
  198. package/dist/ezui/{p-2da09f70.entry.js → p-a80b1287.entry.js} +1 -1
  199. package/dist/ezui/p-af15c277.entry.js +1 -0
  200. package/dist/ezui/{p-32b4163f.entry.js → p-b041333c.entry.js} +1 -1
  201. package/dist/ezui/p-ba875f37.entry.js +1 -0
  202. package/dist/ezui/p-bc2f844e.entry.js +1 -0
  203. package/dist/ezui/{p-e2dfd935.entry.js → p-c0f1715f.entry.js} +1 -1
  204. package/dist/ezui/{p-83885b21.entry.js → p-cc2dc4f4.entry.js} +1 -1
  205. package/dist/ezui/p-d6ffe679.entry.js +1 -0
  206. package/dist/ezui/p-eb36f072.entry.js +1 -0
  207. package/dist/ezui/p-f56dd1da.entry.js +1 -0
  208. package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +15 -7
  209. package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +76 -0
  210. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +12 -15
  211. package/dist/types/components/ez-dialog/ez-dialog.d.ts +8 -2
  212. package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +5 -0
  213. package/dist/types/components/ez-form/ez-form.d.ts +19 -1
  214. package/dist/types/components/ez-form-view/ez-form-view.d.ts +5 -0
  215. package/dist/types/components/ez-form-view/structure/index.d.ts +15 -0
  216. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +9 -6
  217. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -3
  218. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -0
  219. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
  220. package/dist/types/components/ez-grid/ez-grid.d.ts +13 -5
  221. package/dist/types/components/ez-grid/interfaces/IColumnFilter.d.ts +4 -0
  222. package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
  223. package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +8 -0
  224. package/dist/types/components/ez-grid/utils/ColumnFilterManager.d.ts +9 -0
  225. package/dist/types/components/ez-grid/utils/InMemoryFilterColumnDataSource.d.ts +19 -0
  226. package/dist/types/components/ez-grid/utils/index.d.ts +1 -0
  227. package/dist/types/components/ez-guide-navigator/ez-guide-navigator.d.ts +4 -0
  228. package/dist/types/components/ez-guide-navigator/interfaces/IGuideItem.d.ts +1 -0
  229. package/dist/types/components/ez-multi-selection-list/ez-multi-selection-list.d.ts +4 -0
  230. package/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.d.ts +2 -0
  231. package/dist/types/components/ez-search/ez-search.d.ts +112 -10
  232. package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +3 -0
  233. package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
  234. package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +1 -0
  235. package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +1 -0
  236. package/dist/types/components.d.ts +236 -17
  237. package/dist/types/utils/ApplicationUtils.d.ts +24 -0
  238. package/dist/types/utils/constants.d.ts +1 -0
  239. package/dist/types/utils/form/DataBinder.d.ts +1 -0
  240. package/dist/types/utils/index.d.ts +1 -0
  241. package/dist/types/utils/interfaces/AbstractFieldMetadata.d.ts +2 -1
  242. package/dist/types/utils/interfaces/IAction.d.ts +7 -0
  243. package/package.json +4 -3
  244. package/react/components.d.ts +3 -0
  245. package/react/components.js +3 -0
  246. package/react/components.js.map +1 -1
  247. package/dist/cjs/ez-card-item.cjs.entry.js +0 -52
  248. package/dist/cjs/ez-filter-input_2.cjs.entry.js +0 -137
  249. package/dist/esm/constants-6dab64f7.js +0 -4
  250. package/dist/esm/ez-card-item.entry.js +0 -48
  251. package/dist/esm/ez-filter-input_2.entry.js +0 -132
  252. package/dist/ezui/p-050247dc.entry.js +0 -1
  253. package/dist/ezui/p-1e7c4986.entry.js +0 -1
  254. package/dist/ezui/p-244dfe8a.entry.js +0 -1
  255. package/dist/ezui/p-27a01a26.js +0 -1
  256. package/dist/ezui/p-2a0e1679.entry.js +0 -1
  257. package/dist/ezui/p-4535da17.entry.js +0 -1
  258. package/dist/ezui/p-4c8b029b.entry.js +0 -1
  259. package/dist/ezui/p-4e31b69b.entry.js +0 -1
  260. package/dist/ezui/p-5495fa45.entry.js +0 -1
  261. package/dist/ezui/p-5ce6548c.entry.js +0 -1
  262. package/dist/ezui/p-68352e41.entry.js +0 -1
  263. package/dist/ezui/p-87e85160.entry.js +0 -1
  264. package/dist/ezui/p-8bd3903b.entry.js +0 -1
  265. package/dist/ezui/p-90fa4cb3.entry.js +0 -1
  266. package/dist/ezui/p-9285b53e.entry.js +0 -1
  267. package/dist/ezui/p-a510a4c5.entry.js +0 -1
  268. package/dist/ezui/p-d51aa09b.entry.js +0 -1
  269. package/dist/ezui/p-db528b31.entry.js +0 -1
  270. package/dist/ezui/p-e67d0bd5.entry.js +0 -1
  271. package/dist/ezui/p-e7fa0ad6.entry.js +0 -1
  272. package/dist/ezui/p-f15ec3bb.js +0 -1
  273. package/dist/ezui/p-ff82b176.entry.js +0 -1
@@ -1,8 +1,25 @@
1
- import { h } from "@stencil/core";
1
+ import { h, Host } from "@stencil/core";
2
2
  import CSSVarsUtils from "../../utils/CSSVarsUtils";
3
- import { ElementIDUtils } from "@sankhyalabs/core";
3
+ import { ElementIDUtils, FloatingManager, ObjectUtils, StringUtils } from "@sankhyalabs/core";
4
+ import { ApplicationUtils } from "../../utils";
5
+ import { REQUIRED_INFO } from "../../utils/constants";
4
6
  export class EzSearch {
5
7
  constructor() {
8
+ this._changeDeboucingTimeout = null;
9
+ this._limitCharsToSearch = 3;
10
+ this._deboucingTime = 300;
11
+ this._maxWidthValue = 0;
12
+ this._tabPressed = false;
13
+ this._textEmptyList = "Nenhum resultado encontrado";
14
+ this._textEmptySearch = "Nenhum resultado de {0} encontrado";
15
+ this._lookupMode = false;
16
+ this._startHighlightTag = "<span class='card-item__highlight'>";
17
+ this._endHighlightTag = "</span>";
18
+ this._preSelection = undefined;
19
+ this._visibleOptions = undefined;
20
+ this._startLoading = false;
21
+ this._showLoading = true;
22
+ this._criteria = undefined;
6
23
  this.value = undefined;
7
24
  this.label = undefined;
8
25
  this.enabled = true;
@@ -13,29 +30,86 @@ export class EzSearch {
13
30
  this.suppressEmptyOption = false;
14
31
  this.mode = "regular";
15
32
  this.canShowError = true;
33
+ this.hideErrorOnFocusOut = true;
16
34
  this.listOptionsPosition = undefined;
35
+ this.isTextSearch = false;
36
+ this.ignoreLimitCharsToSearch = false;
37
+ this.options = undefined;
38
+ this.suppressSearch = false;
17
39
  }
18
40
  observeErrorMessage() {
19
- if (this._comboElement) {
20
- this._comboElement.errorMessage = this.errorMessage;
41
+ var _a;
42
+ if (this._textInput) {
43
+ this._textInput.errorMessage = this.errorMessage;
44
+ if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
45
+ this.setInputValue();
46
+ }
47
+ }
48
+ }
49
+ observeValue(newValue, oldValue) {
50
+ if (this._textInput && newValue != oldValue) {
51
+ try {
52
+ if (newValue === "string") {
53
+ this.setInputValue();
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();
70
+ }
71
+ finally {
72
+ this._lookupMode = false;
73
+ }
21
74
  }
22
75
  }
23
- observeValue() {
24
- if (this._comboElement) {
25
- this._comboElement.value = this.value;
76
+ observeOptions(newOptions, oldOptions) {
77
+ if ((newOptions === null || newOptions === void 0 ? void 0 : newOptions.join('')) === (oldOptions === null || oldOptions === void 0 ? void 0 : oldOptions.join('')))
78
+ return;
79
+ this.loadOptions(SearchMode.PRELOAD);
80
+ }
81
+ /*
82
+ * Retorna uma promise com o valor da opção selecionada,
83
+ * que será resolvida quando o backend devolver este dado.
84
+ */
85
+ async getValueAsync() {
86
+ if (!this._showLoading) {
87
+ return new Promise(resolve => resolve(this.value));
26
88
  }
89
+ return new Promise(resolve => {
90
+ let id = setInterval(() => {
91
+ if (!this._showLoading) {
92
+ clearInterval(id);
93
+ resolve(this.value);
94
+ }
95
+ }, 100);
96
+ });
27
97
  }
28
98
  /**
29
- * Aplica o foco no campo.
30
- */
99
+ * Aplica o foco no campo.
100
+ */
31
101
  async setFocus() {
32
- this._comboElement.setFocus();
102
+ if (this._textInput) {
103
+ this._textInput.setFocus();
104
+ }
33
105
  }
34
106
  /**
35
- * Remove o foco do campo.
36
- */
107
+ * Remove o foco do campo.
108
+ */
37
109
  async setBlur() {
38
- this._comboElement.setBlur();
110
+ if (this._textInput) {
111
+ this._textInput.setBlur();
112
+ }
39
113
  }
40
114
  /**
41
115
  * Retorna se o conteúdo é inválido.
@@ -47,33 +121,533 @@ export class EzSearch {
47
121
  * Limpa o valor do campo de pesquisa
48
122
  */
49
123
  async clearValue() {
124
+ this.clearSearch();
125
+ }
126
+ scrollListener() {
127
+ var _a;
128
+ if (this._floatingID == undefined) {
129
+ return;
130
+ }
131
+ if ((_a = this.listOptionsPosition) === null || _a === void 0 ? void 0 : _a.hardPosition) {
132
+ this.hideOptions();
133
+ }
134
+ else {
135
+ window.requestAnimationFrame(() => {
136
+ this.updateListPosition();
137
+ });
138
+ }
139
+ }
140
+ updateListPosition() {
141
+ let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
142
+ const elementRect = this._listWrapper.getBoundingClientRect();
143
+ const containerRect = this._listContainer.getBoundingClientRect();
144
+ const textInputRect = this._textInput.getBoundingClientRect();
145
+ const limitHeight = bottomLimit || window.innerHeight;
146
+ const neededHeight = containerRect.bottom + elementRect.height;
147
+ if (!fromBottom && (elementRect.top < 0 || neededHeight > limitHeight)) {
148
+ fromBottom = true;
149
+ }
150
+ if (!hardPosition) {
151
+ verticalPosition = verticalPosition || 0;
152
+ horizontalPosition = horizontalPosition || 0;
153
+ if (fromBottom) {
154
+ verticalPosition = window.innerHeight - textInputRect.top + verticalPosition;
155
+ }
156
+ else {
157
+ verticalPosition += containerRect.top;
158
+ }
159
+ if (fromRight) {
160
+ horizontalPosition = window.innerWidth - textInputRect.right + horizontalPosition;
161
+ }
162
+ else {
163
+ horizontalPosition += containerRect.left;
164
+ }
165
+ }
166
+ if (verticalPosition != undefined) {
167
+ this._listWrapper.style[fromBottom ? "bottom" : "top"] = `${verticalPosition}px`;
168
+ this._listWrapper.style[fromBottom ? "top" : "bottom"] = "";
169
+ }
170
+ if (horizontalPosition != undefined) {
171
+ this._listWrapper.style[fromRight ? "right" : "left"] = `${horizontalPosition}px`;
172
+ this._listWrapper.style[fromRight ? "left" : "right"] = "";
173
+ }
174
+ }
175
+ getListPosition() {
176
+ if (this.listOptionsPosition) {
177
+ return this.listOptionsPosition;
178
+ }
179
+ return {
180
+ verticalPosition: (this.errorMessage || !this.canShowError || this.mode === "slim") ? 6 : -13
181
+ };
182
+ }
183
+ isDifferentValues(firstValue, secondValue) {
184
+ return ObjectUtils.objectToString(firstValue || {}) !== ObjectUtils.objectToString(secondValue || {});
185
+ }
186
+ getFormattedText(currentValue) {
187
+ if (currentValue == undefined) {
188
+ return;
189
+ }
190
+ if (!this.showSelectedValue || currentValue.value == undefined) {
191
+ return currentValue.label;
192
+ }
193
+ return currentValue.label ? `${currentValue.value} - ${currentValue.label}` : currentValue.value;
194
+ }
195
+ getText() {
196
+ const currentValue = this.getSelectedOption(this.value);
197
+ const text = this.getFormattedText(currentValue);
198
+ if (text == undefined) {
199
+ return;
200
+ }
201
+ return String(text)
202
+ .replace(/&amp;/g, '&')
203
+ .replace(/&lt;/g, '<')
204
+ .replace(/&gt;/g, '>')
205
+ .replace(/&quot;/g, '"');
206
+ }
207
+ getSelectedOption(value) {
208
+ if (typeof value === "string" || value instanceof String) {
209
+ return this._visibleOptions.find(o => o.value === value);
210
+ }
211
+ return value;
212
+ }
213
+ updateVisibleOptions() {
214
+ let opts = this._source || [];
215
+ if (this.suppressEmptyOption) {
216
+ this._visibleOptions = opts;
217
+ }
218
+ else {
219
+ this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
220
+ }
221
+ this._maxWidthValue = this.getMaxWidthValue();
222
+ }
223
+ getMaxWidthValue() {
224
+ var _a;
225
+ const arrValues = [];
226
+ (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.forEach(opt => {
227
+ const widthValue = this.getWidthValue(opt.value);
228
+ if (!arrValues.includes(widthValue)) {
229
+ arrValues.push(widthValue);
230
+ }
231
+ });
232
+ return arrValues.length > 1 ? Math.max(...arrValues) : 0;
233
+ }
234
+ getWidthValue(value) {
235
+ if (this._itemValueBasis != undefined) {
236
+ const span = this._itemValueBasis;
237
+ if (value != undefined) {
238
+ span.innerHTML = value;
239
+ return span.clientWidth > 0 ? (span.clientWidth + 2) : 0;
240
+ }
241
+ else {
242
+ span.innerHTML = "";
243
+ }
244
+ }
245
+ return 0;
246
+ }
247
+ createOption(detail) {
248
+ let { key, title } = detail;
249
+ const startHighlight = new RegExp(this._startHighlightTag, 'g');
250
+ const endHighlight = new RegExp(this._endHighlightTag, 'g');
251
+ title = StringUtils.decodeHtmlEntities(title);
252
+ const option = {
253
+ value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
254
+ label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
255
+ };
256
+ this.selectOption(option);
257
+ }
258
+ buildItem(opt, index) {
259
+ opt.label = opt.label || opt.value;
260
+ const card = {
261
+ key: opt.value,
262
+ title: opt.label,
263
+ details: opt.details
264
+ };
265
+ return h("div", { style: { "height": "100%" }, onMouseDown: () => this.createOption(card), onMouseOver: () => this._preSelection = index }, h("ez-card-item", { item: card }));
266
+ }
267
+ showOptions() {
268
+ if (!this.enabled)
269
+ return;
270
+ if (this.isOptionsVisible()) {
271
+ return;
272
+ }
273
+ if (!!this._resizeObserver)
274
+ this._resizeObserver.observe(this._textInput);
275
+ this._floatingID = FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: false, isFixed: true, backClickListener: () => this.hideOptions() });
276
+ this.setFocus();
277
+ window.requestAnimationFrame(() => {
278
+ this.updateListPosition();
279
+ if (!this.listOptionsPosition) {
280
+ this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
281
+ }
282
+ });
283
+ }
284
+ hideOptions() {
285
+ if (this._floatingID !== undefined) {
286
+ FloatingManager.close(this._floatingID);
287
+ }
288
+ this._floatingID = undefined;
289
+ if (!!this._resizeObserver)
290
+ this._resizeObserver.unobserve(this._textInput);
291
+ }
292
+ isOptionsVisible() {
293
+ return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
294
+ }
295
+ nextOption() {
296
+ if (!this.isOptionsVisible()) {
297
+ return;
298
+ }
299
+ this.showOptions();
300
+ this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
301
+ this.scrollToOption(this._visibleOptions[this._preSelection]);
302
+ }
303
+ previousOption() {
304
+ this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
305
+ this.scrollToOption(this._visibleOptions[this._preSelection]);
306
+ }
307
+ scrollToOption(opt) {
308
+ window.requestAnimationFrame(() => {
309
+ const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`li#item_${opt.value.replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
310
+ if (liElem)
311
+ liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
312
+ });
313
+ }
314
+ selectCurrentOption() {
315
+ if (this._preSelection !== undefined) {
316
+ this.selectOption(this._visibleOptions[this._preSelection]);
317
+ this._preSelection = undefined;
318
+ }
319
+ else {
320
+ this.controlListWithOnlyOne();
321
+ }
322
+ }
323
+ updateSource(source) {
324
+ this._startLoading = false;
325
+ if (source instanceof Promise) {
326
+ this._showLoading = true;
327
+ source.then(result => {
328
+ this._showLoading = false;
329
+ this.updateSource(result);
330
+ }).catch(() => this._showLoading = false);
331
+ this.updateVisibleOptions();
332
+ }
333
+ else {
334
+ this._showLoading = false;
335
+ if (Array.isArray(source)) {
336
+ this._source = source;
337
+ this.updateVisibleOptions();
338
+ if (this._tabPressed) {
339
+ this._tabPressed = false;
340
+ this.controlEmptySearch();
341
+ }
342
+ }
343
+ else {
344
+ this.selectOption(source);
345
+ }
346
+ }
347
+ }
348
+ clearSource() {
349
+ this._source = [];
350
+ this.updateVisibleOptions();
351
+ }
352
+ selectOption(newOption) {
50
353
  var _a, _b;
51
- (_b = (_a = this._comboElement) === null || _a === void 0 ? void 0 : _a['clearValue']) === null || _b === void 0 ? void 0 : _b.call(_a);
354
+ const currentValue = this.getSelectedOption(this.value);
355
+ 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()))
356
+ || (currentValue == undefined && newOption != undefined && "value" in newOption)) {
357
+ const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
358
+ this.value = adjustedOpt;
359
+ }
360
+ else {
361
+ this.resetOptions();
362
+ }
363
+ this._visibleOptions = [];
364
+ this.clearSource();
52
365
  }
53
- /*
54
- * Retorna uma promise com o valor da opção selecionada,
55
- * que será resolvida quando o backend devolver este dado.
56
- */
57
- async getValueAsync() {
366
+ loadOptions(mode, argument = "") {
367
+ this._criteria = argument;
368
+ this._startLoading = true;
369
+ if (this.optionLoader) {
370
+ const searchArgument = { mode, argument };
371
+ this.updateSource(this.optionLoader(searchArgument));
372
+ }
373
+ else {
374
+ this.updateSource(this.options);
375
+ }
376
+ }
377
+ cancelPreselection() {
378
+ if (!this._textInput.value && this.value) {
379
+ this.selectOption(undefined);
380
+ }
381
+ else {
382
+ window.setTimeout(() => {
383
+ this.setInputValue();
384
+ }, this._deboucingTime);
385
+ }
386
+ this.resetOptions();
387
+ }
388
+ setInputValue(clearError = true) {
389
+ const textValue = this.getText();
390
+ if ((this._textInput.value || '') !== textValue) {
391
+ this._textInput.value = textValue;
392
+ if (clearError) {
393
+ this.errorMessage = null;
394
+ }
395
+ }
396
+ }
397
+ clearSearch() {
398
+ this.value = null;
399
+ }
400
+ controlListWithOnlyOne() {
401
+ var _a, _b;
402
+ const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
403
+ if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
404
+ const startHighlight = new RegExp(this._startHighlightTag, 'g');
405
+ const endHighlight = new RegExp(this._endHighlightTag, 'g');
406
+ let title = StringUtils.decodeHtmlEntities(source[0].label);
407
+ const option = {
408
+ value: (_b = source[0].value) === null || _b === void 0 ? void 0 : _b.replace(startHighlight, '').replace(endHighlight, ''),
409
+ label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
410
+ };
411
+ this.selectOption(option);
412
+ }
413
+ }
414
+ controlEmptySearch() {
58
415
  var _a;
59
- return (_a = this._comboElement) === null || _a === void 0 ? void 0 : _a.getValueAsync();
416
+ if (!((_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.length)) {
417
+ this.clearSearch();
418
+ ApplicationUtils.info(this._textEmptyList);
419
+ }
420
+ else {
421
+ this.controlListWithOnlyOne();
422
+ }
60
423
  }
61
- onComboChange(event) {
62
- event.stopPropagation();
63
- this.value = event.detail;
64
- this.ezChange.emit(event.detail);
65
- if (this.errorMessage !== this._comboElement.errorMessage) {
66
- this.errorMessage = this._comboElement.errorMessage;
424
+ validateDescriptionValue() {
425
+ if (StringUtils.isEmpty(this.value)) {
426
+ return;
67
427
  }
428
+ let value = this.value;
429
+ if (typeof value === "object") {
430
+ return;
431
+ }
432
+ if (StringUtils.isEmpty(value)) {
433
+ return;
434
+ }
435
+ this.loadDescriptionValue(value);
436
+ }
437
+ async loadDescriptionValue(argument) {
438
+ var _a, _b;
439
+ if (argument == undefined) {
440
+ return;
441
+ }
442
+ if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
443
+ this.loadOptionValue(argument);
444
+ return;
445
+ }
446
+ const searchArgument = {
447
+ mode: SearchMode.PREDICTIVE,
448
+ argument
449
+ };
450
+ const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument));
451
+ if (source == undefined) {
452
+ return;
453
+ }
454
+ if (source instanceof Promise) {
455
+ source.then((result) => {
456
+ this.setDescriptionValue(result);
457
+ });
458
+ }
459
+ else {
460
+ this.setDescriptionValue(source);
461
+ }
462
+ }
463
+ setDescriptionValue(source) {
464
+ const value = (source === null || source === void 0 ? void 0 : source[0]) || source;
465
+ if (value == undefined || !Object.keys(value).length) {
466
+ this.showNoResultMessage();
467
+ return;
468
+ }
469
+ this._lookupMode = true;
470
+ this.value = value;
471
+ }
472
+ loadOptionValue(argument) {
473
+ var _a;
474
+ const source = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === argument);
475
+ if (source != undefined) {
476
+ this.selectOption(source);
477
+ }
478
+ else {
479
+ this.showNoResultMessage();
480
+ }
481
+ }
482
+ async showNoResultMessage() {
483
+ this.clearSearch();
484
+ ApplicationUtils.info(this._textEmptySearch.replace("{0}", this.getFieldLabel()));
485
+ }
486
+ getFieldLabel() {
487
+ var _a;
488
+ return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
489
+ }
490
+ resetOptions() {
491
+ this.hideOptions();
492
+ this._criteria = undefined;
493
+ this._preSelection = undefined;
494
+ this.updateVisibleOptions();
495
+ }
496
+ //---------------------------------------------
497
+ // Lifecycle web component
498
+ //---------------------------------------------
499
+ componentWillLoad() {
500
+ if (this.options === undefined) {
501
+ this.options = [];
502
+ const optionsTags = this.el.querySelectorAll("option");
503
+ if (optionsTags) {
504
+ optionsTags.forEach(e => {
505
+ let label = e.innerText;
506
+ let value = e.getAttribute("value");
507
+ let details = e.getAttribute("details");
508
+ if (!value) {
509
+ value = label;
510
+ }
511
+ this.options.push({ label, value, details });
512
+ e.hidden = true;
513
+ });
514
+ }
515
+ }
516
+ this.updateSource([]);
517
+ }
518
+ componentDidRender() {
519
+ var _a;
520
+ if (this._floatingID === undefined) {
521
+ this._listWrapper.remove();
522
+ }
523
+ (_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
524
+ ElementIDUtils.addIDInfoIfNotExists(elem, "itemSearch");
525
+ });
526
+ this.validateDescriptionValue();
68
527
  }
69
528
  componentDidLoad() {
70
- CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
529
+ CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
530
+ this.setInputValue(false);
531
+ this._resizeObserver = new ResizeObserver((entries) => {
532
+ window.requestAnimationFrame(() => {
533
+ if (!Array.isArray(entries) || !entries.length)
534
+ return;
535
+ const { clientWidth } = this._listContainer;
536
+ if (clientWidth > 0 && !!this._listWrapper) {
537
+ this._listWrapper.style.width = `${clientWidth}px`;
538
+ }
539
+ });
540
+ });
541
+ }
542
+ //---------------------------------------------
543
+ // Event handlers
544
+ //---------------------------------------------
545
+ handlerIconClick() {
546
+ this.loadOptions(SearchMode.ADVANCED);
547
+ }
548
+ buildNumberArgument(argument) {
549
+ if (this.isTextSearch) {
550
+ return NaN;
551
+ }
552
+ return Number(argument || undefined);
553
+ }
554
+ onTextInputChangeHandler(event) {
555
+ var _a;
556
+ this.clearDeboucingTimeout();
557
+ if (this._startLoading) {
558
+ this._changeDeboucingTimeout = window.setTimeout(() => {
559
+ this.onTextInputChangeHandler(event);
560
+ }, this._deboucingTime);
561
+ return;
562
+ }
563
+ const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
564
+ const argumentNumber = this.buildNumberArgument(argument);
565
+ if (!this._criteria) {
566
+ this._textInput.value = event.data || argument;
567
+ }
568
+ this._criteria = argument;
569
+ if (argument) {
570
+ this._showLoading = false;
571
+ this.clearSource();
572
+ if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
573
+ this._showLoading = true;
574
+ this._changeDeboucingTimeout = window.setTimeout(() => {
575
+ this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
576
+ }, this._deboucingTime);
577
+ this.showOptions();
578
+ }
579
+ else {
580
+ this.hideOptions();
581
+ }
582
+ }
583
+ else {
584
+ this.hideOptions();
585
+ this._showLoading = false;
586
+ this.clearSource();
587
+ }
588
+ }
589
+ clearDeboucingTimeout() {
590
+ if (this._changeDeboucingTimeout) {
591
+ window.clearTimeout(this._changeDeboucingTimeout);
592
+ this._changeDeboucingTimeout = null;
593
+ }
594
+ }
595
+ keyDownHandler(event) {
596
+ this._tabPressed = false;
597
+ if (event.ctrlKey) {
598
+ if (event.key === "f" || event.key === "F") {
599
+ this.loadOptions(SearchMode.ADVANCED);
600
+ //ATENÇÃO: Ctrl + F tem ação específica nos browsers
601
+ //nesse caso, como vamos abrir o popup de busca avançada,
602
+ //não é interessante deixar o evento propagar;
603
+ event.stopPropagation();
604
+ event.stopImmediatePropagation();
605
+ event.preventDefault();
606
+ }
607
+ }
608
+ switch (event.key) {
609
+ case "ArrowDown":
610
+ this.nextOption();
611
+ event.stopPropagation();
612
+ break;
613
+ case "ArrowUp":
614
+ this.previousOption();
615
+ event.stopPropagation();
616
+ break;
617
+ case "Enter":
618
+ this.selectCurrentOption();
619
+ break;
620
+ case "Escape":
621
+ this.cancelPreselection();
622
+ break;
623
+ case "Tab":
624
+ this._tabPressed = true;
625
+ this.controlListWithOnlyOne();
626
+ break;
627
+ }
628
+ //ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
629
+ //Por exemplo, quando o usuário dá um Enter, além de selecionar
630
+ //um valor, também significa que a ateração finalizou,
631
+ //e o contexto pode reagir (fechar um popup por exemplo).
632
+ //event.stopPropagation();
633
+ }
634
+ onTextInputFocusOutHandler() {
635
+ if (this.hideErrorOnFocusOut)
636
+ this.cancelPreselection();
637
+ }
638
+ canShowListOptions() {
639
+ return !this._showLoading && this._visibleOptions.length > 0;
71
640
  }
72
641
  render() {
73
- ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
74
- return (h("ez-combo-box", { "data-element-id": ElementIDUtils.getInternalIDInfo("combo"), ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: event => this.onComboChange(event), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode, canShowError: this.canShowError, listOptionsPosition: this.listOptionsPosition }));
642
+ var _a;
643
+ ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
644
+ return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), 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), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "leftIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: "search" })), ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value)
645
+ ? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
646
+ : undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
647
+ && this._visibleOptions.length === 0
648
+ && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
649
+ && h("div", { class: "message" }, h("div", { class: "message__loading" })), h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem }), this.canShowListOptions() && this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
75
650
  }
76
- ;
77
651
  static get is() { return "ez-search"; }
78
652
  static get encapsulation() { return "shadow"; }
79
653
  static get originalStyleUrls() {
@@ -96,8 +670,7 @@ export class EzSearch {
96
670
  "resolved": "IOption | string",
97
671
  "references": {
98
672
  "IOption": {
99
- "location": "import",
100
- "path": "../ez-combo-box/ez-combo-box"
673
+ "location": "local"
101
674
  }
102
675
  }
103
676
  },
@@ -170,8 +743,7 @@ export class EzSearch {
170
743
  "resolved": "(argument: ISearchArgument) => IOption | IOption[] | Promise<IOption[]>",
171
744
  "references": {
172
745
  "ISearchArgument": {
173
- "location": "import",
174
- "path": "../ez-combo-box/ez-combo-box"
746
+ "location": "local"
175
747
  },
176
748
  "Promise": {
177
749
  "location": "global"
@@ -180,8 +752,7 @@ export class EzSearch {
180
752
  "location": "global"
181
753
  },
182
754
  "IOption": {
183
- "location": "import",
184
- "path": "../ez-combo-box/ez-combo-box"
755
+ "location": "local"
185
756
  }
186
757
  }
187
758
  },
@@ -282,6 +853,24 @@ export class EzSearch {
282
853
  "reflect": true,
283
854
  "defaultValue": "true"
284
855
  },
856
+ "hideErrorOnFocusOut": {
857
+ "type": "boolean",
858
+ "mutable": false,
859
+ "complexType": {
860
+ "original": "boolean",
861
+ "resolved": "boolean",
862
+ "references": {}
863
+ },
864
+ "required": false,
865
+ "optional": false,
866
+ "docs": {
867
+ "tags": [],
868
+ "text": "Quando verdadeiro deixa de exibir a mensagem de erro (se existente) quando focar em um elemento diferente."
869
+ },
870
+ "attribute": "hide-error-on-focus-out",
871
+ "reflect": false,
872
+ "defaultValue": "true"
873
+ },
285
874
  "listOptionsPosition": {
286
875
  "type": "unknown",
287
876
  "mutable": false,
@@ -301,9 +890,94 @@ export class EzSearch {
301
890
  "tags": [],
302
891
  "text": "Define um posicionamento fixo para a lista de op\u00E7\u00F5es do CheckBox."
303
892
  }
893
+ },
894
+ "isTextSearch": {
895
+ "type": "boolean",
896
+ "mutable": false,
897
+ "complexType": {
898
+ "original": "boolean",
899
+ "resolved": "boolean",
900
+ "references": {}
901
+ },
902
+ "required": false,
903
+ "optional": false,
904
+ "docs": {
905
+ "tags": [],
906
+ "text": "Informa se a pesquisa \u00E9 do tipo texto."
907
+ },
908
+ "attribute": "is-text-search",
909
+ "reflect": false,
910
+ "defaultValue": "false"
911
+ },
912
+ "ignoreLimitCharsToSearch": {
913
+ "type": "boolean",
914
+ "mutable": false,
915
+ "complexType": {
916
+ "original": "boolean",
917
+ "resolved": "boolean",
918
+ "references": {}
919
+ },
920
+ "required": false,
921
+ "optional": false,
922
+ "docs": {
923
+ "tags": [],
924
+ "text": "Define se deve ignorar o limite de caracteres m\u00EDnimo para realizar uma pesquisa"
925
+ },
926
+ "attribute": "ignore-limit-chars-to-search",
927
+ "reflect": false,
928
+ "defaultValue": "false"
929
+ },
930
+ "options": {
931
+ "type": "unknown",
932
+ "mutable": true,
933
+ "complexType": {
934
+ "original": "Array<IOption>",
935
+ "resolved": "IOption[]",
936
+ "references": {
937
+ "Array": {
938
+ "location": "global"
939
+ },
940
+ "IOption": {
941
+ "location": "local"
942
+ }
943
+ }
944
+ },
945
+ "required": false,
946
+ "optional": false,
947
+ "docs": {
948
+ "tags": [],
949
+ "text": "Array com as op\u00E7\u00F5es do ez-combo-box. Os elementos devem obedecer\no formato: `{value: string, label: string}`."
950
+ }
951
+ },
952
+ "suppressSearch": {
953
+ "type": "boolean",
954
+ "mutable": false,
955
+ "complexType": {
956
+ "original": "boolean",
957
+ "resolved": "boolean",
958
+ "references": {}
959
+ },
960
+ "required": false,
961
+ "optional": false,
962
+ "docs": {
963
+ "tags": [],
964
+ "text": "Se true desabilita a digita\u00E7\u00E3o dentro do componente."
965
+ },
966
+ "attribute": "suppress-search",
967
+ "reflect": false,
968
+ "defaultValue": "false"
304
969
  }
305
970
  };
306
971
  }
972
+ static get states() {
973
+ return {
974
+ "_preSelection": {},
975
+ "_visibleOptions": {},
976
+ "_startLoading": {},
977
+ "_showLoading": {},
978
+ "_criteria": {}
979
+ };
980
+ }
307
981
  static get events() {
308
982
  return [{
309
983
  "method": "ezChange",
@@ -320,8 +994,7 @@ export class EzSearch {
320
994
  "resolved": "IOption",
321
995
  "references": {
322
996
  "IOption": {
323
- "location": "import",
324
- "path": "../ez-combo-box/ez-combo-box"
997
+ "location": "local"
325
998
  }
326
999
  }
327
1000
  }
@@ -329,6 +1002,22 @@ export class EzSearch {
329
1002
  }
330
1003
  static get methods() {
331
1004
  return {
1005
+ "getValueAsync": {
1006
+ "complexType": {
1007
+ "signature": "() => Promise<unknown>",
1008
+ "parameters": [],
1009
+ "references": {
1010
+ "Promise": {
1011
+ "location": "global"
1012
+ }
1013
+ },
1014
+ "return": "Promise<unknown>"
1015
+ },
1016
+ "docs": {
1017
+ "text": "",
1018
+ "tags": []
1019
+ }
1020
+ },
332
1021
  "setFocus": {
333
1022
  "complexType": {
334
1023
  "signature": "() => Promise<void>",
@@ -392,26 +1081,10 @@ export class EzSearch {
392
1081
  "text": "Limpa o valor do campo de pesquisa",
393
1082
  "tags": []
394
1083
  }
395
- },
396
- "getValueAsync": {
397
- "complexType": {
398
- "signature": "() => Promise<unknown>",
399
- "parameters": [],
400
- "references": {
401
- "Promise": {
402
- "location": "global"
403
- }
404
- },
405
- "return": "Promise<unknown>"
406
- },
407
- "docs": {
408
- "text": "",
409
- "tags": []
410
- }
411
1084
  }
412
1085
  };
413
1086
  }
414
- static get elementRef() { return "_elem"; }
1087
+ static get elementRef() { return "el"; }
415
1088
  static get watchers() {
416
1089
  return [{
417
1090
  "propName": "errorMessage",
@@ -419,6 +1092,24 @@ export class EzSearch {
419
1092
  }, {
420
1093
  "propName": "value",
421
1094
  "methodName": "observeValue"
1095
+ }, {
1096
+ "propName": "options",
1097
+ "methodName": "observeOptions"
1098
+ }];
1099
+ }
1100
+ static get listeners() {
1101
+ return [{
1102
+ "name": "scroll",
1103
+ "method": "scrollListener",
1104
+ "target": "window",
1105
+ "capture": true,
1106
+ "passive": true
422
1107
  }];
423
1108
  }
424
1109
  }
1110
+ var SearchMode;
1111
+ (function (SearchMode) {
1112
+ SearchMode["ADVANCED"] = "ADVANCED";
1113
+ SearchMode["PRELOAD"] = "PRELOAD";
1114
+ SearchMode["PREDICTIVE"] = "PREDICTIVE";
1115
+ })(SearchMode || (SearchMode = {}));