@rededor/cura 1.6.0-alpha.4 → 1.6.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 (232) hide show
  1. package/dist/cjs/cura-accordion_18.cjs.entry.js +49 -48
  2. package/dist/cjs/cura-accordion_18.cjs.entry.js.map +1 -1
  3. package/dist/cjs/cura-alert.cjs.entry.js +1 -1
  4. package/dist/cjs/cura-badge-counter.cjs.entry.js +1 -1
  5. package/dist/cjs/cura-badge-dot.cjs.entry.js +1 -1
  6. package/dist/cjs/cura-badge-pill.cjs.entry.js +1 -1
  7. package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
  8. package/dist/cjs/cura-button-select.cjs.entry.js +1 -1
  9. package/dist/cjs/cura-calendar.cjs.entry.js +1 -1
  10. package/dist/cjs/cura-card.cjs.entry.js +1 -1
  11. package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
  12. package/dist/cjs/cura-display.cjs.entry.js +2 -2
  13. package/dist/cjs/cura-dropdown-search-not-found.cjs.entry.js +1 -1
  14. package/dist/cjs/cura-dropdown-search-not-found.cjs.entry.js.map +1 -1
  15. package/dist/cjs/cura-icons-view.cjs.entry.js +1 -1
  16. package/dist/cjs/cura-input-date.cjs.entry.js +2 -2
  17. package/dist/cjs/cura-loader-bar.cjs.entry.js +2 -2
  18. package/dist/cjs/cura-modal.cjs.entry.js +1 -1
  19. package/dist/cjs/cura-progress-bar_2.cjs.entry.js +1 -1
  20. package/dist/cjs/cura-radio.cjs.entry.js +2 -2
  21. package/dist/cjs/cura-stepper.cjs.entry.js +1 -1
  22. package/dist/cjs/cura-switch.cjs.entry.js +2 -2
  23. package/dist/cjs/cura-toast.cjs.entry.js +1 -1
  24. package/dist/cjs/cura-tooltip.cjs.entry.js +1 -1
  25. package/dist/cjs/cura.cjs.js +2 -2
  26. package/dist/cjs/{index-12d54921.js → index-60783089.js} +2 -5
  27. package/dist/cjs/index-60783089.js.map +1 -0
  28. package/dist/cjs/loader.cjs.js +2 -2
  29. package/dist/collection/collection-manifest.json +4 -7
  30. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-category/cura-dropdown-search-category.js.map +1 -0
  31. package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.stories.js +1 -1
  32. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-category/cura-dropdown-search-category.stories.js.map +1 -0
  33. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-not-found/cura-dropdown-search-not-found.js.map +1 -0
  34. package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.js +2 -2
  35. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.js.map +1 -0
  36. package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.css → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css} +2 -0
  37. package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.js → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js} +6 -6
  38. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -0
  39. package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.stories.js → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js} +5 -5
  40. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +1 -0
  41. package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-new.js → cura-dropdown-search/cura-dropdown-search.js} +11 -10
  42. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.js.map +1 -0
  43. package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-new.stories.js → cura-dropdown-search/cura-dropdown-search.stories.js} +25 -25
  44. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.stories.js.map +1 -0
  45. package/dist/collection/components/forms/cura-input-date/cura-input-date.js +1 -1
  46. package/dist/collection/components/forms/cura-label/cura-label.css +1 -0
  47. package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
  48. package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
  49. package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
  50. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
  51. package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
  52. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
  53. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
  54. package/dist/collection/components/text/cura-display/cura-display.js +1 -1
  55. package/dist/collection/components/text/cura-heading/cura-heading.css +1 -0
  56. package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
  57. package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +3 -0
  58. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
  59. package/dist/components/cura-display.js +1 -1
  60. package/dist/components/cura-dropdown-search-category.js.map +1 -1
  61. package/dist/components/cura-dropdown-search-not-found.js.map +1 -1
  62. package/dist/components/cura-dropdown-search-option.js +40 -52
  63. package/dist/components/cura-dropdown-search-option.js.map +1 -1
  64. package/dist/components/cura-dropdown-search.js +283 -236
  65. package/dist/components/cura-dropdown-search.js.map +1 -1
  66. package/dist/components/cura-heading2.js +2 -2
  67. package/dist/components/cura-heading2.js.map +1 -1
  68. package/dist/components/cura-input-date.js +1 -1
  69. package/dist/components/cura-input-text2.js +38 -38
  70. package/dist/components/cura-input-text2.js.map +1 -1
  71. package/dist/components/cura-label2.js +2 -2
  72. package/dist/components/cura-label2.js.map +1 -1
  73. package/dist/components/cura-loader-bar2.js +1 -1
  74. package/dist/components/cura-loader-circle2.js +1 -1
  75. package/dist/components/cura-paragraph2.js +2 -2
  76. package/dist/components/cura-paragraph2.js.map +1 -1
  77. package/dist/components/cura-radio.js +1 -1
  78. package/dist/components/cura-select-option2.js +1 -1
  79. package/dist/components/cura-select2.js +3 -3
  80. package/dist/components/cura-switch.js +1 -1
  81. package/dist/components/index.js +0 -6
  82. package/dist/components/index.js.map +1 -1
  83. package/dist/cura/cura.esm.js +1 -1
  84. package/dist/cura/cura.esm.js.map +1 -1
  85. package/dist/cura/{p-5afb630e.entry.js → p-07817634.entry.js} +2 -2
  86. package/dist/cura/{p-24cd591e.entry.js → p-1016108a.entry.js} +2 -2
  87. package/dist/cura/{p-fc9584dd.entry.js → p-174d220e.entry.js} +2 -2
  88. package/dist/cura/{p-d227469a.entry.js → p-186392b7.entry.js} +2 -2
  89. package/dist/cura/{p-d25142cd.entry.js → p-197213c0.entry.js} +2 -2
  90. package/dist/cura/{p-bf69b32f.entry.js → p-25932952.entry.js} +2 -2
  91. package/dist/cura/{p-89671cd4.entry.js → p-3519d0ba.entry.js} +2 -2
  92. package/dist/cura/{p-02c2b948.entry.js → p-38777561.entry.js} +2 -2
  93. package/dist/cura/{p-6243742a.entry.js → p-3c305dbd.entry.js} +2 -2
  94. package/dist/cura/{p-f1098b41.entry.js → p-405a50de.entry.js} +2 -2
  95. package/dist/cura/{p-af3ac476.js → p-4ee8efca.js} +3 -3
  96. package/dist/cura/p-4ee8efca.js.map +1 -0
  97. package/dist/cura/{p-bfaf9964.entry.js → p-53d68d72.entry.js} +2 -2
  98. package/dist/cura/p-5b928e46.entry.js +2 -0
  99. package/dist/cura/p-5b928e46.entry.js.map +1 -0
  100. package/dist/cura/{p-506747fb.entry.js → p-62c1b0f4.entry.js} +2 -2
  101. package/dist/cura/{p-0a391c03.entry.js → p-6f7f157e.entry.js} +2 -2
  102. package/dist/cura/{p-635c0f4d.entry.js → p-777decf9.entry.js} +2 -2
  103. package/dist/cura/{p-8fb3bede.entry.js → p-a1782f0e.entry.js} +2 -2
  104. package/dist/cura/{p-d2da92d9.entry.js → p-ac0c90af.entry.js} +2 -2
  105. package/dist/cura/{p-86d317f3.entry.js → p-b254bbe4.entry.js} +2 -2
  106. package/dist/cura/p-b254bbe4.entry.js.map +1 -0
  107. package/dist/cura/{p-9214ee88.entry.js → p-d77df3f0.entry.js} +2 -2
  108. package/dist/cura/{p-18af52e4.entry.js → p-d7f46266.entry.js} +2 -2
  109. package/dist/cura/{p-02717e7d.entry.js → p-e1916252.entry.js} +2 -2
  110. package/dist/cura/{p-500f1256.entry.js → p-fc1fd622.entry.js} +2 -2
  111. package/dist/esm/cura-accordion_18.entry.js +48 -47
  112. package/dist/esm/cura-accordion_18.entry.js.map +1 -1
  113. package/dist/esm/cura-alert.entry.js +1 -1
  114. package/dist/esm/cura-badge-counter.entry.js +1 -1
  115. package/dist/esm/cura-badge-dot.entry.js +1 -1
  116. package/dist/esm/cura-badge-pill.entry.js +1 -1
  117. package/dist/esm/cura-button-outline.entry.js +1 -1
  118. package/dist/esm/cura-button-select.entry.js +1 -1
  119. package/dist/esm/cura-calendar.entry.js +1 -1
  120. package/dist/esm/cura-card.entry.js +1 -1
  121. package/dist/esm/cura-checkbox.entry.js +1 -1
  122. package/dist/esm/cura-display.entry.js +2 -2
  123. package/dist/esm/cura-dropdown-search-not-found.entry.js +1 -1
  124. package/dist/esm/cura-dropdown-search-not-found.entry.js.map +1 -1
  125. package/dist/esm/cura-icons-view.entry.js +1 -1
  126. package/dist/esm/cura-input-date.entry.js +2 -2
  127. package/dist/esm/cura-loader-bar.entry.js +2 -2
  128. package/dist/esm/cura-modal.entry.js +1 -1
  129. package/dist/esm/cura-progress-bar_2.entry.js +1 -1
  130. package/dist/esm/cura-radio.entry.js +2 -2
  131. package/dist/esm/cura-stepper.entry.js +1 -1
  132. package/dist/esm/cura-switch.entry.js +2 -2
  133. package/dist/esm/cura-toast.entry.js +1 -1
  134. package/dist/esm/cura-tooltip.entry.js +1 -1
  135. package/dist/esm/cura.js +3 -3
  136. package/dist/esm/{index-717b36df.js → index-21683715.js} +2 -5
  137. package/dist/esm/index-21683715.js.map +1 -0
  138. package/dist/esm/loader.js +3 -3
  139. package/dist/types/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.d.ts → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts} +1 -1
  140. package/dist/types/components/{cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.stories.d.ts → cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts} +1 -1
  141. package/dist/types/components/{cura-dropdown-search-new/cura-dropdown-search-new.d.ts → cura-dropdown-search/cura-dropdown-search.d.ts} +1 -1
  142. package/dist/types/components.d.ts +12 -211
  143. package/package.json +2 -2
  144. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +0 -22
  145. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js.map +0 -1
  146. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +0 -65
  147. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +0 -1
  148. package/dist/cjs/cura-dropdown-search.cjs.entry.js +0 -285
  149. package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +0 -1
  150. package/dist/cjs/index-12d54921.js.map +0 -1
  151. package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.js.map +0 -1
  152. package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.stories.js.map +0 -1
  153. package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.js.map +0 -1
  154. package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.stories.js.map +0 -1
  155. package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.js.map +0 -1
  156. package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.js.map +0 -1
  157. package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.js.map +0 -1
  158. package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.stories.js.map +0 -1
  159. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +0 -76
  160. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +0 -164
  161. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +0 -1
  162. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js +0 -65
  163. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +0 -1
  164. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.css +0 -10
  165. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +0 -19
  166. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js.map +0 -1
  167. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +0 -158
  168. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +0 -534
  169. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +0 -1
  170. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js +0 -218
  171. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map +0 -1
  172. package/dist/components/cura-dropdown-search-new.d.ts +0 -11
  173. package/dist/components/cura-dropdown-search-new.js +0 -400
  174. package/dist/components/cura-dropdown-search-new.js.map +0 -1
  175. package/dist/components/cura-dropdown-search-option-new.d.ts +0 -11
  176. package/dist/components/cura-dropdown-search-option-new.js +0 -81
  177. package/dist/components/cura-dropdown-search-option-new.js.map +0 -1
  178. package/dist/components/cura-dropdown-search-option-title.d.ts +0 -11
  179. package/dist/components/cura-dropdown-search-option-title.js +0 -42
  180. package/dist/components/cura-dropdown-search-option-title.js.map +0 -1
  181. package/dist/cura/p-46994182.entry.js +0 -2
  182. package/dist/cura/p-46994182.entry.js.map +0 -1
  183. package/dist/cura/p-86d317f3.entry.js.map +0 -1
  184. package/dist/cura/p-af3ac476.js.map +0 -1
  185. package/dist/cura/p-b1d6ee8d.entry.js +0 -2
  186. package/dist/cura/p-b1d6ee8d.entry.js.map +0 -1
  187. package/dist/cura/p-b3582389.entry.js +0 -2
  188. package/dist/cura/p-b3582389.entry.js.map +0 -1
  189. package/dist/cura/p-ee7328a5.entry.js +0 -2
  190. package/dist/cura/p-ee7328a5.entry.js.map +0 -1
  191. package/dist/esm/cura-dropdown-search-option-title.entry.js +0 -18
  192. package/dist/esm/cura-dropdown-search-option-title.entry.js.map +0 -1
  193. package/dist/esm/cura-dropdown-search-option.entry.js +0 -61
  194. package/dist/esm/cura-dropdown-search-option.entry.js.map +0 -1
  195. package/dist/esm/cura-dropdown-search.entry.js +0 -281
  196. package/dist/esm/cura-dropdown-search.entry.js.map +0 -1
  197. package/dist/esm/index-717b36df.js.map +0 -1
  198. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts +0 -31
  199. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts +0 -55
  200. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.d.ts +0 -3
  201. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +0 -142
  202. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.stories.d.ts +0 -157
  203. /package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.css +0 -0
  204. /package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.js +0 -0
  205. /package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.css +0 -0
  206. /package/dist/collection/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.js +0 -0
  207. /package/dist/collection/components/{cura-dropdown-search-new/cura-dropdown-search-new.css → cura-dropdown-search/cura-dropdown-search.css} +0 -0
  208. /package/dist/cura/{p-5afb630e.entry.js.map → p-07817634.entry.js.map} +0 -0
  209. /package/dist/cura/{p-24cd591e.entry.js.map → p-1016108a.entry.js.map} +0 -0
  210. /package/dist/cura/{p-fc9584dd.entry.js.map → p-174d220e.entry.js.map} +0 -0
  211. /package/dist/cura/{p-d227469a.entry.js.map → p-186392b7.entry.js.map} +0 -0
  212. /package/dist/cura/{p-d25142cd.entry.js.map → p-197213c0.entry.js.map} +0 -0
  213. /package/dist/cura/{p-bf69b32f.entry.js.map → p-25932952.entry.js.map} +0 -0
  214. /package/dist/cura/{p-89671cd4.entry.js.map → p-3519d0ba.entry.js.map} +0 -0
  215. /package/dist/cura/{p-02c2b948.entry.js.map → p-38777561.entry.js.map} +0 -0
  216. /package/dist/cura/{p-6243742a.entry.js.map → p-3c305dbd.entry.js.map} +0 -0
  217. /package/dist/cura/{p-f1098b41.entry.js.map → p-405a50de.entry.js.map} +0 -0
  218. /package/dist/cura/{p-bfaf9964.entry.js.map → p-53d68d72.entry.js.map} +0 -0
  219. /package/dist/cura/{p-506747fb.entry.js.map → p-62c1b0f4.entry.js.map} +0 -0
  220. /package/dist/cura/{p-0a391c03.entry.js.map → p-6f7f157e.entry.js.map} +0 -0
  221. /package/dist/cura/{p-635c0f4d.entry.js.map → p-777decf9.entry.js.map} +0 -0
  222. /package/dist/cura/{p-8fb3bede.entry.js.map → p-a1782f0e.entry.js.map} +0 -0
  223. /package/dist/cura/{p-d2da92d9.entry.js.map → p-ac0c90af.entry.js.map} +0 -0
  224. /package/dist/cura/{p-9214ee88.entry.js.map → p-d77df3f0.entry.js.map} +0 -0
  225. /package/dist/cura/{p-18af52e4.entry.js.map → p-d7f46266.entry.js.map} +0 -0
  226. /package/dist/cura/{p-02717e7d.entry.js.map → p-e1916252.entry.js.map} +0 -0
  227. /package/dist/cura/{p-500f1256.entry.js.map → p-fc1fd622.entry.js.map} +0 -0
  228. /package/dist/types/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.d.ts +0 -0
  229. /package/dist/types/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-category/cura-dropdown-search-category.stories.d.ts +0 -0
  230. /package/dist/types/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.d.ts +0 -0
  231. /package/dist/types/components/{cura-dropdown-search-new → cura-dropdown-search}/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.d.ts +0 -0
  232. /package/dist/types/components/{cura-dropdown-search-new/cura-dropdown-search-new.stories.d.ts → cura-dropdown-search/cura-dropdown-search.stories.d.ts} +0 -0
