@aquera/nile-elements 0.1.47-beta-1.6 → 0.1.47-beta-2.1

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 (336) hide show
  1. package/README.md +9 -3
  2. package/demo/index.html +72 -32
  3. package/dist/{fixture-7bfb866e.cjs.js → fixture-161dee0b.cjs.js} +2 -2
  4. package/dist/{fixture-7bfb866e.cjs.js.map → fixture-161dee0b.cjs.js.map} +1 -1
  5. package/dist/{fixture-2b5b3aba.esm.js → fixture-372df3b0.esm.js} +1 -1
  6. package/dist/index.cjs.js +1 -1
  7. package/dist/index.esm.js +1 -1
  8. package/dist/internal/form.cjs.js +1 -1
  9. package/dist/internal/form.cjs.js.map +1 -1
  10. package/dist/internal/form.esm.js +1 -1
  11. package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
  12. package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
  13. package/dist/nile-auto-complete/index.cjs.js +1 -1
  14. package/dist/nile-auto-complete/index.esm.js +1 -1
  15. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -17
  16. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  17. package/dist/nile-auto-complete/nile-auto-complete.esm.js +8 -29
  18. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
  19. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
  20. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
  21. package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
  22. package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
  23. package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
  24. package/dist/nile-badge/nile-badge.test.esm.js +1 -1
  25. package/dist/nile-button/nile-button.test.cjs.js +1 -1
  26. package/dist/nile-button/nile-button.test.esm.js +1 -1
  27. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
  28. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
  29. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  30. package/dist/nile-calendar/nile-calendar.test.cjs.js.map +1 -1
  31. package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
  32. package/dist/nile-card/nile-card.test.cjs.js +1 -1
  33. package/dist/nile-card/nile-card.test.esm.js +1 -1
  34. package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
  35. package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
  36. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  37. package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
  38. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  39. package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
  40. package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
  41. package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
  42. package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
  43. package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
  44. package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
  45. package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
  46. package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
  47. package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
  48. package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
  49. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
  50. package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +1 -1
  51. package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
  52. package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
  53. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
  54. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
  55. package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
  56. package/dist/nile-hero/nile-hero.test.esm.js +1 -1
  57. package/dist/nile-icon/icons/svg/agent.cjs.js +1 -1
  58. package/dist/nile-icon/icons/svg/agent.cjs.js.map +1 -1
  59. package/dist/nile-icon/icons/svg/agent.esm.js +1 -1
  60. package/dist/nile-icon/icons/svg/api.cjs.js +1 -1
  61. package/dist/nile-icon/icons/svg/api.cjs.js.map +1 -1
  62. package/dist/nile-icon/icons/svg/api.esm.js +1 -1
  63. package/dist/nile-icon/icons/svg/apply-filter.cjs.js +1 -1
  64. package/dist/nile-icon/icons/svg/apply-filter.cjs.js.map +1 -1
  65. package/dist/nile-icon/icons/svg/apply-filter.esm.js +1 -1
  66. package/dist/nile-icon/icons/svg/arrowdropdown.cjs.js +1 -1
  67. package/dist/nile-icon/icons/svg/arrowdropdown.cjs.js.map +1 -1
  68. package/dist/nile-icon/icons/svg/arrowdropdown.esm.js +1 -1
  69. package/dist/nile-icon/icons/svg/arrowdropup.cjs.js +1 -1
  70. package/dist/nile-icon/icons/svg/arrowdropup.cjs.js.map +1 -1
  71. package/dist/nile-icon/icons/svg/arrowdropup.esm.js +1 -1
  72. package/dist/nile-icon/icons/svg/database.cjs.js +1 -1
  73. package/dist/nile-icon/icons/svg/database.cjs.js.map +1 -1
  74. package/dist/nile-icon/icons/svg/database.esm.js +1 -1
  75. package/dist/nile-icon/icons/svg/done.cjs.js +1 -1
  76. package/dist/nile-icon/icons/svg/done.cjs.js.map +1 -1
  77. package/dist/nile-icon/icons/svg/done.esm.js +1 -1
  78. package/dist/nile-icon/icons/svg/dontmap.cjs.js +1 -1
  79. package/dist/nile-icon/icons/svg/dontmap.cjs.js.map +1 -1
  80. package/dist/nile-icon/icons/svg/dontmap.esm.js +1 -1
  81. package/dist/nile-icon/icons/svg/doublearrowleft.cjs.js +1 -1
  82. package/dist/nile-icon/icons/svg/doublearrowleft.cjs.js.map +1 -1
  83. package/dist/nile-icon/icons/svg/doublearrowleft.esm.js +1 -1
  84. package/dist/nile-icon/icons/svg/doublearrowright.cjs.js +1 -1
  85. package/dist/nile-icon/icons/svg/doublearrowright.cjs.js.map +1 -1
  86. package/dist/nile-icon/icons/svg/doublearrowright.esm.js +1 -1
  87. package/dist/nile-icon/icons/svg/drag.cjs.js +1 -1
  88. package/dist/nile-icon/icons/svg/drag.cjs.js.map +1 -1
  89. package/dist/nile-icon/icons/svg/drag.esm.js +1 -1
  90. package/dist/nile-icon/icons/svg/expand-06.cjs.js +1 -1
  91. package/dist/nile-icon/icons/svg/expand-06.cjs.js.map +1 -1
  92. package/dist/nile-icon/icons/svg/expand-06.esm.js +1 -1
  93. package/dist/nile-icon/icons/svg/expand.cjs.js +1 -1
  94. package/dist/nile-icon/icons/svg/expand.cjs.js.map +1 -1
  95. package/dist/nile-icon/icons/svg/expand.esm.js +1 -1
  96. package/dist/nile-icon/icons/svg/integer.cjs.js +1 -1
  97. package/dist/nile-icon/icons/svg/integer.cjs.js.map +1 -1
  98. package/dist/nile-icon/icons/svg/integer.esm.js +1 -1
  99. package/dist/nile-icon/icons/svg/pluscircle.cjs.js +1 -1
  100. package/dist/nile-icon/icons/svg/pluscircle.cjs.js.map +1 -1
  101. package/dist/nile-icon/icons/svg/pluscircle.esm.js +1 -1
  102. package/dist/nile-icon/icons/svg/question.cjs.js +1 -1
  103. package/dist/nile-icon/icons/svg/question.cjs.js.map +1 -1
  104. package/dist/nile-icon/icons/svg/question.esm.js +1 -1
  105. package/dist/nile-icon/icons/svg/resource.cjs.js +1 -1
  106. package/dist/nile-icon/icons/svg/resource.cjs.js.map +1 -1
  107. package/dist/nile-icon/icons/svg/resource.esm.js +1 -1
  108. package/dist/nile-icon/icons/svg/sendescalation.cjs.js +1 -1
  109. package/dist/nile-icon/icons/svg/sendescalation.cjs.js.map +1 -1
  110. package/dist/nile-icon/icons/svg/sendescalation.esm.js +1 -1
  111. package/dist/nile-icon/icons/svg/sendreminder.cjs.js +1 -1
  112. package/dist/nile-icon/icons/svg/sendreminder.cjs.js.map +1 -1
  113. package/dist/nile-icon/icons/svg/sendreminder.esm.js +1 -1
  114. package/dist/nile-icon/icons/svg/timezone.cjs.js +1 -1
  115. package/dist/nile-icon/icons/svg/timezone.cjs.js.map +1 -1
  116. package/dist/nile-icon/icons/svg/timezone.esm.js +1 -1
  117. package/dist/nile-icon/icons/svg/unmute.cjs.js +1 -1
  118. package/dist/nile-icon/icons/svg/unmute.cjs.js.map +1 -1
  119. package/dist/nile-icon/icons/svg/unmute.esm.js +1 -1
  120. package/dist/nile-icon/icons/svg/upgrade.cjs.js +1 -1
  121. package/dist/nile-icon/icons/svg/upgrade.cjs.js.map +1 -1
  122. package/dist/nile-icon/icons/svg/upgrade.esm.js +1 -1
  123. package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
  124. package/dist/nile-icon/nile-icon.test.esm.js +1 -1
  125. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  126. package/dist/nile-input/nile-input.test.esm.js +1 -1
  127. package/dist/nile-link/nile-link.test.cjs.js +1 -1
  128. package/dist/nile-link/nile-link.test.esm.js +1 -1
  129. package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
  130. package/dist/nile-loader/nile-loader.test.esm.js +1 -1
  131. package/dist/nile-option/nile-option.cjs.js +1 -1
  132. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  133. package/dist/nile-option/nile-option.css.cjs.js +1 -1
  134. package/dist/nile-option/nile-option.css.cjs.js.map +1 -1
  135. package/dist/nile-option/nile-option.css.esm.js +1 -1
  136. package/dist/nile-option/nile-option.esm.js +2 -2
  137. package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
  138. package/dist/nile-popover/nile-popover.test.esm.js +1 -1
  139. package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
  140. package/dist/nile-popup/nile-popup.test.esm.js +1 -1
  141. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
  142. package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
  143. package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
  144. package/dist/nile-radio/nile-radio.test.esm.js +1 -1
  145. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
  146. package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
  147. package/dist/nile-select/index.cjs.js +1 -1
  148. package/dist/nile-select/index.esm.js +1 -1
  149. package/dist/nile-select/nile-select.cjs.js +1 -1
  150. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  151. package/dist/nile-select/nile-select.esm.js +2 -2
  152. package/dist/nile-select/nile-select.test.cjs.js +1 -1
  153. package/dist/nile-select/nile-select.test.cjs.js.map +1 -1
  154. package/dist/nile-select/nile-select.test.esm.js +2 -2
  155. package/dist/nile-select/virtual-scroll-helper.cjs.js +2 -0
  156. package/dist/nile-select/virtual-scroll-helper.cjs.js.map +1 -0
  157. package/dist/nile-select/virtual-scroll-helper.esm.js +38 -0
  158. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
  159. package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
  160. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
  161. package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
  162. package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
  163. package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
  164. package/dist/nile-virtual-select/index.cjs.js +2 -0
  165. package/dist/nile-virtual-select/index.cjs.js.map +1 -0
  166. package/dist/nile-virtual-select/index.esm.js +1 -0
  167. package/dist/nile-virtual-select/nile-virtual-select.cjs.js +2 -0
  168. package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -0
  169. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +2 -0
  170. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -0
  171. package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +468 -0
  172. package/dist/nile-virtual-select/nile-virtual-select.esm.js +227 -0
  173. package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +2 -0
  174. package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +1 -0
  175. package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +49 -0
  176. package/dist/nile-virtual-select/renderer.cjs.js +2 -0
  177. package/dist/nile-virtual-select/renderer.cjs.js.map +1 -0
  178. package/dist/nile-virtual-select/renderer.esm.js +17 -0
  179. package/dist/nile-virtual-select/search-manager.cjs.js +2 -0
  180. package/dist/nile-virtual-select/search-manager.cjs.js.map +1 -0
  181. package/dist/nile-virtual-select/search-manager.esm.js +1 -0
  182. package/dist/nile-virtual-select/selection-manager.cjs.js +2 -0
  183. package/dist/nile-virtual-select/selection-manager.cjs.js.map +1 -0
  184. package/dist/nile-virtual-select/selection-manager.esm.js +1 -0
  185. package/dist/nile-virtual-select/types.cjs.js +2 -0
  186. package/dist/nile-virtual-select/types.cjs.js.map +1 -0
  187. package/dist/nile-virtual-select/types.esm.js +1 -0
  188. package/dist/src/index.d.ts +1 -0
  189. package/dist/src/index.js +1 -0
  190. package/dist/src/index.js.map +1 -1
  191. package/dist/src/internal/form.js +2 -2
  192. package/dist/src/internal/form.js.map +1 -1
  193. package/dist/src/nile-icon/icons/svg/agent.d.ts +1 -1
  194. package/dist/src/nile-icon/icons/svg/agent.js +1 -1
  195. package/dist/src/nile-icon/icons/svg/agent.js.map +1 -1
  196. package/dist/src/nile-icon/icons/svg/api.d.ts +1 -1
  197. package/dist/src/nile-icon/icons/svg/api.js +1 -1
  198. package/dist/src/nile-icon/icons/svg/api.js.map +1 -1
  199. package/dist/src/nile-icon/icons/svg/apply-filter.d.ts +1 -1
  200. package/dist/src/nile-icon/icons/svg/apply-filter.js +1 -1
  201. package/dist/src/nile-icon/icons/svg/apply-filter.js.map +1 -1
  202. package/dist/src/nile-icon/icons/svg/arrowdropdown.d.ts +1 -1
  203. package/dist/src/nile-icon/icons/svg/arrowdropdown.js +1 -1
  204. package/dist/src/nile-icon/icons/svg/arrowdropdown.js.map +1 -1
  205. package/dist/src/nile-icon/icons/svg/arrowdropup.d.ts +1 -1
  206. package/dist/src/nile-icon/icons/svg/arrowdropup.js +1 -1
  207. package/dist/src/nile-icon/icons/svg/arrowdropup.js.map +1 -1
  208. package/dist/src/nile-icon/icons/svg/database.d.ts +1 -1
  209. package/dist/src/nile-icon/icons/svg/database.js +1 -1
  210. package/dist/src/nile-icon/icons/svg/database.js.map +1 -1
  211. package/dist/src/nile-icon/icons/svg/done.d.ts +1 -1
  212. package/dist/src/nile-icon/icons/svg/done.js +1 -1
  213. package/dist/src/nile-icon/icons/svg/done.js.map +1 -1
  214. package/dist/src/nile-icon/icons/svg/dontmap.d.ts +1 -1
  215. package/dist/src/nile-icon/icons/svg/dontmap.js +1 -1
  216. package/dist/src/nile-icon/icons/svg/dontmap.js.map +1 -1
  217. package/dist/src/nile-icon/icons/svg/doublearrowleft.d.ts +1 -1
  218. package/dist/src/nile-icon/icons/svg/doublearrowleft.js +1 -1
  219. package/dist/src/nile-icon/icons/svg/doublearrowleft.js.map +1 -1
  220. package/dist/src/nile-icon/icons/svg/doublearrowright.d.ts +1 -1
  221. package/dist/src/nile-icon/icons/svg/doublearrowright.js +1 -1
  222. package/dist/src/nile-icon/icons/svg/doublearrowright.js.map +1 -1
  223. package/dist/src/nile-icon/icons/svg/drag.d.ts +1 -1
  224. package/dist/src/nile-icon/icons/svg/drag.js +1 -1
  225. package/dist/src/nile-icon/icons/svg/drag.js.map +1 -1
  226. package/dist/src/nile-icon/icons/svg/expand-06.d.ts +1 -1
  227. package/dist/src/nile-icon/icons/svg/expand-06.js +1 -1
  228. package/dist/src/nile-icon/icons/svg/expand-06.js.map +1 -1
  229. package/dist/src/nile-icon/icons/svg/expand.d.ts +1 -1
  230. package/dist/src/nile-icon/icons/svg/expand.js +1 -1
  231. package/dist/src/nile-icon/icons/svg/expand.js.map +1 -1
  232. package/dist/src/nile-icon/icons/svg/integer.d.ts +1 -1
  233. package/dist/src/nile-icon/icons/svg/integer.js +1 -1
  234. package/dist/src/nile-icon/icons/svg/integer.js.map +1 -1
  235. package/dist/src/nile-icon/icons/svg/pluscircle.d.ts +1 -1
  236. package/dist/src/nile-icon/icons/svg/pluscircle.js +1 -1
  237. package/dist/src/nile-icon/icons/svg/pluscircle.js.map +1 -1
  238. package/dist/src/nile-icon/icons/svg/question.d.ts +1 -1
  239. package/dist/src/nile-icon/icons/svg/question.js +1 -1
  240. package/dist/src/nile-icon/icons/svg/question.js.map +1 -1
  241. package/dist/src/nile-icon/icons/svg/resource.d.ts +1 -1
  242. package/dist/src/nile-icon/icons/svg/resource.js +1 -1
  243. package/dist/src/nile-icon/icons/svg/resource.js.map +1 -1
  244. package/dist/src/nile-icon/icons/svg/sendescalation.d.ts +1 -1
  245. package/dist/src/nile-icon/icons/svg/sendescalation.js +1 -1
  246. package/dist/src/nile-icon/icons/svg/sendescalation.js.map +1 -1
  247. package/dist/src/nile-icon/icons/svg/sendreminder.d.ts +1 -1
  248. package/dist/src/nile-icon/icons/svg/sendreminder.js +1 -1
  249. package/dist/src/nile-icon/icons/svg/sendreminder.js.map +1 -1
  250. package/dist/src/nile-icon/icons/svg/timezone.d.ts +1 -1
  251. package/dist/src/nile-icon/icons/svg/timezone.js +1 -1
  252. package/dist/src/nile-icon/icons/svg/timezone.js.map +1 -1
  253. package/dist/src/nile-icon/icons/svg/unmute.d.ts +1 -1
  254. package/dist/src/nile-icon/icons/svg/unmute.js +1 -1
  255. package/dist/src/nile-icon/icons/svg/unmute.js.map +1 -1
  256. package/dist/src/nile-icon/icons/svg/upgrade.d.ts +1 -1
  257. package/dist/src/nile-icon/icons/svg/upgrade.js +1 -1
  258. package/dist/src/nile-icon/icons/svg/upgrade.js.map +1 -1
  259. package/dist/src/nile-option/nile-option.css.js +1 -1
  260. package/dist/src/nile-option/nile-option.css.js.map +1 -1
  261. package/dist/src/nile-option/nile-option.d.ts +6 -4
  262. package/dist/src/nile-option/nile-option.js +20 -14
  263. package/dist/src/nile-option/nile-option.js.map +1 -1
  264. package/dist/src/nile-select/nile-select.d.ts +10 -5
  265. package/dist/src/nile-select/nile-select.js +38 -29
  266. package/dist/src/nile-select/nile-select.js.map +1 -1
  267. package/dist/src/nile-select/virtual-scroll-helper.d.ts +9 -0
  268. package/dist/src/nile-select/virtual-scroll-helper.js +51 -0
  269. package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -0
  270. package/dist/src/nile-virtual-select/index.d.ts +1 -0
  271. package/dist/src/nile-virtual-select/index.js +2 -0
  272. package/dist/src/nile-virtual-select/index.js.map +1 -0
  273. package/dist/src/nile-virtual-select/nile-virtual-select.css.d.ts +12 -0
  274. package/dist/src/nile-virtual-select/nile-virtual-select.css.js +480 -0
  275. package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -0
  276. package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +251 -0
  277. package/dist/src/nile-virtual-select/nile-virtual-select.js +1158 -0
  278. package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -0
  279. package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +7 -0
  280. package/dist/src/nile-virtual-select/nile-virtual-select.test.js +317 -0
  281. package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -0
  282. package/dist/src/nile-virtual-select/renderer.d.ts +11 -0
  283. package/dist/src/nile-virtual-select/renderer.js +48 -0
  284. package/dist/src/nile-virtual-select/renderer.js.map +1 -0
  285. package/dist/src/nile-virtual-select/search-manager.d.ts +12 -0
  286. package/dist/src/nile-virtual-select/search-manager.js +39 -0
  287. package/dist/src/nile-virtual-select/search-manager.js.map +1 -0
  288. package/dist/src/nile-virtual-select/selection-manager.d.ts +12 -0
  289. package/dist/src/nile-virtual-select/selection-manager.js +57 -0
  290. package/dist/src/nile-virtual-select/selection-manager.js.map +1 -0
  291. package/dist/src/nile-virtual-select/types.d.ts +45 -0
  292. package/dist/src/nile-virtual-select/types.js +8 -0
  293. package/dist/src/nile-virtual-select/types.js.map +1 -0
  294. package/dist/tsconfig.tsbuildinfo +1 -1
  295. package/dist/virtualize-a4a40d96.esm.js +22 -0
  296. package/dist/virtualize-b6a2fbe0.cjs.js +18 -0
  297. package/dist/virtualize-b6a2fbe0.cjs.js.map +1 -0
  298. package/package.json +1 -2
  299. package/src/index.ts +3 -1
  300. package/src/internal/form.ts +2 -2
  301. package/src/nile-icon/icons/svg/agent.ts +1 -1
  302. package/src/nile-icon/icons/svg/api.ts +1 -1
  303. package/src/nile-icon/icons/svg/apply-filter.ts +1 -1
  304. package/src/nile-icon/icons/svg/arrowdropdown.ts +1 -1
  305. package/src/nile-icon/icons/svg/arrowdropup.ts +1 -1
  306. package/src/nile-icon/icons/svg/database.ts +1 -1
  307. package/src/nile-icon/icons/svg/done.ts +1 -1
  308. package/src/nile-icon/icons/svg/dontmap.ts +1 -1
  309. package/src/nile-icon/icons/svg/doublearrowleft.ts +1 -1
  310. package/src/nile-icon/icons/svg/doublearrowright.ts +1 -1
  311. package/src/nile-icon/icons/svg/drag.ts +1 -1
  312. package/src/nile-icon/icons/svg/expand-06.ts +1 -1
  313. package/src/nile-icon/icons/svg/expand.ts +1 -1
  314. package/src/nile-icon/icons/svg/integer.ts +1 -1
  315. package/src/nile-icon/icons/svg/pluscircle.ts +1 -1
  316. package/src/nile-icon/icons/svg/question.ts +1 -1
  317. package/src/nile-icon/icons/svg/resource.ts +1 -1
  318. package/src/nile-icon/icons/svg/sendescalation.ts +1 -1
  319. package/src/nile-icon/icons/svg/sendreminder.ts +1 -1
  320. package/src/nile-icon/icons/svg/timezone.ts +1 -1
  321. package/src/nile-icon/icons/svg/unmute.ts +1 -1
  322. package/src/nile-icon/icons/svg/upgrade.ts +1 -1
  323. package/src/nile-option/nile-option.css.ts +1 -1
  324. package/src/nile-option/nile-option.ts +16 -10
  325. package/src/nile-select/nile-select.ts +34 -23
  326. package/src/nile-select/virtual-scroll-helper.ts +56 -0
  327. package/src/nile-virtual-select/index.ts +1 -0
  328. package/src/nile-virtual-select/nile-virtual-select.css.ts +482 -0
  329. package/src/nile-virtual-select/nile-virtual-select.test.ts +390 -0
  330. package/src/nile-virtual-select/nile-virtual-select.ts +1234 -0
  331. package/src/nile-virtual-select/renderer.ts +65 -0
  332. package/src/nile-virtual-select/search-manager.ts +48 -0
  333. package/src/nile-virtual-select/selection-manager.ts +64 -0
  334. package/src/nile-virtual-select/types.ts +48 -0
  335. package/vscode-html-custom-data.json +228 -6
  336. package/publish.sh +0 -62