@@ -1,11 +1,64 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { a as addBodyScrollLockClass, r as removeBodyScrollLockClass, c as checkMobile, d as defineCustomElement$4, b as checkIOS } from './cura-input-text2.js';
2
3
  import { d as defineCustomElement$6 } from './cura-button-transparent2.js';
3
4
  import { d as defineCustomElement$5 } from './cura-icon2.js';
4
- import { d as defineCustomElement$4 } from './cura-input-text2.js';
5
5
  import { d as defineCustomElement$3 } from './cura-label2.js';
6
6
  import { d as defineCustomElement$2 } from './cura-loader-circle2.js';
7
7
 
8
- const curaDropdownSearchCss = ":host{display:block;width:100%;box-sizing:border-box}.dropdown{display:flex;position:relative;flex-direction:column;width:inherit}.dropdown .dropdown-search-list{z-index:1000}.dropdown-input-search{width:100%;display:flex;justify-content:center;align-items:center;background:transparent}.dropdown-input-search.dropdown-open ::part(cura-input-field){border-radius:4px 4px 0px 0px}.dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:none}.dropdown-input-search.dropdown-open cura-input-text ::slotted([slot=helperText]){display:none}.dropdown-search-list{position:absolute;top:calc(100% - 8px);width:100%;max-height:var(--dropdown-max-height);padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));border-radius:0px 0px 4px 4px;border-top:0 var(--neutral-light);border-right:2px solid var(--neutral-light);border-bottom:2px solid var(--neutral-light);border-left:2px solid var(--neutral-light);background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;display:none}.dropdown-search-list.visible{display:block}.dropdown-search-list-input-search{width:inherit;display:flex;justify-content:center;align-items:center;padding:16px 8px;border-bottom:2px solid var(--info-base);background-color:var(--neutral-purewhite)}.dropdown-search-list-input-search cura-input-text{width:inherit}.dropdown-search-list-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile{position:fixed;top:1%;left:0;right:0;width:100%;z-index:10000}.dropdown-mobile .dropdown-input-search{display:flex;background-color:var(--neutral-purewhite);border-bottom:2px solid var(--info-base);z-index:10000}.dropdown-mobile .dropdown-input-search cura-button-transparent{display:flex;margin-right:4px}.dropdown-mobile .dropdown-input-search cura-input-text{padding:12px 8px 12px 0px}.dropdown-mobile .dropdown-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile .dropdown-input-search.dropdown-open{display:flex}.dropdown-mobile .dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:block}.dropdown-mobile .dropdown-search-list{position:static;width:100%;height:calc(100vh - var(--dynamic-input-search-height, 0));max-height:none;padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:none;border:none;background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;z-index:10000}";
8
+ class FixedElementScrollBehavior {
9
+ constructor(hostElement, scrollableElement) {
10
+ this._stopPropagationEvent = (e) => {
11
+ if (this.scrollableElement.scrollHeight <= this.scrollableElement.clientHeight) {
12
+ e.preventDefault();
13
+ }
14
+ e.stopPropagation();
15
+ };
16
+ this._preventEvent = (ev) => {
17
+ ev.preventDefault();
18
+ ev.stopPropagation();
19
+ };
20
+ if (!hostElement || !scrollableElement) {
21
+ console.error("Componentes host ou scrollable não foram informados corretamente ou não existem.");
22
+ }
23
+ else {
24
+ this.hostElement = hostElement;
25
+ this.scrollableElement = scrollableElement;
26
+ }
27
+ }
28
+ disableScroll() {
29
+ this.scrollPosition = window.scrollY;
30
+ window.scrollTo({ top: 0, behavior: 'instant' });
31
+ addBodyScrollLockClass();
32
+ this._addEvents();
33
+ }
34
+ enableScroll() {
35
+ removeBodyScrollLockClass();
36
+ window.scrollTo({ top: this.scrollPosition, behavior: 'instant' });
37
+ this._removeEvents();
38
+ }
39
+ _addEvents() {
40
+ this.hostElement.addEventListener('wheel', this._preventEvent, { passive: false });
41
+ this.hostElement.addEventListener('mousewheel', this._preventEvent, { passive: false });
42
+ this.hostElement.addEventListener('touchmove', this._preventEvent, { passive: false });
43
+ this.hostElement.addEventListener('scroll', this._preventEvent, { passive: false });
44
+ this.scrollableElement.addEventListener('wheel', this._stopPropagationEvent, { passive: false });
45
+ this.scrollableElement.addEventListener('mousewheel', this._stopPropagationEvent, { passive: false });
46
+ this.scrollableElement.addEventListener('touchmove', this._stopPropagationEvent, { passive: false });
47
+ this.scrollableElement.addEventListener('scroll', this._stopPropagationEvent, { passive: false });
48
+ }
49
+ _removeEvents() {
50
+ this.hostElement.removeEventListener('wheel', this._preventEvent);
51
+ this.hostElement.removeEventListener('mousewheel', this._preventEvent);
52
+ this.hostElement.removeEventListener('touchmove', this._preventEvent);
53
+ this.hostElement.removeEventListener('scroll', this._preventEvent);
54
+ this.scrollableElement.removeEventListener('wheel', this._stopPropagationEvent);
55
+ this.scrollableElement.removeEventListener('mousewheel', this._stopPropagationEvent);
56
+ this.scrollableElement.removeEventListener('touchmove', this._stopPropagationEvent);
57
+ this.scrollableElement.removeEventListener('scroll', this._stopPropagationEvent);
58
+ }
59
+ }
60
+
61
+ const curaDropdownSearchCss = ":host{display:block;box-sizing:border-box;position:relative}:host .component-controls{display:flex;align-items:center;justify-content:center;gap:calc(var(--cura-spacing-base) * 1px)}:host .component-controls #button-back{padding:0 0 0 calc(var(--cura-spacing-base) * 3px);width:max-content}:host .component-container{box-sizing:border-box;width:100%;position:relative;display:grid;grid-template-columns:1fr;grid-template-rows:min-content 1fr}:host .component-container.zoom{position:fixed;top:0;left:0;width:100vw;background:var(--purewhite);height:var(--height);z-index:9999;overscroll-behavior:contain}:host .component-container.zoom .component-controls{border-bottom:2px solid var(--primary);padding:calc(var(--cura-spacing-base) * 3px) 0}:host .component-container.zoom.error .component-controls{border-bottom:2px solid var(--error-dark);background-color:var(--error-lighter)}:host .component-container .dropdown-container{box-sizing:border-box;width:100%;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;padding:calc(var(--cura-spacing-base) * 3px);overscroll-behavior:contain}:host .component-container:not(.zoom) .dropdown-container{box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));position:absolute;bottom:0;left:0;transform:translateY(100%);max-height:var(--max-height);background-color:var(--purewhite);border-radius:0px 0px calc(var(--cura-spacing-base) * 1px) calc(var(--cura-spacing-base) * 1px);border-bottom:2px solid var(--neutral-light);border-left:2px solid var(--neutral-light);border-right:2px solid var(--neutral-light);display:none;z-index:9997}:host .component-container:not(.zoom).dropdown-visible ::part(cura-input-field){border-radius:4px 4px 0px 0px}:host .component-container:not(.zoom).dropdown-visible ::part(cura-input-text-helper){height:0px;overflow:hidden;margin-top:0px}:host .component-container:not(.zoom).dropdown-visible .dropdown-container{display:block}";
9
62
  const CuraDropdownSearchStyle0 = curaDropdownSearchCss;
10
63
 
11
64
  const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdownSearch extends HTMLElement {
@@ -13,299 +66,293 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
13
66
  super();
14
67
  this.__registerHost();
15
68
  this.__attachShadow();
16
- this.valueChanged = createEvent(this, "valueChanged", 7);
17
- this.onselect = createEvent(this, "onselect", 7);
18
- this.overlayElement = null;
19
- this.adjustInputPosition = () => {
20
- setTimeout(() => {
21
- var _a, _b;
22
- const isKeyboardOpen = (window === null || window === void 0 ? void 0 : window.innerHeight) < this.screenDefaultHeight;
23
- const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
24
- if (dropdown) {
25
- dropdown.style.position = isKeyboardOpen ? 'absolute' : 'fixed';
26
- dropdown.style.bottom = isKeyboardOpen ? `${((_b = window === null || window === void 0 ? void 0 : window.screen) === null || _b === void 0 ? void 0 : _b.height) - (window === null || window === void 0 ? void 0 : window.innerHeight)}px` : '0';
27
- window.scroll({ top: 0, left: 0 });
69
+ this.termchange = createEvent(this, "termchange", 7);
70
+ this.optionselect = createEvent(this, "optionselect", 7);
71
+ this.resizeTimeoutMs = 66;
72
+ this.focusTimeoutMs = 300;
73
+ this.blurTimeoutMs = 300;
74
+ this.highlightedIndex = -1;
75
+ this.dropdownSelectableItems = [];
76
+ this.handleSlotChange = () => { this.getSlotElements(); };
77
+ this.handleWindowResize = () => {
78
+ if (this.resizeTimeout)
79
+ clearTimeout(this.resizeTimeout);
80
+ this.resizeTimeout = setTimeout(() => {
81
+ this.isMobile = checkMobile();
82
+ this.setZoomHeight();
83
+ }, this.resizeTimeoutMs);
84
+ };
85
+ this.handleFocus = () => {
86
+ if (this.focusTimeout)
87
+ clearTimeout(this.focusTimeout);
88
+ this.focusTimeout = setTimeout(() => {
89
+ this.isOnFocus = true;
90
+ this.clearHighlight();
91
+ if (this.isMobile && !this.zoomState)
92
+ this.enterZoom();
93
+ if (this.zoomState)
94
+ this.setZoomHeight();
95
+ setTimeout(() => {
96
+ var _a;
97
+ (_a = this.selectedOptionElement) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'instant', block: 'nearest', inline: 'nearest' });
98
+ }, 10);
99
+ }, this.focusTimeoutMs);
100
+ };
101
+ this.handleBlur = () => {
102
+ if (this.blurTimeout)
103
+ clearTimeout(this.blurTimeout);
104
+ this.blurTimeout = setTimeout(() => {
105
+ if (this.zoomState) {
106
+ const delay = checkIOS ? 500 : 100;
107
+ setTimeout(() => this.setZoomHeight(), delay);
28
108
  }
29
- }, 300);
109
+ this.isOnFocus = false;
110
+ }, this.blurTimeoutMs);
30
111
  };
31
- this.handleSlotChange = () => {
32
- this.options = Array.from(this.host.querySelectorAll('cura-dropdown-search-option'));
33
- this.addClickListenersToOptions();
34
- this.updateHoveredIndex();
112
+ this.handleFocusout = () => {
113
+ if (this.zoomState)
114
+ this.setZoomHeight();
35
115
  };
36
- this.handleInputChange = (event) => {
37
- const input = event.target;
38
- this.value = input.value;
39
- this.onValueChange(this.value);
116
+ this.handleBackClick = () => { this.exitZoom(); };
117
+ this.handleOptionActionClick = (ev) => {
118
+ this.getInputElement().setFocus();
119
+ this._preventEvent(ev);
40
120
  };
41
- this.handleKeyDown = (event) => {
42
- if (event.key === 'ArrowDown') {
43
- event.preventDefault();
44
- this.moveHighlight(1);
45
- }
46
- else if (event.key === 'ArrowUp') {
47
- event.preventDefault();
48
- this.moveHighlight(-1);
49
- }
50
- else if (event.key === 'Enter') {
51
- event.preventDefault();
52
- if (this.hoveredIndex > -1) {
53
- this.handleOnBlur();
54
- this.onSelectedOption(this.hoveredIndex);
55
- }
56
- }
121
+ this.handleInputClear = (ev) => {
122
+ this.setValue('');
123
+ this.clearSelectedOptions();
124
+ this._preventEvent(ev);
57
125
  };
58
- this.handleResize = () => {
59
- this.isMobile = window.innerWidth < 768;
60
- if (this.isDropdownOpen) {
61
- if (this.isMobile) {
62
- this.showOverlay();
63
- }
64
- else {
65
- this.resetDropdownStyles();
66
- this.removeOverlay();
67
- }
126
+ this.handleSelectOption = (ev) => {
127
+ this._selectOption(ev.detail);
128
+ this._preventEvent(ev);
129
+ };
130
+ this.handleInputValueChange = (ev) => {
131
+ this.setValue(ev.detail);
132
+ if (this.selectedOptionElement && ev.detail !== this.selectedOptionElement.value) {
133
+ this.clearSelectedOptions();
68
134
  }
135
+ this._preventEvent(ev);
136
+ };
137
+ this.handleDropdownMouseOver = () => {
138
+ if (this.highlightedElement || this.highlightedIndex >= 0)
139
+ this.clearHighlight();
69
140
  };
70
- this.setUp = () => {
71
- this.handleResize();
72
- this.adjustInputPosition();
141
+ this.handleKeyDown = (ev) => {
142
+ if (ev.key === 'ArrowDown')
143
+ this.moveHighlight('next');
144
+ if (ev.key === 'ArrowUp')
145
+ this.moveHighlight('prev');
146
+ if (ev.key === 'Enter')
147
+ this.selectHighlight();
73
148
  };
149
+ this.getInputElement = () => { var _a; return (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('cura-input-text'); };
150
+ this._preventEvent = (ev) => {
151
+ ev.preventDefault();
152
+ ev.stopPropagation();
153
+ };
154
+ this.name = undefined;
74
155
  this.size = 'large';
75
156
  this.status = 'default';
76
157
  this.disabled = false;
77
- this.name = undefined;
78
158
  this.required = false;
79
- this.selected = false;
80
- this.value = '';
81
159
  this.placeholder = '';
82
160
  this.label = '';
83
- this.iconName = 'search';
84
- this.dropdownMaxHeight = '630px';
85
- this.overlayVisible = false;
86
- this.isDropdownOpen = false;
161
+ this.icon = 'search';
162
+ this.maxheight = '400px';
163
+ this.value = '';
164
+ this.searchdelay = 400;
165
+ this.searchminchars = 3;
87
166
  this.styles = {};
88
- this.isMobile = window.innerWidth < 768;
89
- this.mode = 'default';
90
- this.inputTextRef = undefined;
91
- this.isOnBlurInput = true;
92
- this.hoveredIndex = -1;
93
- this.options = [];
94
- this.originalOverflow = '';
95
- this.screenDefaultHeight = 0;
167
+ this.zoomState = false;
168
+ this.isOnFocus = false;
169
+ this.dropdownItems = [];
170
+ }
171
+ /**
172
+ * Set focus to input field.
173
+ */
174
+ async setFocus() {
175
+ this.getInputElement().setFocus();
176
+ }
177
+ /**
178
+ * Select by optionid property of a selectable option component.
179
+ */
180
+ async selectOption(optionid) {
181
+ this._selectOption(optionid);
96
182
  }
97
183
  connectedCallback() {
98
184
  this.weights = window.CuraAPI.theme.fonts.getWeights();
99
- this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor('info-base');
100
- this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');
185
+ this.breakpoints = window.CuraAPI.theme.breakpoints.get();
186
+ this.styles['--info'] = window.CuraAPI.theme.colors.getColor('info-base');
187
+ this.styles['--purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');
101
188
  this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');
102
189
  this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');
103
190
  this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);
104
191
  this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');
105
192
  this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');
106
- this.styles['--breakpoints'] = window.CuraAPI.theme.breakpoints.get();
193
+ this.styles['--primary'] = window.CuraAPI.theme.colors.getColor('primary');
107
194
  this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
108
195
  this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
109
196
  this.styles['--font-weight-medium'] = this.weights.medium;
197
+ window === null || window === void 0 ? void 0 : window.addEventListener('resize', this.handleWindowResize);
198
+ window === null || window === void 0 ? void 0 : window.addEventListener('orientationchange', this.handleWindowResize);
199
+ this.isMobile = checkMobile();
110
200
  }
111
- onValueChange(newValue) {
112
- this.value = newValue;
113
- this.updateSelectedOption(newValue);
114
- this.valueChanged.emit(newValue);
201
+ componentDidLoad() {
202
+ var _a;
203
+ this.dropdownElement = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-container');
204
+ this.host.addEventListener('actionclick', this.handleOptionActionClick);
205
+ this.host.addEventListener('selectoption', this.handleSelectOption);
206
+ this.scrollBehavior = new FixedElementScrollBehavior(this.host, this.dropdownElement);
207
+ setTimeout(() => this.getSlotElements(), 10);
115
208
  }
116
- componentWillLoad() {
117
- this.updateSelectedOption(this.value);
209
+ disconnectedCallback() {
210
+ window === null || window === void 0 ? void 0 : window.removeEventListener('resize', this.handleWindowResize);
211
+ window === null || window === void 0 ? void 0 : window.removeEventListener('orientationchange', this.handleWindowResize);
118
212
  }
119
- componentDidRender() {
120
- if (this.isDropdownOpen && this.isMobile) {
121
- this.showOverlay();
122
- this.getDropdownSearchListHeight();
213
+ moveHighlight(direction) {
214
+ if (!this.dropdownSelectableItems.length)
215
+ return;
216
+ let position = direction === 'next' ? this.highlightedIndex + 1 : this.highlightedIndex - 1;
217
+ if (position < 0) {
218
+ this.clearHighlight();
219
+ return;
123
220
  }
124
- else {
125
- this.removeOverlay();
221
+ const selectableItemsLastPosition = this.dropdownSelectableItems.length - 1;
222
+ if (position > selectableItemsLastPosition)
223
+ position = selectableItemsLastPosition;
224
+ if (this.highlightedElement)
225
+ this.highlightedElement.highlighted = false;
226
+ this.highlightedIndex = position;
227
+ this.highlightedElement = this.dropdownSelectableItems[position];
228
+ if (this.highlightedElement.selected) {
229
+ this.moveHighlight(direction);
230
+ return;
126
231
  }
232
+ this.highlightedElement.highlighted = true;
233
+ this.highlightedElement.scrollIntoView({ behavior: 'instant', block: 'nearest', inline: 'nearest' });
127
234
  }
128
- componentDidLoad() {
129
- var _a;
130
- this.screenDefaultHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
131
- window === null || window === void 0 ? void 0 : window.addEventListener('resize', this.setUp);
132
- (_a = window === null || window === void 0 ? void 0 : window.visualViewport) === null || _a === void 0 ? void 0 : _a.addEventListener('resize', this.adjustInputPosition);
235
+ clearHighlight() {
236
+ if (this.highlightedElement) {
237
+ this.highlightedElement.highlighted = false;
238
+ this.highlightedElement = null;
239
+ }
240
+ this.highlightedIndex = -1;
133
241
  }
134
- disconnectedCallback() {
135
- var _a;
136
- window === null || window === void 0 ? void 0 : window.removeEventListener('resize', this.setUp);
137
- (_a = window === null || window === void 0 ? void 0 : window.visualViewport) === null || _a === void 0 ? void 0 : _a.removeEventListener('resize', this.adjustInputPosition);
242
+ selectHighlight() {
243
+ if (this.highlightedElement) {
244
+ this._selectOption(this.highlightedElement.optionid);
245
+ this.clearHighlight();
246
+ this.getInputElement().blur();
247
+ }
138
248
  }
139
- showOverlay() {
140
- if (!this.overlayElement) {
141
- this.overlayElement = document.createElement('div');
142
- this.overlayElement.className = 'dropdown-overlay';
143
- this.overlayElement.style.position = 'fixed';
144
- this.overlayElement.style.top = '0';
145
- this.overlayElement.style.left = '0';
146
- this.overlayElement.style.width = '100%';
147
- this.overlayElement.style.height = '100%';
148
- this.overlayElement.style.zIndex = '9999';
149
- this.overlayElement.style.backgroundColor = 'white';
150
- document.body.appendChild(this.overlayElement);
151
- this.originalOverflow = document.body.style.overflow;
152
- document.body.style.overflow = 'hidden';
249
+ setValue(value) {
250
+ if (this.value !== value) {
251
+ this.value = value;
252
+ if (this.valueTimeout)
253
+ clearTimeout(this.valueTimeout);
254
+ this.valueTimeout = setTimeout(() => {
255
+ this.termchange.emit(this.value === '' || this.value.length < this.searchminchars ? '' : this.value);
256
+ }, this.searchdelay || 300);
153
257
  }
154
258
  }
155
- removeOverlay() {
156
- if (this.overlayElement && this.overlayElement.parentNode === document.body) {
157
- document.body.removeChild(this.overlayElement);
158
- this.overlayElement = null;
159
- document.body.style.overflow = this.originalOverflow;
259
+ _selectOption(optionid) {
260
+ if (!optionid) {
261
+ this.clearSelectedOptions();
262
+ this.setValue('');
263
+ return;
264
+ }
265
+ const optionElement = this.dropdownSelectableItems.find(option => option.optionid === optionid);
266
+ if (optionElement && !optionElement.selected) {
267
+ this.clearSelectedOptions();
268
+ this.selectedOptionElement = optionElement;
269
+ this.selectedOptionElement.selected = true;
270
+ this.setValue(this.selectedOptionElement.value);
271
+ this.optionselect.emit(this.selectedOptionElement.optionid);
272
+ if (this.zoomState)
273
+ setTimeout(() => this.exitZoom(), this.blurTimeoutMs);
160
274
  }
161
275
  }
162
- addClickListenersToOptions() {
163
- this.options.forEach((option, index) => {
164
- option === null || option === void 0 ? void 0 : option.addEventListener('optionSelected', () => this.onSelectedOption(index));
276
+ clearSelectedOptions() {
277
+ this.dropdownSelectableItems.forEach(option => {
278
+ if (option.selected)
279
+ option.selected = false;
165
280
  });
281
+ this.selectedOptionElement = null;
166
282
  }
167
- updateSelectedOption(value) {
168
- const selectedOptionIndex = this.options.findIndex(option => option.getAttribute('value') === value);
169
- this.hoveredIndex = selectedOptionIndex;
170
- this.updateOptionAttribute('hovered', this.hoveredIndex);
171
- this.updateOptionAttribute('selected', this.hoveredIndex);
172
- this.scrollHoveredOptionIntoView();
173
- this.adjustInputPosition();
174
- }
175
- onSelectedOption(index) {
176
- setTimeout(() => {
177
- const selectedOption = this.options[index];
178
- if (selectedOption.selectable) {
179
- const selectedValue = selectedOption.getAttribute('value') || selectedOption.textContent;
180
- this.value = selectedValue || '';
181
- this.updateSelectedOption(this.value);
182
- this.isDropdownOpen = false;
183
- this.isOnBlurInput = true;
184
- this.resetDropdownStyles();
185
- this.removeOverlay();
186
- }
187
- }, 200);
188
- }
189
- moveHighlight(direction) {
190
- const visibleOptions = this.options;
191
- const newIndex = (this.hoveredIndex + direction + visibleOptions.length) % visibleOptions.length;
192
- this.hoveredIndex = newIndex;
193
- this.updateOptionAttribute('hovered', this.hoveredIndex);
194
- this.scrollHoveredOptionIntoView();
283
+ getSlotElements() {
284
+ const elements = [];
285
+ const selectable = [];
286
+ let hasNotFound = false;
287
+ if (this.dropdownElement) {
288
+ this.dropdownElement
289
+ .querySelector('slot')
290
+ .assignedElements()
291
+ .forEach(item => {
292
+ elements.push(item);
293
+ if (item.localName === 'cura-dropdown-search-option' && item["selectable"])
294
+ selectable.push(item);
295
+ if (item.localName === 'cura-dropdown-search-not-found')
296
+ hasNotFound = true;
297
+ });
298
+ }
299
+ this.dropdownSelectableItems = selectable;
300
+ this.dropdownItems = elements;
301
+ this.status = hasNotFound ? 'error' : 'default';
195
302
  }
196
- updateOptionAttribute(attribute, indexToUpdate) {
197
- this.options.forEach((option, index) => {
198
- option[attribute] = index === indexToUpdate;
199
- });
303
+ enterZoom() {
304
+ this.scrollBehavior.disableScroll();
305
+ this.setZoomHeight();
306
+ this.zoomState = true;
200
307
  }
201
- updateHoveredIndex() {
202
- const visibleOptions = this.options;
203
- const currentValue = this.value;
204
- this.hoveredIndex = visibleOptions.findIndex(option => option.getAttribute('value') === currentValue);
308
+ exitZoom() {
309
+ this.scrollBehavior.enableScroll();
310
+ this.setZoomHeight();
311
+ setTimeout(() => { this.zoomState = false; }, 300);
205
312
  }
206
- scrollHoveredOptionIntoView() {
313
+ setZoomHeight() {
207
314
  var _a;
208
- const container = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-search-list');
209
- const hoveredOption = this.options[this.hoveredIndex];
210
- if (container && hoveredOption) {
211
- const optionRect = hoveredOption.getBoundingClientRect();
212
- const containerRect = container.getBoundingClientRect();
213
- if (optionRect.bottom > containerRect.bottom) {
214
- container.scrollTop += optionRect.bottom - containerRect.bottom;
215
- }
216
- if (optionRect.top < containerRect.top) {
217
- container.scrollTop -= containerRect.top - optionRect.top;
218
- }
219
- }
220
- }
221
- handleOnBlur() {
222
- if (this.isOnBlurInput === true) {
223
- setTimeout(() => {
224
- this.isDropdownOpen = false;
225
- this.resetDropdownStyles();
226
- this.removeOverlay();
227
- }, 200);
228
- }
315
+ const h = window ? `${((_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height) || window.innerHeight}px` : '100vh';
316
+ this.styles = Object.assign(Object.assign({}, this.styles), { '--height': h });
229
317
  }
230
318
  getClasses() {
231
319
  return {
232
- 'dropdown-input-search': true,
233
- 'dropdown-open': this.isDropdownOpen,
234
- 'disabled': this.disabled,
235
- [this.status]: true,
320
+ "component-container": true,
321
+ "mobile": this.isMobile,
322
+ "zoom": this.zoomState,
323
+ "dropdown-visible": this.isOnFocus && (this.dropdownItems.length > 0 && !this.zoomState),
324
+ "error": this.status === 'error'
236
325
  };
237
326
  }
238
- getDropdownClasses() {
327
+ getHostCSSProperties() {
239
328
  return {
240
- 'dropdown-search-list': true,
241
- 'visible': this.options.length && this.isDropdownOpen ? true : false,
329
+ '--max-height': this.maxheight || '400px'
242
330
  };
243
331
  }
244
- hostCSSProperties() {
245
- return {
246
- '--dropdown-max-height': this.dropdownMaxHeight,
247
- };
248
- }
249
- handleOnFocus() {
250
- this.isDropdownOpen = true;
251
- }
252
- getDropdownSearchListHeight() {
253
- setTimeout(() => {
254
- var _a;
255
- const dropdownInputSearchElement = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-input-search');
256
- if (dropdownInputSearchElement) {
257
- this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);
258
- }
259
- }, 310);
260
- }
261
- handleGoBack() {
262
- this.resetDropdownStyles();
263
- this.isMobile = false;
264
- }
265
- resetDropdownStyles() {
266
- var _a;
267
- const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
268
- if (dropdown && dropdown.style.position === 'fixed') {
269
- dropdown.style.position = 'relative';
270
- dropdown.style.removeProperty('bottom');
271
- }
272
- }
273
332
  render() {
274
- const isMobileDropdown = this.isMobile && this.isDropdownOpen;
275
- return (h(Host, { key: '8e47b4652a5f7143b9f9d8704105624debd5ab86', style: this.hostCSSProperties(), class: "dropdown-overlay" }, h("div", { key: 'a5c9a6878be61268fb2a6fe5f42c3811aaa25e92', class: `dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`, style: this.styles }, h("div", { key: 'c10d5a2793e7961370f63b124eb8538c0fe161a2', class: this.getClasses() }, this.isMobile && this.isDropdownOpen && (h("cura-button-transparent", { key: 'a5d8233857277aa56c7d4d8048c8d8199635f117', fontColor: "dark", onClick: () => this.handleGoBack(), iconName: "arrowLeft", size: "medium", iconOnly: true, color: "primary" })), h("cura-input-text", { key: '1f780e794a2e42fa4771f9f6f5cb04f44d5d17d3', disabled: this.disabled, label: this.label, part: "cura-input-field", mode: isMobileDropdown ? 'transparent' : 'default', required: this.required, hideErrorIcon: this.status === 'error', iconName: this.iconName || 'search', value: this.value, status: this.status, onValueChange: e => this.onValueChange(e.target.value), onInput: e => this.handleInputChange(e), onFocus: () => this.handleOnFocus(), onClick: () => (window.innerWidth < 768 ? (this.isMobile = true) : null), onBlur: () => {
276
- this.handleOnBlur();
277
- }, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, h("slot", { key: '87882a490816c64d8780ce4a02b975034e111473', name: "helperText" }))), h("div", { key: 'b0120ab7c2db1a5dcc071e4b79f9aac7d50ae998', id: "dropdown-search-list", class: this.getDropdownClasses() }, h("slot", { key: 'b780c4b317c6aa557a6be5fe3d4c957d943b92c8', name: "dropdown-search-option", onSlotchange: this.handleSlotChange })))));
333
+ return (h(Host, { key: '936c26e5c23d95d8e905f66d8bcf7c636781351e', style: this.getHostCSSProperties() }, h("div", { key: '6bd541e66e07d4db99af875886fbfaba5915fd48', class: this.getClasses(), style: this.styles }, h("div", { key: '4b5036b41878c317bc3b6716bf8590f1d672d21e', class: "component-controls" }, this.isMobile && this.zoomState ? (h("cura-button-transparent", { fontColor: "dark", onClick: () => this.handleBackClick(), iconName: "arrowLeft", size: "large", iconOnly: true, color: "primary", id: "button-back" })) : '', h("cura-input-text", { key: '7d0d8f3090389570d51612ad89cedda9c452527f', disabled: this.disabled, label: this.label, part: "cura-input-field", mode: this.zoomState ? 'transparent' : 'default', required: this.required, iconName: this.icon || 'search', value: this.value, status: this.status, onValueChange: (ev) => this.handleInputValueChange(ev), onInput: (ev) => this._preventEvent(ev), onFocus: () => this.handleFocus(), onClick: (ev) => this._preventEvent(ev), onBlur: () => this.handleBlur(), onFocusout: () => this.handleFocusout(), onInputClear: (ev) => this.handleInputClear(ev), placeholder: this.placeholder, size: this.size, onKeyDown: (ev) => this.handleKeyDown(ev) }, h("slot", { key: 'e9cbf139d9b16a50bf0ca547246a66132e722add', name: "helperText" }))), h("div", { key: 'd8d83a726ef6e87740240b9fb637742bc52151e2', class: "dropdown-container", onMouseOver: () => this.handleDropdownMouseOver() }, h("slot", { key: '7cf5efd8ca64c1f07a19bf0ae6dfcdaeb057c04b', onSlotchange: () => this.handleSlotChange() })))));
278
334
  }
279
335
  get host() { return this; }
280
- static get watchers() { return {
281
- "value": ["onValueChange"]
282
- }; }
283
336
  static get style() { return CuraDropdownSearchStyle0; }
284
337
  }, [1, "cura-dropdown-search", {
285
- "size": [1537],
286
- "status": [513],
287
- "disabled": [516],
288
338
  "name": [513],
289
- "required": [1540],
290
- "selected": [1540],
291
- "value": [1537],
292
- "placeholder": [1537],
293
- "label": [1537],
294
- "iconName": [513, "icon-name"],
295
- "dropdownMaxHeight": [513, "dropdown-max-height"],
296
- "overlayVisible": [32],
297
- "isDropdownOpen": [32],
339
+ "size": [513],
340
+ "status": [1537],
341
+ "disabled": [516],
342
+ "required": [516],
343
+ "placeholder": [513],
344
+ "label": [513],
345
+ "icon": [513],
346
+ "maxheight": [513],
347
+ "value": [1025],
348
+ "searchdelay": [514],
349
+ "searchminchars": [514],
298
350
  "styles": [32],
299
- "isMobile": [32],
300
- "mode": [32],
301
- "inputTextRef": [32],
302
- "isOnBlurInput": [32],
303
- "hoveredIndex": [32],
304
- "options": [32],
305
- "originalOverflow": [32],
306
- "screenDefaultHeight": [32]
307
- }, undefined, {
308
- "value": ["onValueChange"]
351
+ "zoomState": [32],
352
+ "isOnFocus": [32],
353
+ "dropdownItems": [32],
354
+ "setFocus": [64],
355
+ "selectOption": [64]
309
356
  }]);
310
357
  function defineCustomElement$1() {
311
358
  if (typeof customElements === "undefined") {