@@ -0,0 +1,1158 @@
1
+ /**
2
+ * Copyright Aquera Inc 2025
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { __decorate } from "tslib";
8
+ import { html, } from 'lit';
9
+ import { customElement, property } from 'lit/decorators.js';
10
+ import { styles } from './nile-virtual-select.css';
11
+ import '../nile-icon';
12
+ import '../nile-popup/nile-popup';
13
+ import '../nile-tag/nile-tag';
14
+ import '../nile-checkbox/nile-checkbox';
15
+ import { animateTo, stopAnimations } from '../internal/animate';
16
+ import { classMap } from 'lit/directives/class-map.js';
17
+ import { query, state } from 'lit/decorators.js';
18
+ import { defaultValue } from '../internal/default-value';
19
+ import { FormControlController } from '../internal/form';
20
+ import { getAnimation, setDefaultAnimation, } from '../utilities/animation-registry';
21
+ import { HasSlotController } from '../internal/slot';
22
+ import { waitForEvent } from '../internal/event';
23
+ import { watch } from '../internal/watch';
24
+ import NileElement from '../internal/nile-element';
25
+ import { ifDefined } from 'lit/directives/if-defined.js';
26
+ import { VirtualSelectSelectionManager } from './selection-manager.js';
27
+ import { VirtualSelectSearchManager } from './search-manager.js';
28
+ import { VirtualSelectRenderer } from './renderer.js';
29
+ /**
30
+ * Nile Virtual Select component.
31
+ *
32
+ * @tag nile-virtual-select
33
+ *
34
+ */
35
+ /**
36
+ * @summary Virtual select component for handling large datasets with virtual scrolling.
37
+ * @status stable
38
+ * @since 2.0
39
+ *
40
+ * @dependency nile-icon
41
+ * @dependency nile-popup
42
+ * @dependency nile-tag
43
+ * @dependency nile-checkbox
44
+ *
45
+ * @slot label - The input's label. Alternatively, you can use the `label` attribute.
46
+ * @slot prefix - Used to prepend a presentational icon or similar element to the combobox.
47
+ * @slot clear-icon - An icon to use in lieu of the default clear icon.
48
+ * @slot expand-icon - The icon to show when the control is expanded and collapsed.
49
+ * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.
50
+ *
51
+ * @event nile-change - Emitted when the control's value changes.
52
+ * @event nile-clear - Emitted when the control's value is cleared.
53
+ * @event nile-input - Emitted when the control receives input.
54
+ * @event nile-focus - Emitted when the control gains focus.
55
+ * @event nile-blur - Emitted when the control loses focus.
56
+ * @event nile-show - Emitted when the select's menu opens.
57
+ * @event nile-after-show - Emitted after the select's menu opens and all animations are complete.
58
+ * @event nile-hide - Emitted when the select's menu closes.
59
+ * @event nile-after-hide - Emitted after the select's menu closes and all animations are complete.
60
+ * @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.
61
+ *
62
+ * @csspart form-control - The form control that wraps the label, input, and help text.
63
+ * @csspart form-control-label - The label's wrapper.
64
+ * @csspart form-control-input - The select's wrapper.
65
+ * @csspart form-control-help-text - The help text's wrapper.
66
+ * @csspart combobox - The container the wraps the prefix, combobox, clear icon, and expand button.
67
+ * @csspart prefix - The container that wraps the prefix slot.
68
+ * @csspart display-input - The element that displays the selected option's label, an `<input>` element.
69
+ * @csspart listbox - The listbox container where options are slotted.
70
+ * @csspart tags - The container that houses option tags when `multiple` is used.
71
+ * @csspart tag - The individual tags that represent each multiselect option.
72
+ * @csspart clear-button - The clear button.
73
+ * @csspart expand-icon - The container that wraps the expand icon.
74
+ * @csspart footer - The footer container with show selected and clear all options.
75
+ */
76
+ let NileVirtualSelect = class NileVirtualSelect extends NileElement {
77
+ constructor() {
78
+ super(...arguments);
79
+ this.formControlController = new FormControlController(this, {
80
+ assumeInteractionOn: ['nile-blur', 'nile-input'],
81
+ });
82
+ this.hasSlotController = new HasSlotController(this, 'help-text', 'label');
83
+ this.hasFocus = false;
84
+ this.displayLabel = '';
85
+ this.selectedOptions = [];
86
+ this.oldValue = '';
87
+ /** The name of the select, submitted as a name/value pair with form data. */
88
+ this.name = '';
89
+ /** Array of all option items for virtual scrolling */
90
+ this.data = [];
91
+ /** Original unfiltered option items for search functionality */
92
+ this.originalOptionItems = [];
93
+ /**
94
+ * The current value of the select. When `multiple` is enabled, the value will be an array of selected values.
95
+ */
96
+ this.value = '';
97
+ /** The default value of the form control. Primarily used for resetting the form control. */
98
+ this.defaultValue = '';
99
+ /** The select's size. */
100
+ this.size = 'medium';
101
+ /** Placeholder text to show as a hint when the select is empty. */
102
+ this.placeholder = 'Select...';
103
+ /** Current search value */
104
+ this.searchValue = '';
105
+ /** Enable search functionality */
106
+ this.searchEnabled = false;
107
+ /** Search input placeholder */
108
+ this.internalSearchPlaceHolder = 'Search...';
109
+ /** Disable local search filtering */
110
+ this.disableLocalSearch = false;
111
+ /** Show loading state */
112
+ this.optionsLoading = false;
113
+ /** Allows more than one option to be selected. */
114
+ this.multiple = false;
115
+ /** Help text */
116
+ this.helpText = '';
117
+ /** Error message */
118
+ this.errorMessage = '';
119
+ /** Sets the input to a warning state */
120
+ this.warning = false;
121
+ /** Sets the input to an error state */
122
+ this.error = false;
123
+ /** Sets the input to a success state */
124
+ this.success = false;
125
+ /** Disables the select control. */
126
+ this.disabled = false;
127
+ /** Adds a clear button when the select is not empty. */
128
+ this.clearable = false;
129
+ /** The select's open state. */
130
+ this.open = false;
131
+ /**
132
+ * Enable this option to prevent the listbox from being clipped when the component is placed inside a container with
133
+ * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.
134
+ */
135
+ this.hoist = false;
136
+ /** Draws a filled select. */
137
+ this.filled = false;
138
+ /** Draws a pill-style select with rounded edges. */
139
+ this.pill = false;
140
+ /** The select's label. If you need to display HTML, use the `label` slot instead. */
141
+ this.label = '';
142
+ /**
143
+ * The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox
144
+ * inside of the viewport.
145
+ */
146
+ this.placement = 'bottom';
147
+ /**
148
+ * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you
149
+ * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in
150
+ * the same document or shadow root for this to work.
151
+ */
152
+ this.form = '';
153
+ /** The select's required attribute. */
154
+ this.required = false;
155
+ /** Show no results message */
156
+ this.showNoResults = false;
157
+ /** No results message */
158
+ this.noResultsMessage = 'No results found';
159
+ /** Show selected options only */
160
+ this.showSelected = false;
161
+ /** Function to render item value from data object */
162
+ this.renderItemFunction = (item) => item?.label || item?.name || item;
163
+ /** Block value change events */
164
+ this.blockValueChange = false;
165
+ /** Disable width synchronization */
166
+ this.noWidthSync = false;
167
+ /**
168
+ * The maximum number of selected options to show when `multiple` is true. After the maximum, "+n" will be shown to
169
+ * indicate the number of additional items that are selected. Set to 0 to remove the limit.
170
+ */
171
+ this.maxOptionsVisible = 3;
172
+ this.oldMaxOptionsVisible = 1;
173
+ this.handleDocumentMouseDown = (event) => {
174
+ if (!this.open)
175
+ return;
176
+ const path = event.composedPath();
177
+ const hitSelf = path.includes(this);
178
+ const hitPopup = this.popup && path.includes(this.popup);
179
+ if (!hitSelf && !hitPopup) {
180
+ this.hide();
181
+ }
182
+ };
183
+ }
184
+ /** Gets the validity state object */
185
+ get validity() {
186
+ return this.valueInput?.validity;
187
+ }
188
+ /** Gets the validation message */
189
+ get validationMessage() {
190
+ return this.valueInput?.validationMessage ?? '';
191
+ }
192
+ connectedCallback() {
193
+ super.connectedCallback();
194
+ this.initializeComponent();
195
+ this.setupEventListeners();
196
+ this.updateComplete.then(() => {
197
+ if (this.value && this.data.length > 0) {
198
+ this.selectionChanged();
199
+ }
200
+ });
201
+ }
202
+ disconnectedCallback() {
203
+ this.removeOpenListeners();
204
+ }
205
+ initializeComponent() {
206
+ this.renderItemFunction = (item) => item?.label || item?.name || item;
207
+ this.open = false;
208
+ this.emit('nile-init');
209
+ }
210
+ setupEventListeners() {
211
+ this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);
212
+ this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);
213
+ this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
214
+ }
215
+ addOpenListeners() {
216
+ document.addEventListener('focusin', this.handleDocumentFocusIn);
217
+ document.addEventListener('keydown', this.handleDocumentKeyDown);
218
+ document.addEventListener('mousedown', this.handleDocumentMouseDown);
219
+ }
220
+ removeOpenListeners() {
221
+ document.removeEventListener('focusin', this.handleDocumentFocusIn);
222
+ document.removeEventListener('keydown', this.handleDocumentKeyDown);
223
+ document.removeEventListener('mousedown', this.handleDocumentMouseDown);
224
+ }
225
+ handleFocus() {
226
+ this.hasFocus = true;
227
+ this.emit('nile-focus');
228
+ }
229
+ handleBlur() {
230
+ this.hasFocus = false;
231
+ this.emit('nile-blur');
232
+ }
233
+ handleDocumentFocusIn(event) {
234
+ if (!this.open)
235
+ return;
236
+ const path = event.composedPath();
237
+ const hitSelf = path.includes(this);
238
+ const hitPopup = this.popup && path.includes(this.popup);
239
+ if (!hitSelf && !hitPopup) {
240
+ this.hide();
241
+ }
242
+ }
243
+ handleDocumentKeyDown(event) {
244
+ if (this.shouldIgnoreKeyPress(event)) {
245
+ return;
246
+ }
247
+ if (this.isEscapeKey(event)) {
248
+ this.handleEscapeKey(event);
249
+ }
250
+ if (this.isEnterOrSpaceKey(event)) {
251
+ this.handleEnterOrSpaceKey(event);
252
+ }
253
+ }
254
+ shouldIgnoreKeyPress(event) {
255
+ const target = event.target;
256
+ const isClearButton = target.closest('.select__clear') !== null;
257
+ const isIconButton = target.closest('nile-icon-button') !== null;
258
+ return isClearButton || isIconButton;
259
+ }
260
+ isEscapeKey(event) {
261
+ return event.key === 'Escape' && this.open;
262
+ }
263
+ handleEscapeKey(event) {
264
+ event.preventDefault();
265
+ event.stopPropagation();
266
+ this.hide();
267
+ this.displayInput.focus({ preventScroll: true });
268
+ }
269
+ isEnterOrSpaceKey(event) {
270
+ return event.key === 'Enter' || event.key === ' ';
271
+ }
272
+ handleEnterOrSpaceKey(event) {
273
+ event.preventDefault();
274
+ event.stopImmediatePropagation();
275
+ if (!this.open) {
276
+ this.show();
277
+ return;
278
+ }
279
+ if (!this.multiple) {
280
+ this.hide();
281
+ this.displayInput.focus({ preventScroll: true });
282
+ }
283
+ }
284
+ handleFooterClick(event) {
285
+ event.stopPropagation();
286
+ event.preventDefault();
287
+ }
288
+ toggleShowSelected(event) {
289
+ event.stopPropagation();
290
+ event.preventDefault();
291
+ if (this.selectedOptions?.length === 0) {
292
+ return;
293
+ }
294
+ this.showSelected = !this.showSelected;
295
+ if (this.showSelected) {
296
+ const selectedValues = Array.isArray(this.value) ? this.value : [this.value];
297
+ this.data = this.originalOptionItems.filter((item) => selectedValues.includes(item.value));
298
+ }
299
+ else {
300
+ this.data = [...this.originalOptionItems];
301
+ }
302
+ this.requestUpdate();
303
+ }
304
+ unSelectAll() {
305
+ this.showSelected = false;
306
+ this.value = this.multiple ? [] : '';
307
+ this.data = [...this.originalOptionItems];
308
+ this.selectionChanged();
309
+ this.emit('nile-change', { value: this.value, name: this.name });
310
+ this.emit('nile-clear', { value: this.multiple ? this.value : '', name: this.name });
311
+ }
312
+ handleLabelClick() {
313
+ this.displayInput.focus();
314
+ this.hide();
315
+ }
316
+ handleComboboxMouseDown(event) {
317
+ if (this.shouldIgnoreComboboxClick(event)) {
318
+ return;
319
+ }
320
+ event.preventDefault();
321
+ this.displayInput.focus({ preventScroll: true });
322
+ this.open = !this.open;
323
+ }
324
+ shouldIgnoreComboboxClick(event) {
325
+ const path = event.composedPath();
326
+ const isIconButton = path.some(el => el instanceof Element && el.tagName.toLowerCase() === 'nile-icon-button');
327
+ return this.disabled || isIconButton;
328
+ }
329
+ handleComboboxKeyDown(event) {
330
+ if (this.isEnterOrSpaceKey(event)) {
331
+ event.preventDefault();
332
+ this.open = !this.open;
333
+ }
334
+ }
335
+ handleClearClick(event) {
336
+ event.stopPropagation();
337
+ this.clearSelection();
338
+ }
339
+ clearSelection() {
340
+ const oldValue = this.value;
341
+ this.value = this.multiple ? [] : '';
342
+ this.selectionChanged();
343
+ this.updateComplete.then(() => {
344
+ this.nileInput({ value: this.value, name: this.name });
345
+ this.nileChange({ value: this.value, name: this.name });
346
+ this.emit('nile-clear');
347
+ });
348
+ }
349
+ handleClearMouseDown(event) {
350
+ event.stopPropagation();
351
+ }
352
+ handleOptionClick(event) {
353
+ const target = event.target;
354
+ const option = target.closest('nile-option');
355
+ if (this.shouldBlockValueChange(option)) {
356
+ return;
357
+ }
358
+ const oldValue = this.value;
359
+ this.oldValue = oldValue;
360
+ if (option && !option.disabled) {
361
+ this.handleOptionSelection(option);
362
+ }
363
+ }
364
+ shouldBlockValueChange(option) {
365
+ if (this.blockValueChange && option) {
366
+ this.emit('nile-block-change', { value: option?.value, name: this.name });
367
+ this.hide();
368
+ return true;
369
+ }
370
+ return false;
371
+ }
372
+ handleOptionSelection(option) {
373
+ const optionValue = option.value;
374
+ if (this.multiple) {
375
+ this.toggleOptionSelection(optionValue);
376
+ }
377
+ else {
378
+ this.setSelectedOptions(optionValue);
379
+ }
380
+ this.updateComplete.then(() => this.displayInput.focus({ preventScroll: true }));
381
+ if (this.value !== this.oldValue) {
382
+ this.updateComplete.then(() => {
383
+ this.nileInput({ value: this.value, name: this.name });
384
+ this.nileChange({ value: this.value, name: this.name });
385
+ });
386
+ }
387
+ if (!this.multiple) {
388
+ this.hide();
389
+ this.displayInput.focus({ preventScroll: true });
390
+ }
391
+ }
392
+ setSelectedOptions(optionValue) {
393
+ this.value = optionValue;
394
+ this.selectionChanged();
395
+ }
396
+ toggleOptionSelection(optionValue) {
397
+ const currentValues = Array.isArray(this.value) ? this.value : [];
398
+ if (currentValues.includes(optionValue)) {
399
+ this.value = currentValues.filter(v => v !== optionValue);
400
+ }
401
+ else {
402
+ this.value = [...currentValues, optionValue];
403
+ }
404
+ this.selectionChanged();
405
+ }
406
+ handleTagRemove(event, option) {
407
+ event.stopPropagation();
408
+ if (!this.disabled) {
409
+ this.removeTagFromSelection(option);
410
+ this.emitTagRemovalEvent(option);
411
+ }
412
+ }
413
+ removeTagFromSelection(option) {
414
+ let currentValue = this.value;
415
+ if (!Array.isArray(currentValue)) {
416
+ currentValue = currentValue ? [currentValue] : [];
417
+ }
418
+ const newValue = currentValue.filter((v) => v !== option.value);
419
+ this.value = newValue;
420
+ this.selectionChanged();
421
+ }
422
+ emitTagRemovalEvent(option) {
423
+ this.updateComplete.then(() => {
424
+ this.nileInput({ value: this.value, name: this.name });
425
+ this.nileChange({ value: this.value, name: this.name });
426
+ this.emit('nile-tag-remove', { value: this.value, name: this.name, removedtagvalue: option.value });
427
+ });
428
+ }
429
+ selectionChanged() {
430
+ const itemsToSearch = this.originalOptionItems.length > 0 ? this.originalOptionItems : this.data;
431
+ this.selectedOptions = VirtualSelectSelectionManager.createVirtualOptionsFromValues(this.value, itemsToSearch, this.renderItemFunction);
432
+ if (this.multiple) {
433
+ if (this.placeholder && this.value.length === 0) {
434
+ this.displayLabel = '';
435
+ }
436
+ else {
437
+ this.displayLabel = this.selectedOptions.length + ' selected';
438
+ }
439
+ }
440
+ else {
441
+ const currentValue = Array.isArray(this.value) ? this.value[0] : this.value;
442
+ const label = this.selectedOptions[0]?.getTextLabel();
443
+ this.displayLabel = label ? label : currentValue ?? '';
444
+ }
445
+ this.updateValidity();
446
+ if (this.selectedOptions.length === 0) {
447
+ this.showSelected = false;
448
+ }
449
+ this.calculateTotalWidthOfTags();
450
+ }
451
+ handleSearchFocus() {
452
+ document.removeEventListener('keydown', this.handleDocumentKeyDown);
453
+ }
454
+ handleSearchBlur() {
455
+ document.addEventListener('keydown', this.handleDocumentKeyDown);
456
+ }
457
+ handleSearchChange(e) {
458
+ this.searchValue = e.detail.value;
459
+ if (!this.disableLocalSearch) {
460
+ this.filterVirtualOptions(this.searchValue);
461
+ }
462
+ }
463
+ filterVirtualOptions(searchValue) {
464
+ const result = VirtualSelectSearchManager.filterVirtualOptions(searchValue, this.originalOptionItems, this.data, this.renderItemFunction);
465
+ this.data = result.filteredItems;
466
+ this.showNoResults = result.showNoResults;
467
+ this.requestUpdate();
468
+ }
469
+ handleInvalid(event) {
470
+ this.formControlController.setValidity(false);
471
+ this.formControlController.emitInvalidEvent(event);
472
+ }
473
+ handleDisabledChange() {
474
+ if (this.disabled) {
475
+ this.open = false;
476
+ this.handleOpenChange();
477
+ }
478
+ }
479
+ handleValueChange() {
480
+ this.selectionChanged();
481
+ this.requestUpdate();
482
+ }
483
+ handleDataChange() {
484
+ this.selectionChanged();
485
+ this.requestUpdate();
486
+ }
487
+ handleRenderItemFunctionChange() {
488
+ if (this.value && this.data.length > 0) {
489
+ this.selectionChanged();
490
+ this.requestUpdate();
491
+ }
492
+ }
493
+ async handleOpenChange() {
494
+ if (this.open && !this.disabled) {
495
+ await this.handleOpen();
496
+ }
497
+ else {
498
+ await this.handleClose();
499
+ }
500
+ }
501
+ async handleOpen() {
502
+ this.emit('nile-show', { value: this.value, name: this.name });
503
+ this.addOpenListeners();
504
+ this.showNoResults = !this.data?.length;
505
+ await stopAnimations(this);
506
+ this.popup.active = true;
507
+ const { keyframes, options } = getAnimation(this, 'select.show', {
508
+ dir: 'ltr',
509
+ });
510
+ await animateTo(this.popup.popup, keyframes, options);
511
+ this.initializeOriginalItems();
512
+ this.filterVirtualOptions(this.searchValue);
513
+ this.emit('nile-after-show', { value: this.value, name: this.name });
514
+ }
515
+ async handleClose() {
516
+ this.emit('nile-hide', { value: this.value, name: this.name });
517
+ this.removeOpenListeners();
518
+ await stopAnimations(this);
519
+ const { keyframes, options } = getAnimation(this, 'select.hide', {
520
+ dir: 'ltr',
521
+ });
522
+ await animateTo(this.popup.popup, keyframes, options);
523
+ this.popup.active = false;
524
+ this.searchValue = '';
525
+ this.emit('nile-after-hide', { value: this.value, name: this.name });
526
+ }
527
+ initializeOriginalItems() {
528
+ if (this.originalOptionItems.length === 0 && this.data.length > 0) {
529
+ this.originalOptionItems = [...this.data];
530
+ }
531
+ }
532
+ async show() {
533
+ if (this.open || this.disabled) {
534
+ this.open = false;
535
+ return undefined;
536
+ }
537
+ this.open = true;
538
+ return waitForEvent(this, 'nile-after-show');
539
+ }
540
+ async hide() {
541
+ if (!this.open || this.disabled) {
542
+ this.open = false;
543
+ return undefined;
544
+ }
545
+ this.open = false;
546
+ return waitForEvent(this, 'nile-after-hide');
547
+ }
548
+ checkValidity() {
549
+ return this.valueInput.checkValidity();
550
+ }
551
+ getForm() {
552
+ return this.formControlController.getForm();
553
+ }
554
+ reportValidity() {
555
+ return this.valueInput.reportValidity();
556
+ }
557
+ setCustomValidity(message) {
558
+ this.valueInput.setCustomValidity(message);
559
+ this.formControlController.updateValidity();
560
+ }
561
+ focus(options) {
562
+ this.displayInput.focus(options);
563
+ }
564
+ blur() {
565
+ this.displayInput.blur();
566
+ }
567
+ onInputChange(event) {
568
+ event.stopPropagation();
569
+ }
570
+ render() {
571
+ const hasLabelSlot = this.hasSlotController.test('label');
572
+ const hasHelpTextSlot = this.hasSlotController.test('help-text');
573
+ const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');
574
+ const hasCustomSelect = this.hasSlotController.test('custom-select');
575
+ const hasLabel = this.label ? true : !!hasLabelSlot;
576
+ const hasClearIcon = this.clearable && !this.disabled && this.value.length > 0;
577
+ const isPlaceholderVisible = !!this.placeholder && this.value.length === 0;
578
+ const hasHelpText = !!this.helpText;
579
+ const hasErrorMessage = !!this.errorMessage;
580
+ return html `
581
+ <div
582
+ part="form-control"
583
+ class=${classMap({
584
+ 'form-control': true,
585
+ 'form-control--small': this.size === 'small',
586
+ 'form-control--medium': this.size === 'medium',
587
+ 'form-control--large': this.size === 'large',
588
+ 'form-control--has-label': hasLabel,
589
+ 'form-control--has-help-text': hasHelpText,
590
+ })}
591
+ >
592
+ ${this.renderLabel(hasLabel, hasLabelSuffixSlot)}
593
+ ${this.renderFormControlInput(hasCustomSelect, hasClearIcon, isPlaceholderVisible, hasHelpText, hasErrorMessage)}
594
+ </div>
595
+ `;
596
+ }
597
+ renderLabel(hasLabel, hasLabelSuffixSlot) {
598
+ return html `
599
+ <label
600
+ id="label"
601
+ part="form-control-label"
602
+ class="form-control__label"
603
+ aria-hidden=${hasLabel ? 'false' : 'true'}
604
+ @click=${this.handleLabelClick}
605
+ >
606
+ <slot name="label">${this.label}</slot>
607
+ </label>
608
+
609
+ ${hasLabelSuffixSlot ? html ` <slot name="label-suffix"></slot> ` : ``}
610
+ `;
611
+ }
612
+ renderFormControlInput(hasCustomSelect, hasClearIcon, isPlaceholderVisible, hasHelpText, hasErrorMessage) {
613
+ return html `
614
+ <div part="form-control-input" class="form-control-input">
615
+ ${this.renderPopup(hasCustomSelect, hasClearIcon, isPlaceholderVisible)}
616
+ ${this.renderHelpText(hasHelpText, hasErrorMessage)}
617
+ </div>
618
+ `;
619
+ }
620
+ renderPopup(hasCustomSelect, hasClearIcon, isPlaceholderVisible) {
621
+ return html `
622
+ <nile-popup
623
+ class=${classMap({
624
+ select: true,
625
+ 'select--warning': this.warning,
626
+ 'select--error': this.error,
627
+ 'select--success': this.success,
628
+ 'select--standard': true,
629
+ 'select--filled': this.filled,
630
+ 'select--pill': this.pill,
631
+ 'select--open': this.open,
632
+ 'select--disabled': this.disabled,
633
+ 'select--multiple': this.multiple,
634
+ 'select--focused': this.hasFocus,
635
+ 'select--placeholder-visible': isPlaceholderVisible,
636
+ 'select--top': this.placement === 'top',
637
+ 'select--bottom': this.placement === 'bottom',
638
+ 'select--small': this.size === 'small',
639
+ 'select--medium': this.size === 'medium',
640
+ 'select--large': this.size === 'large',
641
+ })}
642
+ placement=${this.placement}
643
+ strategy=${this.hoist ? 'fixed' : 'absolute'}
644
+ distance="6"
645
+ flip
646
+ shift
647
+ sync=${ifDefined(!this.noWidthSync ? 'width' : undefined)}
648
+ auto-size="vertical"
649
+ auto-size-padding="10"
650
+ >
651
+ ${this.renderCustomSelect(hasCustomSelect)}
652
+ ${this.renderCombobox(hasCustomSelect, hasClearIcon)}
653
+ ${this.renderListbox()}
654
+ </nile-popup>
655
+ `;
656
+ }
657
+ renderCustomSelect(hasCustomSelect) {
658
+ return hasCustomSelect
659
+ ? html `<slot
660
+ slot="anchor"
661
+ name="custom-select"
662
+ class="custom-select"
663
+ @keydown=${this.handleComboboxKeyDown}
664
+ @mousedown=${this.handleComboboxMouseDown}
665
+ ></slot>`
666
+ : html ``;
667
+ }
668
+ renderCombobox(hasCustomSelect, hasClearIcon) {
669
+ return html `
670
+ <div
671
+ part="combobox"
672
+ class=${classMap({
673
+ select__combobox: true,
674
+ 'select__hide-default': hasCustomSelect,
675
+ })}
676
+ slot="anchor"
677
+ @keydown=${this.handleComboboxKeyDown}
678
+ @mousedown=${this.handleComboboxMouseDown}
679
+ >
680
+ ${this.renderPrefix()}
681
+ ${this.renderDisplayInput()}
682
+ ${this.renderTags()}
683
+ ${this.renderValueInput()}
684
+ ${this.renderClearButton(hasClearIcon)}
685
+ ${this.renderSuffix()}
686
+ ${this.renderExpandIcon()}
687
+ </div>
688
+ `;
689
+ }
690
+ renderPrefix() {
691
+ return html `
692
+ <slot
693
+ part="prefix"
694
+ name="prefix"
695
+ class=${classMap({
696
+ select__prefix: true,
697
+ multiple: this.multiple,
698
+ })}
699
+ ></slot>
700
+ `;
701
+ }
702
+ renderDisplayInput() {
703
+ return html `
704
+ <input
705
+ part="display-input"
706
+ class="select__display-input"
707
+ type="text"
708
+ placeholder=${this.placeholder}
709
+ .disabled=${this.disabled}
710
+ .value=${this.displayLabel}
711
+ autocomplete="off"
712
+ spellcheck="false"
713
+ autocapitalize="off"
714
+ readonly
715
+ aria-controls="listbox"
716
+ aria-expanded=${this.open ? 'true' : 'false'}
717
+ aria-haspopup="listbox"
718
+ aria-labelledby="label"
719
+ aria-disabled=${this.disabled ? 'true' : 'false'}
720
+ aria-describedby="help-text"
721
+ role="combobox"
722
+ tabindex="0"
723
+ />
724
+ `;
725
+ }
726
+ renderTags() {
727
+ return this.multiple
728
+ ? html `
729
+ <div part="tags" class="select__tags">
730
+ ${this.selectedOptions.map((option, index) => {
731
+ if (index < this.maxOptionsVisible ||
732
+ this.maxOptionsVisible <= 0) {
733
+ const classes = {
734
+ select__invisible: index + 1 > this.oldMaxOptionsVisible &&
735
+ this.maxOptionsVisible === Infinity,
736
+ };
737
+ return html `
738
+ <nile-tag
739
+ class=${classMap(classes)}
740
+ part="tag"
741
+ exportparts="
742
+ base:tag__base,
743
+ content:tag__content,
744
+ remove-button:tag__remove-button,
745
+ remove-button__base:tag__remove-button__base
746
+ "
747
+ ?pill=${this.pill}
748
+ size=${this.size}
749
+ removable
750
+ @nile-remove=${(event) => this.handleTagRemove(event, option)}
751
+ >
752
+ ${option.getTextLabel()}
753
+ </nile-tag>
754
+ `;
755
+ }
756
+ else if (index === this.maxOptionsVisible) {
757
+ return html `
758
+ <span class="select__tags-count"
759
+ >+${this.selectedOptions.length - index} More
760
+ </span>
761
+ `;
762
+ }
763
+ else {
764
+ return null;
765
+ }
766
+ })}
767
+ </div>
768
+ `
769
+ : html ``;
770
+ }
771
+ renderValueInput() {
772
+ return html `
773
+ <input
774
+ class="select__value-input"
775
+ type="text"
776
+ ?disabled=${this.disabled}
777
+ ?required=${this.required}
778
+ .value=${Array.isArray(this.value)
779
+ ? this.value.join(', ')
780
+ : this.value}
781
+ tabindex="-1"
782
+ aria-hidden="true"
783
+ @focus=${() => this.focus()}
784
+ @invalid=${this.handleInvalid}
785
+ />
786
+ `;
787
+ }
788
+ renderClearButton(hasClearIcon) {
789
+ return hasClearIcon
790
+ ? html `
791
+ <button
792
+ part="clear-button"
793
+ class="select__clear"
794
+ type="button"
795
+ aria-label="clearEntry"
796
+ @mousedown=${this.handleClearMouseDown}
797
+ @click=${this.handleClearClick}
798
+ tabindex="-1"
799
+ >
800
+ <slot name="clear-icon">
801
+ <nile-icon name="close" library="system"></nile-icon>
802
+ </slot>
803
+ </button>
804
+ `
805
+ : html ``;
806
+ }
807
+ renderSuffix() {
808
+ return html `
809
+ <slot
810
+ part="suffix"
811
+ name="suffix"
812
+ class=${classMap({
813
+ select__suffix: true,
814
+ })}
815
+ ></slot>
816
+ `;
817
+ }
818
+ renderExpandIcon() {
819
+ return html `
820
+ <slot
821
+ name="expand-icon"
822
+ part="expand-icon"
823
+ class="select__expand-icon"
824
+ >
825
+ <nile-icon library="system" name="arrowdown"></nile-icon>
826
+ </slot>
827
+ `;
828
+ }
829
+ renderListbox() {
830
+ return html `
831
+ <div
832
+ id="listbox"
833
+ role="listbox"
834
+ aria-expanded=${this.open ? 'true' : 'false'}
835
+ aria-multiselectable=${this.multiple ? 'true' : 'false'}
836
+ aria-labelledby="label"
837
+ part="listbox"
838
+ class="select__listbox ${this.searchEnabled
839
+ ? 'select__search-enabled '
840
+ : ''}"
841
+ tabindex="-1"
842
+ @mouseup=${this.handleOptionClick}
843
+ >
844
+ ${this.renderSearch()}
845
+ ${this.renderLoader()}
846
+ ${this.getVirtualizedContent()}
847
+ ${this.renderFooter()}
848
+ </div>
849
+ `;
850
+ }
851
+ renderSearch() {
852
+ return this.searchEnabled
853
+ ? html `
854
+ <div class="select__search">
855
+ <nile-input
856
+ size="small"
857
+ clearable
858
+ .value=${this.searchValue}
859
+ placeholder="${this.internalSearchPlaceHolder}"
860
+ @nile-input=${this.handleSearchChange}
861
+ @nile-focus=${this.handleSearchFocus}
862
+ @nile-change="${this.onInputChange}"
863
+ >
864
+ <nile-icon name="search" slot="suffix"> </nile-icon>
865
+ </nile-input>
866
+ </div>
867
+ `
868
+ : html ``;
869
+ }
870
+ renderLoader() {
871
+ return this.optionsLoading
872
+ ? html `
873
+ <span class="select__loader">
874
+ <nile-icon
875
+ class="select__loader--icon"
876
+ name="button-loading-blue"
877
+ ></nile-icon>
878
+ </span>
879
+ `
880
+ : html ``;
881
+ }
882
+ renderFooter() {
883
+ return this.multiple
884
+ ? html `
885
+ <div
886
+ part="footer"
887
+ class="select__footer"
888
+ @click="${this.handleFooterClick}"
889
+ >
890
+ <span
891
+ @click="${this.toggleShowSelected}"
892
+ style="cursor: pointer;"
893
+ >
894
+ <nile-checkbox
895
+ ?disabled="${this.selectedOptions.length === 0}"
896
+ ?checked="${this.showSelected}"
897
+ >
898
+ &nbsp; Show Selected</nile-checkbox
899
+ >
900
+ </span>
901
+ ${this.selectedOptions.length !== 0
902
+ ? html `
903
+ <span
904
+ class="select__clear"
905
+ @click="${this.unSelectAll}"
906
+ >
907
+ Clear All
908
+ </span>
909
+ `
910
+ : ``}
911
+ </div>
912
+ `
913
+ : html ``;
914
+ }
915
+ renderHelpText(hasHelpText, hasErrorMessage) {
916
+ return html `
917
+ ${hasHelpText
918
+ ? html ` <nile-form-help-text>${this.helpText}</nile-form-help-text> `
919
+ : ``}
920
+ ${hasErrorMessage
921
+ ? html `
922
+ <nile-form-error-message
923
+ >${this.errorMessage}</nile-form-error-message
924
+ >
925
+ `
926
+ : ``}
927
+ `;
928
+ }
929
+ getVirtualizedContent() {
930
+ return VirtualSelectRenderer.getVirtualizedContent(this.data, this.searchEnabled, this.renderItemFunction, this.value, this.multiple);
931
+ }
932
+ nileInput(value) {
933
+ this.emit('nile-input', value);
934
+ }
935
+ nileChange(value) {
936
+ this.emit('nile-change', value);
937
+ }
938
+ updateValidity() {
939
+ this.updateComplete.then(() => {
940
+ this.formControlController.updateValidity();
941
+ });
942
+ }
943
+ calculateWidthOfSelectTagsDiv() {
944
+ if (this.shadowRoot) {
945
+ const selectTagsDiv = this.shadowRoot.querySelector('.select__tags');
946
+ if (selectTagsDiv) {
947
+ const width = selectTagsDiv.offsetWidth;
948
+ return width - 70;
949
+ }
950
+ }
951
+ return null;
952
+ }
953
+ calculateTotalWidthOfTags() {
954
+ if (this.maxOptionsVisible !== Infinity) {
955
+ this.oldMaxOptionsVisible = this.maxOptionsVisible;
956
+ }
957
+ this.maxOptionsVisible = Infinity;
958
+ setTimeout(() => {
959
+ let widths = [];
960
+ if (this.shadowRoot) {
961
+ const tags = this.shadowRoot.querySelectorAll('nile-tag');
962
+ tags.forEach(tag => {
963
+ if (tag instanceof HTMLElement) {
964
+ widths.push(tag.offsetWidth);
965
+ }
966
+ });
967
+ }
968
+ if (this.value.length !== widths.length) {
969
+ return;
970
+ }
971
+ let sum = widths.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
972
+ const widthOfSelectTagsDiv = this.calculateWidthOfSelectTagsDiv();
973
+ if (!widthOfSelectTagsDiv) {
974
+ return;
975
+ }
976
+ let summ = 0;
977
+ let lastindex = 0;
978
+ for (let i = 0; i < widths.length; i++) {
979
+ summ += widths[i];
980
+ if (summ > widthOfSelectTagsDiv) {
981
+ lastindex = i;
982
+ break;
983
+ }
984
+ }
985
+ this.maxOptionsVisible = lastindex;
986
+ }, 1);
987
+ }
988
+ };
989
+ NileVirtualSelect.styles = styles;
990
+ __decorate([
991
+ query('.select')
992
+ ], NileVirtualSelect.prototype, "popup", void 0);
993
+ __decorate([
994
+ query('.select__display-input')
995
+ ], NileVirtualSelect.prototype, "displayInput", void 0);
996
+ __decorate([
997
+ query('.select__value-input')
998
+ ], NileVirtualSelect.prototype, "valueInput", void 0);
999
+ __decorate([
1000
+ state()
1001
+ ], NileVirtualSelect.prototype, "hasFocus", void 0);
1002
+ __decorate([
1003
+ state()
1004
+ ], NileVirtualSelect.prototype, "displayLabel", void 0);
1005
+ __decorate([
1006
+ state()
1007
+ ], NileVirtualSelect.prototype, "selectedOptions", void 0);
1008
+ __decorate([
1009
+ state()
1010
+ ], NileVirtualSelect.prototype, "oldValue", void 0);
1011
+ __decorate([
1012
+ property()
1013
+ ], NileVirtualSelect.prototype, "name", void 0);
1014
+ __decorate([
1015
+ property({ type: Array })
1016
+ ], NileVirtualSelect.prototype, "data", void 0);
1017
+ __decorate([
1018
+ state()
1019
+ ], NileVirtualSelect.prototype, "originalOptionItems", void 0);
1020
+ __decorate([
1021
+ property({
1022
+ converter: {
1023
+ fromAttribute: (value) => value.split(' '),
1024
+ toAttribute: (value) => value.join(' '),
1025
+ },
1026
+ })
1027
+ ], NileVirtualSelect.prototype, "value", void 0);
1028
+ __decorate([
1029
+ defaultValue()
1030
+ ], NileVirtualSelect.prototype, "defaultValue", void 0);
1031
+ __decorate([
1032
+ property()
1033
+ ], NileVirtualSelect.prototype, "size", void 0);
1034
+ __decorate([
1035
+ property()
1036
+ ], NileVirtualSelect.prototype, "placeholder", void 0);
1037
+ __decorate([
1038
+ state()
1039
+ ], NileVirtualSelect.prototype, "searchValue", void 0);
1040
+ __decorate([
1041
+ property({ type: Boolean, reflect: true })
1042
+ ], NileVirtualSelect.prototype, "searchEnabled", void 0);
1043
+ __decorate([
1044
+ property({ attribute: 'internal-search-placeholder' })
1045
+ ], NileVirtualSelect.prototype, "internalSearchPlaceHolder", void 0);
1046
+ __decorate([
1047
+ property({ type: Boolean, reflect: true })
1048
+ ], NileVirtualSelect.prototype, "disableLocalSearch", void 0);
1049
+ __decorate([
1050
+ property({ type: Boolean, reflect: true })
1051
+ ], NileVirtualSelect.prototype, "optionsLoading", void 0);
1052
+ __decorate([
1053
+ property({ type: Boolean, reflect: true })
1054
+ ], NileVirtualSelect.prototype, "multiple", void 0);
1055
+ __decorate([
1056
+ property({ attribute: 'help-text', reflect: true })
1057
+ ], NileVirtualSelect.prototype, "helpText", void 0);
1058
+ __decorate([
1059
+ property({ attribute: 'error-message', reflect: true })
1060
+ ], NileVirtualSelect.prototype, "errorMessage", void 0);
1061
+ __decorate([
1062
+ property({ type: Boolean })
1063
+ ], NileVirtualSelect.prototype, "warning", void 0);
1064
+ __decorate([
1065
+ property({ type: Boolean })
1066
+ ], NileVirtualSelect.prototype, "error", void 0);
1067
+ __decorate([
1068
+ property({ type: Boolean })
1069
+ ], NileVirtualSelect.prototype, "success", void 0);
1070
+ __decorate([
1071
+ property({ type: Boolean, reflect: true })
1072
+ ], NileVirtualSelect.prototype, "disabled", void 0);
1073
+ __decorate([
1074
+ property({ type: Boolean, reflect: true })
1075
+ ], NileVirtualSelect.prototype, "clearable", void 0);
1076
+ __decorate([
1077
+ property({ type: Boolean, reflect: true })
1078
+ ], NileVirtualSelect.prototype, "open", void 0);
1079
+ __decorate([
1080
+ property({ type: Boolean })
1081
+ ], NileVirtualSelect.prototype, "hoist", void 0);
1082
+ __decorate([
1083
+ property({ type: Boolean, reflect: true })
1084
+ ], NileVirtualSelect.prototype, "filled", void 0);
1085
+ __decorate([
1086
+ property({ type: Boolean, reflect: true })
1087
+ ], NileVirtualSelect.prototype, "pill", void 0);
1088
+ __decorate([
1089
+ property()
1090
+ ], NileVirtualSelect.prototype, "label", void 0);
1091
+ __decorate([
1092
+ property({ reflect: true })
1093
+ ], NileVirtualSelect.prototype, "placement", void 0);
1094
+ __decorate([
1095
+ property({ reflect: true })
1096
+ ], NileVirtualSelect.prototype, "form", void 0);
1097
+ __decorate([
1098
+ property({ type: Boolean, reflect: true })
1099
+ ], NileVirtualSelect.prototype, "required", void 0);
1100
+ __decorate([
1101
+ property({ type: Boolean })
1102
+ ], NileVirtualSelect.prototype, "showNoResults", void 0);
1103
+ __decorate([
1104
+ property({ type: String })
1105
+ ], NileVirtualSelect.prototype, "noResultsMessage", void 0);
1106
+ __decorate([
1107
+ property({ type: Boolean })
1108
+ ], NileVirtualSelect.prototype, "showSelected", void 0);
1109
+ __decorate([
1110
+ property({ attribute: false })
1111
+ ], NileVirtualSelect.prototype, "renderItemFunction", void 0);
1112
+ __decorate([
1113
+ property({ type: Boolean, reflect: true })
1114
+ ], NileVirtualSelect.prototype, "blockValueChange", void 0);
1115
+ __decorate([
1116
+ property({ type: Boolean, reflect: true })
1117
+ ], NileVirtualSelect.prototype, "noWidthSync", void 0);
1118
+ __decorate([
1119
+ property({ attribute: 'max-options-visible', type: Number })
1120
+ ], NileVirtualSelect.prototype, "maxOptionsVisible", void 0);
1121
+ __decorate([
1122
+ state()
1123
+ ], NileVirtualSelect.prototype, "oldMaxOptionsVisible", void 0);
1124
+ __decorate([
1125
+ watch('disabled', { waitUntilFirstUpdate: true })
1126
+ ], NileVirtualSelect.prototype, "handleDisabledChange", null);
1127
+ __decorate([
1128
+ watch('value', { waitUntilFirstUpdate: true })
1129
+ ], NileVirtualSelect.prototype, "handleValueChange", null);
1130
+ __decorate([
1131
+ watch('data', { waitUntilFirstUpdate: true })
1132
+ ], NileVirtualSelect.prototype, "handleDataChange", null);
1133
+ __decorate([
1134
+ watch('renderItemFunction', { waitUntilFirstUpdate: true })
1135
+ ], NileVirtualSelect.prototype, "handleRenderItemFunctionChange", null);
1136
+ __decorate([
1137
+ watch('open', { waitUntilFirstUpdate: true })
1138
+ ], NileVirtualSelect.prototype, "handleOpenChange", null);
1139
+ NileVirtualSelect = __decorate([
1140
+ customElement('nile-virtual-select')
1141
+ ], NileVirtualSelect);
1142
+ export { NileVirtualSelect };
1143
+ setDefaultAnimation('select.show', {
1144
+ keyframes: [
1145
+ { opacity: 0, scale: 0.9 },
1146
+ { opacity: 1, scale: 1 },
1147
+ ],
1148
+ options: { duration: 100, easing: 'ease' },
1149
+ });
1150
+ setDefaultAnimation('select.hide', {
1151
+ keyframes: [
1152
+ { opacity: 1, scale: 1 },
1153
+ { opacity: 0, scale: 0.9 },
1154
+ ],
1155
+ options: { duration: 100, easing: 'ease' },
1156
+ });
1157
+ export default NileVirtualSelect;
1158
+ //# sourceMappingURL=nile-virtual-select.js.map