@aquera/nile-elements 1.3.0-beta-1.1 → 1.3.0-beta-1.2

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 (389) hide show
  1. package/README.md +1 -0
  2. package/demo/index.html +269 -34
  3. package/dist/assets/nile-elements-4b5c262d.css +1 -0
  4. package/dist/{fixture-54600b35.cjs.js → fixture-1c49c014.cjs.js} +2 -2
  5. package/dist/{fixture-73855806.cjs.js.map → fixture-1c49c014.cjs.js.map} +1 -1
  6. package/dist/{fixture-9871e8a9.esm.js → fixture-985bba12.esm.js} +1 -1
  7. package/dist/{fixture-73855806.cjs.js → fixture-d1470b58.cjs.js} +2 -2
  8. package/dist/{fixture-54600b35.cjs.js.map → fixture-d1470b58.cjs.js.map} +1 -1
  9. package/dist/{fixture-5b79f853.cjs.js → fixture-dff65c89.cjs.js} +2 -2
  10. package/dist/{fixture-c1d78368.cjs.js.map → fixture-dff65c89.cjs.js.map} +1 -1
  11. package/dist/index.cjs.js +1 -1
  12. package/dist/index.esm.js +1 -1
  13. package/dist/index.js +280 -280
  14. package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
  15. package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
  16. package/dist/nile-auto-complete/index.cjs.js +1 -1
  17. package/dist/nile-auto-complete/index.esm.js +1 -1
  18. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  19. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  20. package/dist/nile-auto-complete/nile-auto-complete.esm.js +2 -2
  21. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
  22. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
  23. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
  24. package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
  25. package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
  26. package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
  27. package/dist/nile-badge/nile-badge.test.esm.js +1 -1
  28. package/dist/nile-button/nile-button.test.cjs.js +1 -1
  29. package/dist/nile-button/nile-button.test.esm.js +1 -1
  30. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
  31. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
  32. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  33. package/dist/nile-calendar/nile-calendar.test.cjs.js.map +1 -1
  34. package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
  35. package/dist/nile-card/nile-card.test.cjs.js +1 -1
  36. package/dist/nile-card/nile-card.test.esm.js +1 -1
  37. package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
  38. package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
  39. package/dist/nile-chip/index.cjs.js +1 -1
  40. package/dist/nile-chip/index.esm.js +1 -1
  41. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  42. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  43. package/dist/nile-chip/nile-chip.esm.js +2 -2
  44. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  45. package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
  46. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  47. package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
  48. package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
  49. package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
  50. package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
  51. package/dist/nile-dropdown/index.cjs.js +1 -1
  52. package/dist/nile-dropdown/index.esm.js +1 -1
  53. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  54. package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
  55. package/dist/nile-dropdown/nile-dropdown.esm.js +2 -2
  56. package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
  57. package/dist/nile-dropdown/nile-dropdown.test.cjs.js.map +1 -1
  58. package/dist/nile-dropdown/nile-dropdown.test.esm.js +6 -6
  59. package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
  60. package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
  61. package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
  62. package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
  63. package/dist/nile-file-preview/nile-file-preview.test.cjs.js +1 -1
  64. package/dist/nile-file-preview/nile-file-preview.test.esm.js +1 -1
  65. package/dist/nile-file-upload/nile-file-upload.test.cjs.js +1 -1
  66. package/dist/nile-file-upload/nile-file-upload.test.esm.js +1 -1
  67. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
  68. package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +1 -1
  69. package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
  70. package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
  71. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
  72. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
  73. package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
  74. package/dist/nile-hero/nile-hero.test.esm.js +1 -1
  75. package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
  76. package/dist/nile-icon/nile-icon.test.esm.js +1 -1
  77. package/dist/nile-inline-edit/index.cjs.js +1 -1
  78. package/dist/nile-inline-edit/index.esm.js +1 -1
  79. package/dist/nile-inline-edit/nile-inline-edit.cjs.js +1 -1
  80. package/dist/nile-inline-edit/nile-inline-edit.cjs.js.map +1 -1
  81. package/dist/nile-inline-edit/nile-inline-edit.esm.js +4 -4
  82. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  83. package/dist/nile-input/nile-input.test.esm.js +1 -1
  84. package/dist/nile-light-tooltip/index.esm.js +1 -0
  85. package/dist/nile-light-tooltip/nile-light-tooltip.css.esm.js +6 -0
  86. package/dist/nile-light-tooltip/nile-light-tooltip.esm.js +1 -0
  87. package/dist/nile-link/nile-link.test.cjs.js +1 -1
  88. package/dist/nile-link/nile-link.test.esm.js +1 -1
  89. package/dist/nile-lite-tooltip/index.cjs.js +1 -1
  90. package/dist/nile-lite-tooltip/index.esm.js +1 -1
  91. package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
  92. package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js.map +1 -1
  93. package/dist/nile-lite-tooltip/nile-lite-tooltip.esm.js +1 -1
  94. package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
  95. package/dist/nile-loader/nile-loader.test.esm.js +1 -1
  96. package/dist/nile-popover/index.cjs.js +1 -1
  97. package/dist/nile-popover/index.esm.js +1 -1
  98. package/dist/nile-popover/nile-popover.cjs.js +3 -3
  99. package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
  100. package/dist/nile-popover/nile-popover.esm.js +4 -4
  101. package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
  102. package/dist/nile-popover/nile-popover.test.cjs.js.map +1 -1
  103. package/dist/nile-popover/nile-popover.test.esm.js +4 -4
  104. package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
  105. package/dist/nile-popup/nile-popup.test.esm.js +1 -1
  106. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
  107. package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
  108. package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
  109. package/dist/nile-radio/nile-radio.test.esm.js +1 -1
  110. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
  111. package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
  112. package/dist/nile-select/index.cjs.js +1 -1
  113. package/dist/nile-select/index.esm.js +1 -1
  114. package/dist/nile-select/nile-select.cjs.js +1 -1
  115. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  116. package/dist/nile-select/nile-select.esm.js +2 -2
  117. package/dist/nile-select/nile-select.test.cjs.js +1 -1
  118. package/dist/nile-select/nile-select.test.cjs.js.map +1 -1
  119. package/dist/nile-select/nile-select.test.esm.js +1 -1
  120. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
  121. package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
  122. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
  123. package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
  124. package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
  125. package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
  126. package/dist/nile-tooltip/index.cjs.js +1 -1
  127. package/dist/nile-tooltip/index.esm.js +1 -1
  128. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  129. package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
  130. package/dist/nile-tooltip/nile-tooltip.esm.js +2 -2
  131. package/dist/nile-virtual-select/index.cjs.js +1 -1
  132. package/dist/nile-virtual-select/index.esm.js +1 -1
  133. package/dist/nile-virtual-select/nile-virtual-select.cjs.js +2 -2
  134. package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -1
  135. package/dist/nile-virtual-select/nile-virtual-select.esm.js +13 -13
  136. package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +1 -1
  137. package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +1 -1
  138. package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +4 -0
  139. package/dist/src/nile-auto-complete/nile-auto-complete.js +41 -0
  140. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  141. package/dist/src/nile-chip/nile-chip.d.ts +4 -0
  142. package/dist/src/nile-chip/nile-chip.js +47 -0
  143. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  144. package/dist/src/nile-dropdown/nile-dropdown.d.ts +4 -1
  145. package/dist/src/nile-dropdown/nile-dropdown.js +38 -1
  146. package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  147. package/dist/src/nile-inline-edit/nile-inline-edit.d.ts +0 -8
  148. package/dist/src/nile-inline-edit/nile-inline-edit.js +1 -47
  149. package/dist/src/nile-inline-edit/nile-inline-edit.js.map +1 -1
  150. package/dist/src/nile-light-tooltip/index.d.ts +1 -0
  151. package/dist/src/nile-light-tooltip/index.js +2 -0
  152. package/dist/src/nile-light-tooltip/index.js.map +1 -0
  153. package/dist/src/nile-light-tooltip/nile-light-tooltip.css.d.ts +12 -0
  154. package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js +18 -0
  155. package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js.map +1 -0
  156. package/dist/src/nile-light-tooltip/nile-light-tooltip.d.ts +40 -0
  157. package/dist/src/nile-light-tooltip/nile-light-tooltip.js +101 -0
  158. package/dist/src/nile-light-tooltip/nile-light-tooltip.js.map +1 -0
  159. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.d.ts +5 -1
  160. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js +44 -0
  161. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js.map +1 -1
  162. package/dist/src/nile-menu/virtual-menu-search-manager.d.ts +11 -0
  163. package/dist/src/nile-menu/virtual-menu-search-manager.js +43 -0
  164. package/dist/src/nile-menu/virtual-menu-search-manager.js.map +1 -0
  165. package/dist/src/nile-popover/nile-popover.d.ts +4 -0
  166. package/dist/src/nile-popover/nile-popover.js +40 -0
  167. package/dist/src/nile-popover/nile-popover.js.map +1 -1
  168. package/dist/src/nile-select/nile-select.d.ts +1 -5
  169. package/dist/src/nile-select/nile-select.js +28 -67
  170. package/dist/src/nile-select/nile-select.js.map +1 -1
  171. package/dist/src/nile-tooltip/nile-tooltip.d.ts +3 -0
  172. package/dist/src/nile-tooltip/nile-tooltip.js +38 -0
  173. package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  174. package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +2 -5
  175. package/dist/src/nile-virtual-select/nile-virtual-select.js +29 -66
  176. package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
  177. package/dist/src/utilities/visibility-manager.d.ts +20 -0
  178. package/dist/src/utilities/visibility-manager.js +64 -0
  179. package/dist/src/utilities/visibility-manager.js.map +1 -0
  180. package/dist/src/version.js +1 -1
  181. package/dist/src/version.js.map +1 -1
  182. package/dist/tsconfig.tsbuildinfo +1 -1
  183. package/dist/utilities/visibility-manager.cjs.js +2 -0
  184. package/dist/utilities/visibility-manager.cjs.js.map +1 -0
  185. package/dist/utilities/visibility-manager.esm.js +1 -0
  186. package/package.json +2 -2
  187. package/src/nile-auto-complete/nile-auto-complete.ts +44 -0
  188. package/src/nile-chip/nile-chip.ts +53 -0
  189. package/src/nile-dropdown/nile-dropdown.ts +40 -1
  190. package/src/nile-inline-edit/nile-inline-edit.ts +1 -59
  191. package/src/nile-lite-tooltip/nile-lite-tooltip.ts +52 -1
  192. package/src/nile-popover/nile-popover.ts +44 -0
  193. package/src/nile-select/nile-select.ts +31 -87
  194. package/src/nile-tooltip/nile-tooltip.ts +39 -0
  195. package/src/nile-virtual-select/nile-virtual-select.ts +32 -87
  196. package/src/utilities/visibility-manager.ts +104 -0
  197. package/vscode-html-custom-data.json +69 -13
  198. package/dist/fixture-5b79f853.cjs.js.map +0 -1
  199. package/dist/fixture-90b199c4.esm.js +0 -569
  200. package/dist/fixture-c1d78368.cjs.js +0 -395
  201. package/dist/fixture-cf7bfcf5.esm.js +0 -569
  202. package/dist/fixture-dbd66009.cjs.js +0 -395
  203. package/dist/fixture-dbd66009.cjs.js.map +0 -1
  204. package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js +0 -2
  205. package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js.map +0 -1
  206. package/dist/nile-code-editor/backup_nile-code-editor copy.esm.js +0 -1
  207. package/dist/nile-inline-edit/nile-inline-edit-utils.cjs.js +0 -2
  208. package/dist/nile-inline-edit/nile-inline-edit-utils.cjs.js.map +0 -1
  209. package/dist/nile-inline-edit/nile-inline-edit-utils.esm.js +0 -1
  210. package/dist/nile-sidebar/index.cjs.js +0 -2
  211. package/dist/nile-sidebar/index.cjs.js.map +0 -1
  212. package/dist/nile-sidebar/index.esm.js +0 -75
  213. package/dist/nile-sidebar-menu/index.cjs.js +0 -2
  214. package/dist/nile-sidebar-menu/index.cjs.js.map +0 -1
  215. package/dist/nile-sidebar-menu/index.esm.js +0 -1
  216. package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js +0 -2
  217. package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js.map +0 -1
  218. package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js +0 -2
  219. package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js.map +0 -1
  220. package/dist/nile-sidebar-menu/nile-sidebar-menu.css.esm.js +0 -38
  221. package/dist/nile-sidebar-menu/nile-sidebar-menu.esm.js +0 -10
  222. package/dist/nile-sidebar-menu-items/index.cjs.js +0 -2
  223. package/dist/nile-sidebar-menu-items/index.cjs.js.map +0 -1
  224. package/dist/nile-sidebar-menu-items/index.esm.js +0 -1
  225. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js +0 -2
  226. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js.map +0 -1
  227. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js +0 -2
  228. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js.map +0 -1
  229. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.esm.js +0 -36
  230. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.esm.js +0 -15
  231. package/dist/nile-sidebar-wrapper/index.cjs.js +0 -2
  232. package/dist/nile-sidebar-wrapper/index.cjs.js.map +0 -1
  233. package/dist/nile-sidebar-wrapper/index.esm.js +0 -1
  234. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js +0 -2
  235. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js.map +0 -1
  236. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js +0 -2
  237. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js.map +0 -1
  238. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.esm.js +0 -105
  239. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.esm.js +0 -16
  240. package/dist/nile-virtual-select/group-manager.cjs.js +0 -2
  241. package/dist/nile-virtual-select/group-manager.cjs.js.map +0 -1
  242. package/dist/nile-virtual-select/group-manager.esm.js +0 -1
  243. package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js +0 -2
  244. package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js.map +0 -1
  245. package/dist/nile-virtual-select/temp_nile-virtual-select copy.esm.js +0 -231
  246. package/dist/scopedElementsWrapper-4c29be11.esm.js +0 -7
  247. package/dist/scopedElementsWrapper-a112fc73.cjs.js +0 -6
  248. package/dist/scopedElementsWrapper-a112fc73.cjs.js.map +0 -1
  249. package/dist/src/internal/portal-manager.d.ts +0 -53
  250. package/dist/src/internal/portal-manager.js +0 -196
  251. package/dist/src/internal/portal-manager.js.map +0 -1
  252. package/dist/src/internal/portal.d.ts +0 -60
  253. package/dist/src/internal/portal.js +0 -199
  254. package/dist/src/internal/portal.js.map +0 -1
  255. package/dist/src/internal/resizable-helper.d.ts +0 -59
  256. package/dist/src/internal/resizable-helper.js +0 -115
  257. package/dist/src/internal/resizable-helper.js.map +0 -1
  258. package/dist/src/internal/resizable-styles.d.ts +0 -16
  259. package/dist/src/internal/resizable-styles.js +0 -144
  260. package/dist/src/internal/resizable-styles.js.map +0 -1
  261. package/dist/src/internal/virtualizer-error-handler.d.ts +0 -30
  262. package/dist/src/internal/virtualizer-error-handler.js +0 -82
  263. package/dist/src/internal/virtualizer-error-handler.js.map +0 -1
  264. package/dist/src/lib/index.d.ts +0 -7
  265. package/dist/src/lib/index.js +0 -8
  266. package/dist/src/lib/index.js.map +0 -1
  267. package/dist/src/lib/virtualize.d.ts +0 -32
  268. package/dist/src/lib/virtualize.js +0 -105
  269. package/dist/src/lib/virtualize.js.map +0 -1
  270. package/dist/src/lib/virtualize.test.d.ts +0 -7
  271. package/dist/src/lib/virtualize.test.js +0 -57
  272. package/dist/src/lib/virtualize.test.js.map +0 -1
  273. package/dist/src/nile-badge/__snapshots__/nile-badge.test.snap.js +0 -17
  274. package/dist/src/nile-calendar/__snapshots__/nile-calendar.test.snap.js +0 -310
  275. package/dist/src/nile-card/__snapshots__/nile-card.test.snap.js +0 -34
  276. package/dist/src/nile-checkbox/__snapshots__/nile-checkbox.test.snap.js +0 -31
  277. package/dist/src/nile-code-editor/Old_theme copy.d.ts +0 -191
  278. package/dist/src/nile-code-editor/Old_theme copy.js +0 -193
  279. package/dist/src/nile-code-editor/Old_theme copy.js.map +0 -1
  280. package/dist/src/nile-code-editor/backup_nile-code-editor copy.d.ts +0 -0
  281. package/dist/src/nile-code-editor/backup_nile-code-editor copy.js +0 -675
  282. package/dist/src/nile-code-editor/backup_nile-code-editor copy.js.map +0 -1
  283. package/dist/src/nile-code-editor/theme copy.d.ts +0 -191
  284. package/dist/src/nile-code-editor/theme copy.js +0 -193
  285. package/dist/src/nile-code-editor/theme copy.js.map +0 -1
  286. package/dist/src/nile-grid/data-processor.d.ts +0 -37
  287. package/dist/src/nile-grid/data-processor.js +0 -122
  288. package/dist/src/nile-grid/data-processor.js.map +0 -1
  289. package/dist/src/nile-grid/event-handlers.d.ts +0 -35
  290. package/dist/src/nile-grid/event-handlers.js +0 -158
  291. package/dist/src/nile-grid/event-handlers.js.map +0 -1
  292. package/dist/src/nile-grid/renderer.d.ts +0 -8
  293. package/dist/src/nile-grid/renderer.js +0 -78
  294. package/dist/src/nile-grid/renderer.js.map +0 -1
  295. package/dist/src/nile-grid/resize-handler.d.ts +0 -4
  296. package/dist/src/nile-grid/resize-handler.js +0 -36
  297. package/dist/src/nile-grid/resize-handler.js.map +0 -1
  298. package/dist/src/nile-grid/types.d.ts +0 -32
  299. package/dist/src/nile-grid/types.js +0 -2
  300. package/dist/src/nile-grid/types.js.map +0 -1
  301. package/dist/src/nile-grid/utils.d.ts +0 -4
  302. package/dist/src/nile-grid/utils.js +0 -32
  303. package/dist/src/nile-grid/utils.js.map +0 -1
  304. package/dist/src/nile-hero/__snapshots__/nile-hero.test.snap.js +0 -47
  305. package/dist/src/nile-icon/__snapshots__/nile-icon.test.snap.js +0 -16
  306. package/dist/src/nile-inline-edit/nile-inline-edit-utils.d.ts +0 -20
  307. package/dist/src/nile-inline-edit/nile-inline-edit-utils.js +0 -70
  308. package/dist/src/nile-inline-edit/nile-inline-edit-utils.js.map +0 -1
  309. package/dist/src/nile-input/__snapshots__/nile-input.test.snap.js +0 -75
  310. package/dist/src/nile-menu/portal-manager.d.ts +0 -39
  311. package/dist/src/nile-menu/portal-manager.js +0 -340
  312. package/dist/src/nile-menu/portal-manager.js.map +0 -1
  313. package/dist/src/nile-menu/portal-utils.d.ts +0 -21
  314. package/dist/src/nile-menu/portal-utils.js +0 -128
  315. package/dist/src/nile-menu/portal-utils.js.map +0 -1
  316. package/dist/src/nile-popover/__snapshots__/nile-popover.test.snap.js +0 -22
  317. package/dist/src/nile-popover/popover-portal-handler.d.ts +0 -21
  318. package/dist/src/nile-popover/popover-portal-handler.js +0 -106
  319. package/dist/src/nile-popover/popover-portal-handler.js.map +0 -1
  320. package/dist/src/nile-portal-wrapper/index.d.ts +0 -1
  321. package/dist/src/nile-portal-wrapper/index.js +0 -2
  322. package/dist/src/nile-portal-wrapper/index.js.map +0 -1
  323. package/dist/src/nile-portal-wrapper/nile-portal-wrapper.d.ts +0 -47
  324. package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js +0 -451
  325. package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js.map +0 -1
  326. package/dist/src/nile-select/body-append-manager.d.ts +0 -90
  327. package/dist/src/nile-select/body-append-manager.js +0 -298
  328. package/dist/src/nile-select/body-append-manager.js.map +0 -1
  329. package/dist/src/nile-table-body/virtual-scroll-helper.d.ts +0 -9
  330. package/dist/src/nile-table-body/virtual-scroll-helper.js +0 -24
  331. package/dist/src/nile-table-body/virtual-scroll-helper.js.map +0 -1
  332. package/dist/src/nile-virtual-select/body-append-helper.d.ts +0 -16
  333. package/dist/src/nile-virtual-select/body-append-helper.js +0 -95
  334. package/dist/src/nile-virtual-select/body-append-helper.js.map +0 -1
  335. package/dist/src/nile-virtual-select/group-manager.d.ts +0 -32
  336. package/dist/src/nile-virtual-select/group-manager.js +0 -134
  337. package/dist/src/nile-virtual-select/group-manager.js.map +0 -1
  338. package/dist/src/nile-virtual-select/portal-utils.d.ts +0 -65
  339. package/dist/src/nile-virtual-select/portal-utils.js +0 -376
  340. package/dist/src/nile-virtual-select/portal-utils.js.map +0 -1
  341. package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.d.ts +0 -273
  342. package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js +0 -1305
  343. package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js.map +0 -1
  344. package/dist/src/nile-virtual-select/virtualizer-error-handler.d.ts +0 -21
  345. package/dist/src/nile-virtual-select/virtualizer-error-handler.js +0 -56
  346. package/dist/src/nile-virtual-select/virtualizer-error-handler.js.map +0 -1
  347. package/dist/src/nile-virtual-select-disabled/index.d.ts +0 -1
  348. package/dist/src/nile-virtual-select-disabled/index.js +0 -2
  349. package/dist/src/nile-virtual-select-disabled/index.js.map +0 -1
  350. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.d.ts +0 -12
  351. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js +0 -538
  352. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js.map +0 -1
  353. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.d.ts +0 -299
  354. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js +0 -1441
  355. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js.map +0 -1
  356. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.d.ts +0 -7
  357. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js +0 -631
  358. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js.map +0 -1
  359. package/dist/src/nile-virtual-select-disabled/portal-manager.d.ts +0 -45
  360. package/dist/src/nile-virtual-select-disabled/portal-manager.js +0 -333
  361. package/dist/src/nile-virtual-select-disabled/portal-manager.js.map +0 -1
  362. package/dist/src/nile-virtual-select-disabled/renderer.d.ts +0 -16
  363. package/dist/src/nile-virtual-select-disabled/renderer.js +0 -79
  364. package/dist/src/nile-virtual-select-disabled/renderer.js.map +0 -1
  365. package/dist/src/nile-virtual-select-disabled/search-manager.d.ts +0 -12
  366. package/dist/src/nile-virtual-select-disabled/search-manager.js +0 -40
  367. package/dist/src/nile-virtual-select-disabled/search-manager.js.map +0 -1
  368. package/dist/src/nile-virtual-select-disabled/selection-manager.d.ts +0 -12
  369. package/dist/src/nile-virtual-select-disabled/selection-manager.js +0 -64
  370. package/dist/src/nile-virtual-select-disabled/selection-manager.js.map +0 -1
  371. package/dist/src/nile-virtual-select-disabled/types.d.ts +0 -50
  372. package/dist/src/nile-virtual-select-disabled/types.js +0 -8
  373. package/dist/src/nile-virtual-select-disabled/types.js.map +0 -1
  374. package/dist/src/nile-virtual-table-body/index.d.ts +0 -2
  375. package/dist/src/nile-virtual-table-body/index.js +0 -3
  376. package/dist/src/nile-virtual-table-body/index.js.map +0 -1
  377. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.d.ts +0 -1
  378. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js +0 -44
  379. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js.map +0 -1
  380. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.d.ts +0 -50
  381. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js +0 -135
  382. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js.map +0 -1
  383. package/dist/src/nile-virtual-table-body/renderer.d.ts +0 -16
  384. package/dist/src/nile-virtual-table-body/renderer.js +0 -49
  385. package/dist/src/nile-virtual-table-body/renderer.js.map +0 -1
  386. package/dist/src/utilities/stepper-utils.d.ts +0 -71
  387. package/dist/src/utilities/stepper-utils.js +0 -108
  388. package/dist/src/utilities/stepper-utils.js.map +0 -1
  389. package/src/nile-inline-edit/nile-inline-edit-utils.ts +0 -94
@@ -1,16 +0,0 @@
1
- /* @web/test-runner snapshot v1 */
2
- export const snapshots = {};
3
-
4
- snapshots["NileIcon should render the icon with the correct name"] =
5
- `<nile-icon
6
- description=""
7
- method="fill"
8
- name="info"
9
- set="local"
10
- size="16"
11
- style="--nile-svg-fill: var(--nile-colors-dark-500); --nile-svg-height: 16px; --nile-svg-width: 16px;"
12
- >
13
- </nile-icon>
14
- `;
15
- /* end snapshot NileIcon should render the icon with the correct name */
16
-
@@ -1,20 +0,0 @@
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
- export declare function getSlottedElement(shadowRoot: ShadowRoot | null | undefined): HTMLElement | null;
8
- export declare function getValueFromSlottedElement(shadowRoot: ShadowRoot | null | undefined): string;
9
- export declare function getDisplayValue(value: string, maxPlaceholderLength: number): string;
10
- export declare function setSlottedElementValue(shadowRoot: ShadowRoot | null | undefined, value: string): void;
11
- export declare function updateSlottedElementValue(updateComplete: Promise<boolean> | Promise<void>, shadowRoot: ShadowRoot | null | undefined, value: string): void;
12
- export declare function updateValueFromSlottedElement(shadowRoot: ShadowRoot | null | undefined, currentValue: string): string;
13
- export declare function handleDocumentFocusIn(event: FocusEvent, component: HTMLElement, isOpen: boolean): {
14
- shouldClose: boolean;
15
- newValue: string | null;
16
- };
17
- export declare function handleDocumentMouseDown(event: MouseEvent, component: HTMLElement, isOpen: boolean): {
18
- shouldClose: boolean;
19
- newValue: string | null;
20
- };
@@ -1,70 +0,0 @@
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
- export function getSlottedElement(shadowRoot) {
8
- if (!shadowRoot)
9
- return null;
10
- const slot = shadowRoot.querySelector('slot');
11
- if (!slot)
12
- return null;
13
- const assignedElements = slot.assignedElements({ flatten: true });
14
- return assignedElements[0] || null;
15
- }
16
- export function getValueFromSlottedElement(shadowRoot) {
17
- const slottedElement = getSlottedElement(shadowRoot);
18
- if (!slottedElement)
19
- return '';
20
- const value = slottedElement.value;
21
- return value != null ? String(value) : '';
22
- }
23
- export function getDisplayValue(value, maxPlaceholderLength) {
24
- if (value && maxPlaceholderLength > 0 && value.length > maxPlaceholderLength) {
25
- return value.substring(0, maxPlaceholderLength) + '...';
26
- }
27
- return value;
28
- }
29
- export function setSlottedElementValue(shadowRoot, value) {
30
- const slottedElement = getSlottedElement(shadowRoot);
31
- if (slottedElement && value) {
32
- slottedElement.value = value;
33
- }
34
- }
35
- export function updateSlottedElementValue(updateComplete, shadowRoot, value) {
36
- updateComplete.then(() => {
37
- setSlottedElementValue(shadowRoot, value);
38
- });
39
- }
40
- export function updateValueFromSlottedElement(shadowRoot, currentValue) {
41
- const newValue = getValueFromSlottedElement(shadowRoot);
42
- return newValue !== currentValue ? newValue : currentValue;
43
- }
44
- export function handleDocumentFocusIn(event, component, isOpen) {
45
- if (!isOpen)
46
- return { shouldClose: false, newValue: null };
47
- const path = event.composedPath();
48
- const isWithinComponent = path.includes(component);
49
- if (!isWithinComponent) {
50
- const shadowRoot = component.shadowRoot;
51
- const currentValue = component.value || '';
52
- const newValue = updateValueFromSlottedElement(shadowRoot, currentValue);
53
- return { shouldClose: true, newValue };
54
- }
55
- return { shouldClose: false, newValue: null };
56
- }
57
- export function handleDocumentMouseDown(event, component, isOpen) {
58
- if (!isOpen)
59
- return { shouldClose: false, newValue: null };
60
- const path = event.composedPath();
61
- const isWithinComponent = path.includes(component);
62
- if (!isWithinComponent) {
63
- const shadowRoot = component.shadowRoot;
64
- const currentValue = component.value || '';
65
- const newValue = updateValueFromSlottedElement(shadowRoot, currentValue);
66
- return { shouldClose: true, newValue };
67
- }
68
- return { shouldClose: false, newValue: null };
69
- }
70
- //# sourceMappingURL=nile-inline-edit-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nile-inline-edit-utils.js","sourceRoot":"","sources":["../../../src/nile-inline-edit/nile-inline-edit-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,UAAU,iBAAiB,CAAC,UAAyC;IACzE,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAC7B,MAAM,IAAI,GAAG,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,OAAQ,gBAAgB,CAAC,CAAC,CAAiB,IAAI,IAAI,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,UAAyC;IAClF,MAAM,cAAc,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACrD,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAI,cAAsB,CAAC,KAAK,CAAC;IAC5C,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,oBAA4B;IACzE,IAAI,KAAK,IAAI,oBAAoB,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,oBAAoB,EAAE,CAAC;QAC7E,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC;IAC1D,CAAC;IACD,OAAO,K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O,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,KAAiB,EACjB,SAAsB,EACtB,MAAe;IAEf,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAE3D,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEnD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,UAAU,GAAI,SAAiB,CAAC,UAAU,CAAC;QACjD,MAAM,YAAY,GAAI,SAAiB,CAAC,KAAK,IAAI,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAG,6BAA6B,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QACzE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACzC,CAAC;IAED,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAChD,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport function getSlottedElement(shadowRoot: ShadowRoot | null | undefined): HTMLElement | null {\n if (!shadowRoot) return null;\n const slot = shadowRoot.querySelector('slot');\n if (!slot) return null;\n const assignedElements = slot.assignedElements({ flatten: true });\n return (assignedElements[0] as HTMLElement) || null;\n}\n\nexport function getValueFromSlottedElement(shadowRoot: ShadowRoot | null | undefined): string {\n const slottedElement = getSlottedElement(shadowRoot);\n if (!slottedElement) return '';\n const value = (slottedElement as any).value;\n return value != null ? String(value) : '';\n}\n\nexport function getDisplayValue(value: string, maxPlaceholderLength: number): string {\n if (value && maxPlaceholderLength > 0 && value.length > maxPlaceholderLength) {\n return value.substring(0, maxPlaceholderLength) + '...';\n }\n return value;\n}\n\nexport function setSlottedElementValue(shadowRoot: ShadowRoot | null | undefined, value: string): void {\n const slottedElement = getSlottedElement(shadowRoot);\n if (slottedElement && value) {\n (slottedElement as any).value = value;\n }\n}\n\nexport function updateSlottedElementValue(\n updateComplete: Promise<boolean> | Promise<void>,\n shadowRoot: ShadowRoot | null | undefined,\n value: string\n): void {\n updateComplete.then(() => {\n setSlottedElementValue(shadowRoot, value);\n });\n}\n\nexport function updateValueFromSlottedElement(\n shadowRoot: ShadowRoot | null | undefined,\n currentValue: string\n): string {\n const newValue = getValueFromSlottedElement(shadowRoot);\n return newValue !== currentValue ? newValue : currentValue;\n}\n\nexport function handleDocumentFocusIn(\n event: FocusEvent,\n component: HTMLElement,\n isOpen: boolean\n): { shouldClose: boolean; newValue: string | null } {\n if (!isOpen) return { shouldClose: false, newValue: null };\n \n const path = event.composedPath();\n const isWithinComponent = path.includes(component);\n \n if (!isWithinComponent) {\n const shadowRoot = (component as any).shadowRoot;\n const currentValue = (component as any).value || '';\n const newValue = updateValueFromSlottedElement(shadowRoot, currentValue);\n return { shouldClose: true, newValue };\n }\n \n return { shouldClose: false, newValue: null };\n}\n\nexport function handleDocumentMouseDown(\n event: MouseEvent,\n component: HTMLElement,\n isOpen: boolean\n): { shouldClose: boolean; newValue: string | null } {\n if (!isOpen) return { shouldClose: false, newValue: null };\n \n const path = event.composedPath();\n const isWithinComponent = path.includes(component);\n \n if (!isWithinComponent) {\n const shadowRoot = (component as any).shadowRoot;\n const currentValue = (component as any).value || '';\n const newValue = updateValueFromSlottedElement(shadowRoot, currentValue);\n return { shouldClose: true, newValue };\n }\n \n return { shouldClose: false, newValue: null };\n}\n\n"]}
@@ -1,75 +0,0 @@
1
- /* @web/test-runner snapshot v1 */
2
- export const snapshots = {};
3
-
4
- snapshots["nile-input renders correctly"] =
5
- `<div
6
- class="form-control form-control--has-label form-control--medium"
7
- part="form-control"
8
- >
9
- <label
10
- aria-hidden="false"
11
- class="form-control__label"
12
- for="input"
13
- part="form-control-label"
14
- >
15
- <slot name="label">
16
- Test Label
17
- </slot>
18
- </label>
19
- <div
20
- class="form-control-input"
21
- part="form-control-input"
22
- >
23
- <nile-popup
24
- distance="5"
25
- exportparts="input"
26
- placement="bottom-start"
27
- strategy="fixed"
28
- >
29
- <div
30
- class="input input--empty input--medium input--standard"
31
- part="base"
32
- slot="anchor"
33
- >
34
- <slot
35
- class="input__prefix"
36
- name="prefix"
37
- part="prefix"
38
- >
39
- </slot>
40
- <input
41
- aria-describedby="help-text"
42
- autocomplete="off"
43
- class="input__control"
44
- id="input"
45
- name=""
46
- part="input"
47
- placeholder=""
48
- spellcheck="true"
49
- title=""
50
- type="text"
51
- >
52
- <slot
53
- class="input__suffix"
54
- name="suffix"
55
- part="suffix"
56
- >
57
- </slot>
58
- </div>
59
- <div class="input__non-printable">
60
- Non-printable character detected.
61
- <nile-badge
62
- class="input__remove-non-printable"
63
- variant="error"
64
- >
65
- Remove All
66
- </nile-badge>
67
- <div class="input__srtiked-text-container">
68
- </div>
69
- </div>
70
- </nile-popup>
71
- </div>
72
- </div>
73
- `;
74
- /* end snapshot nile-input renders correctly */
75
-
@@ -1,39 +0,0 @@
1
- import { type Placement, type MiddlewareData } from '@floating-ui/dom';
2
- export declare class MenuPortalManager {
3
- private portalContainer;
4
- private originalMenuParent;
5
- private measuredMenuHeight;
6
- private component;
7
- private clonedMenu;
8
- private cleanupAutoUpdate;
9
- private currentPlacement;
10
- private currentMiddlewareData;
11
- constructor(component: any);
12
- private createPortalAppendContainer;
13
- positionPortalAppend(): void;
14
- private measureMenuHeight;
15
- private computeFloatingUIPosition;
16
- private calculateFloatingUIPosition;
17
- private createFloatingUIMiddleware;
18
- private handleSizeMiddleware;
19
- private createCustomPlatform;
20
- private applyFloatingUIPosition;
21
- private fallbackPositioning;
22
- private calculateAndSetAutoSizeProperties;
23
- updatePortalAppendPosition(): void;
24
- handleWindowResize(): void;
25
- private setupAutoUpdatePositioning;
26
- private cleanupAutoUpdatePositioning;
27
- private injectStylesToDocument;
28
- private adoptStylesToPortalAppend;
29
- setupPortalAppend(): void;
30
- private findParentContainer;
31
- private setupPortalEventListeners;
32
- cleanupPortalAppend(): void;
33
- get portalContainerElement(): HTMLElement | null;
34
- resetMeasuredHeight(): void;
35
- forceReposition(): void;
36
- getCurrentPlacement(): Placement;
37
- getCurrentMiddlewareData(): MiddlewareData | null;
38
- isUsingFloatingUI(): boolean;
39
- }
@@ -1,340 +0,0 @@
1
- import { autoUpdate, computePosition, flip, offset, shift, size, platform } from '@floating-ui/dom';
2
- import { PortalUtils } from './portal-utils';
3
- export class MenuPortalManager {
4
- constructor(component) {
5
- this.portalContainer = null;
6
- this.originalMenuParent = null;
7
- this.measuredMenuHeight = null;
8
- this.clonedMenu = null;
9
- this.cleanupAutoUpdate = null;
10
- this.currentPlacement = 'bottom';
11
- this.currentMiddlewareData = null;
12
- this.component = component;
13
- }
14
- createPortalAppendContainer() {
15
- const container = document.createElement('div');
16
- container.style.position = 'absolute';
17
- container.style.zIndex = '9999';
18
- container.style.pointerEvents = 'none';
19
- container.className = 'nile-menu-portal-append';
20
- return container;
21
- }
22
- positionPortalAppend() {
23
- if (!this.portalContainer)
24
- return;
25
- this.measureMenuHeight();
26
- this.computeFloatingUIPosition();
27
- }
28
- measureMenuHeight() {
29
- if (this.measuredMenuHeight || !this.portalContainer)
30
- return;
31
- this.portalContainer.style.position = 'absolute';
32
- this.portalContainer.style.visibility = 'hidden';
33
- this.portalContainer.style.top = '0px';
34
- this.portalContainer.style.left = '0px';
35
- this.portalContainer.offsetHeight;
36
- this.measuredMenuHeight = this.portalContainer.offsetHeight;
37
- this.portalContainer.style.visibility = '';
38
- }
39
- async computeFloatingUIPosition() {
40
- if (!this.portalContainer)
41
- return;
42
- const referenceElement = PortalUtils.findReferenceElement(this.component);
43
- if (!referenceElement) {
44
- console.warn('Reference element not found for menu portal positioning');
45
- return;
46
- }
47
- const floatingElement = this.portalContainer;
48
- try {
49
- const { x, y, placement, middlewareData } = await this.calculateFloatingUIPosition(referenceElement, floatingElement);
50
- this.applyFloatingUIPosition(floatingElement, referenceElement, x, y, placement, middlewareData);
51
- }
52
- catch (error) {
53
- console.warn('Floating UI positioning failed, falling back to simple positioning:', error);
54
- this.fallbackPositioning();
55
- }
56
- }
57
- async calculateFloatingUIPosition(referenceElement, floatingElement) {
58
- const boundary = PortalUtils.findBoundaryElements(referenceElement);
59
- const basePlacement = PortalUtils.getOptimalPlacement(referenceElement);
60
- const initialPlacement = basePlacement === 'top' ? 'top-start' : 'bottom-start';
61
- const middleware = this.createFloatingUIMiddleware(boundary);
62
- return await computePosition(referenceElement, floatingElement, {
63
- placement: initialPlacement,
64
- strategy: 'fixed',
65
- middleware,
66
- platform: this.createCustomPlatform()
67
- });
68
- }
69
- createFloatingUIMiddleware(boundary) {
70
- return [
71
- offset(4),
72
- size({
73
- apply: this.handleSizeMiddleware.bind(this),
74
- padding: 10,
75
- boundary: boundary
76
- }),
77
- flip({
78
- fallbackPlacements: ['bottom-start', 'top-start', 'bottom', 'top', 'bottom-end', 'top-end'],
79
- fallbackStrategy: 'bestFit',
80
- padding: 10,
81
- boundary: boundary
82
- }),
83
- shift({
84
- padding: 10,
85
- crossAxis: true,
86
- boundary: boundary
87
- })
88
- ];
89
- }
90
- handleSizeMiddleware({ availableWidth, availableHeight, elements, rects }) {
91
- const maxHeight = PortalUtils.calculateOptimalHeight(rects.reference, window.innerHeight, this.currentPlacement);
92
- elements.floating.style.maxHeight = `${maxHeight}px`;
93
- elements.floating.style.setProperty('--auto-size-available-width', `${availableWidth}px`);
94
- elements.floating.style.setProperty('--auto-size-available-height', `${maxHeight}px`);
95
- }
96
- createCustomPlatform() {
97
- return platform;
98
- }
99
- applyFloatingUIPosition(floatingElement, referenceElement, x, y, placement, middlewareData) {
100
- // Align left edge with reference element
101
- const referenceRect = referenceElement.getBoundingClientRect();
102
- Object.assign(floatingElement.style, {
103
- left: `${referenceRect.left}px`,
104
- top: `${y}px`,
105
- position: 'fixed',
106
- pointerEvents: 'auto',
107
- width: 'auto',
108
- minWidth: 'auto'
109
- });
110
- this.currentPlacement = placement;
111
- this.currentMiddlewareData = middlewareData;
112
- PortalUtils.applyCollisionData(floatingElement, middlewareData, placement);
113
- const placementClass = placement.split('-')[0];
114
- floatingElement.className = `nile-menu-portal-append menu__listbox--${placementClass}`;
115
- }
116
- fallbackPositioning() {
117
- if (!this.portalContainer)
118
- return;
119
- const referenceElement = PortalUtils.findReferenceElement(this.component);
120
- if (!referenceElement)
121
- return;
122
- const rect = referenceElement.getBoundingClientRect();
123
- const viewportHeight = window.innerHeight;
124
- const menuHeight = this.measuredMenuHeight || 200;
125
- const spaceBelow = viewportHeight - rect.bottom;
126
- const spaceAbove = rect.top;
127
- let topPosition;
128
- let placementClass;
129
- let maxHeight;
130
- if (spaceAbove > spaceBelow) {
131
- maxHeight = Math.max(spaceAbove - 20, 100);
132
- topPosition = Math.max(rect.top - maxHeight - 4, 10);
133
- placementClass = 'top';
134
- }
135
- else {
136
- maxHeight = Math.max(spaceBelow - 20, 100);
137
- topPosition = rect.bottom + 4;
138
- placementClass = 'bottom';
139
- }
140
- this.portalContainer.style.left = `${rect.left}px`;
141
- this.portalContainer.style.top = `${topPosition}px`;
142
- this.portalContainer.style.width = 'auto';
143
- this.portalContainer.style.minWidth = 'auto';
144
- this.portalContainer.style.maxHeight = `${maxHeight}px`;
145
- this.portalContainer.style.pointerEvents = 'auto';
146
- this.portalContainer.className = `nile-menu-portal-append menu__listbox--${placementClass}`;
147
- this.calculateAndSetAutoSizeProperties(rect, topPosition, placementClass);
148
- }
149
- calculateAndSetAutoSizeProperties(rect, topPosition, placementClass) {
150
- if (!this.portalContainer)
151
- return;
152
- const viewportHeight = window.innerHeight;
153
- const viewportWidth = window.innerWidth;
154
- let availableHeight;
155
- if (placementClass === 'top') {
156
- availableHeight = rect.top - 10;
157
- }
158
- else {
159
- availableHeight = viewportHeight - rect.bottom - 10;
160
- }
161
- const availableWidth = Math.min(rect.width, viewportWidth - rect.left - 10);
162
- this.portalContainer.style.setProperty('--auto-size-available-height', `${Math.max(availableHeight, 100)}px`);
163
- this.portalContainer.style.setProperty('--auto-size-available-width', `${Math.max(availableWidth, 200)}px`);
164
- }
165
- updatePortalAppendPosition() {
166
- if (this.component.portal && this.portalContainer) {
167
- this.positionPortalAppend();
168
- }
169
- }
170
- handleWindowResize() {
171
- if (this.component.portal && this.portalContainer) {
172
- this.positionPortalAppend();
173
- }
174
- }
175
- setupAutoUpdatePositioning() {
176
- if (!this.portalContainer || !this.component)
177
- return;
178
- this.cleanupAutoUpdatePositioning();
179
- const referenceElement = PortalUtils.findReferenceElement(this.component);
180
- if (!referenceElement)
181
- return;
182
- this.cleanupAutoUpdate = autoUpdate(referenceElement, this.portalContainer, () => {
183
- this.computeFloatingUIPosition();
184
- }, {
185
- ancestorScroll: true,
186
- ancestorResize: true,
187
- elementResize: true,
188
- layoutShift: true,
189
- animationFrame: true
190
- });
191
- }
192
- cleanupAutoUpdatePositioning() {
193
- if (this.cleanupAutoUpdate) {
194
- this.cleanupAutoUpdate();
195
- this.cleanupAutoUpdate = null;
196
- }
197
- }
198
- injectStylesToDocument() {
199
- if (!this.portalContainer)
200
- return;
201
- const styleId = PortalUtils.generateStyleId();
202
- if (document.getElementById(styleId))
203
- return;
204
- const componentStyles = this.component.constructor.styles;
205
- if (!componentStyles)
206
- return;
207
- const styleElement = document.createElement('style');
208
- styleElement.id = styleId;
209
- styleElement.textContent = PortalUtils.extractStylesAsCSS(componentStyles);
210
- document.head.appendChild(styleElement);
211
- this.portalContainer.__injectedStyleId = styleId;
212
- }
213
- adoptStylesToPortalAppend() {
214
- if (!this.portalContainer)
215
- return;
216
- this.injectStylesToDocument();
217
- }
218
- setupPortalAppend() {
219
- if (!this.component.portal)
220
- return;
221
- // If portal already exists, don't recreate it
222
- if (this.portalContainer && this.portalContainer.parentNode) {
223
- return;
224
- }
225
- this.component.updateComplete.then(() => {
226
- setTimeout(() => {
227
- // Check if menu is inside a parent container (e.g., nile-dropdown) and if it's open
228
- const parentContainer = this.findParentContainer();
229
- const isParentOpen = parentContainer ? parentContainer.open : true;
230
- // Portal the menu if parent is open or if no parent found (standalone menu)
231
- if (isParentOpen || !parentContainer) {
232
- this.originalMenuParent = this.component.parentElement;
233
- // Clone the menu element with all its children and attributes
234
- this.clonedMenu = this.component.cloneNode(true);
235
- // Copy all attributes from original to cloned menu
236
- Array.from(this.component.attributes).forEach((attr) => {
237
- this.clonedMenu.setAttribute(attr.name, attr.value);
238
- });
239
- this.portalContainer = this.createPortalAppendContainer();
240
- this.portalContainer.appendChild(this.clonedMenu);
241
- document.body.appendChild(this.portalContainer);
242
- this.adoptStylesToPortalAppend();
243
- this.clonedMenu.style.display = '';
244
- this.positionPortalAppend();
245
- this.setupPortalEventListeners();
246
- this.setupAutoUpdatePositioning();
247
- window.addEventListener('resize', this.handleWindowResize.bind(this));
248
- }
249
- }, 50);
250
- });
251
- }
252
- findParentContainer() {
253
- // First, check if we're in a slot and find the dropdown through the slot
254
- const root = this.component.getRootNode();
255
- if (root instanceof ShadowRoot) {
256
- // We're in a shadow root, find the dropdown host
257
- const host = root.host;
258
- if (host && host.tagName.toLowerCase() === 'nile-dropdown') {
259
- return host;
260
- }
261
- }
262
- // Also check parent element chain
263
- let current = this.component.parentElement;
264
- while (current && current !== document.body) {
265
- // Check for nile-dropdown or other containers that might have open/close behavior
266
- if (current.tagName.toLowerCase() === 'nile-dropdown') {
267
- return current;
268
- }
269
- // If we hit a shadow root, check the host
270
- if (current instanceof ShadowRoot) {
271
- const host = current.host;
272
- if (host && host.tagName.toLowerCase() === 'nile-dropdown') {
273
- return host;
274
- }
275
- }
276
- current = current.parentElement;
277
- }
278
- // Try to find dropdown through assigned slot
279
- if (this.component.assignedSlot) {
280
- const slotRoot = this.component.assignedSlot.getRootNode();
281
- if (slotRoot instanceof ShadowRoot) {
282
- const host = slotRoot.host;
283
- if (host && host.tagName.toLowerCase() === 'nile-dropdown') {
284
- return host;
285
- }
286
- }
287
- }
288
- return null;
289
- }
290
- setupPortalEventListeners() {
291
- if (!this.clonedMenu)
292
- return;
293
- // Forward events from cloned menu to original component
294
- this.clonedMenu.addEventListener('nile-select', (event) => {
295
- const customEvent = event;
296
- this.component.dispatchEvent(new CustomEvent('nile-select', { detail: customEvent.detail, bubbles: true }));
297
- });
298
- }
299
- cleanupPortalAppend() {
300
- this.cleanupAutoUpdatePositioning();
301
- if (this.portalContainer && this.portalContainer.parentNode) {
302
- const injectedStyleId = this.portalContainer.__injectedStyleId;
303
- if (injectedStyleId) {
304
- const styleElement = document.getElementById(injectedStyleId);
305
- if (styleElement) {
306
- styleElement.remove();
307
- }
308
- }
309
- this.portalContainer.parentNode.removeChild(this.portalContainer);
310
- }
311
- window.removeEventListener('resize', this.handleWindowResize.bind(this));
312
- this.portalContainer = null;
313
- this.originalMenuParent = null;
314
- this.clonedMenu = null;
315
- this.measuredMenuHeight = null;
316
- this.currentPlacement = 'bottom';
317
- this.currentMiddlewareData = null;
318
- }
319
- get portalContainerElement() {
320
- return this.portalContainer;
321
- }
322
- resetMeasuredHeight() {
323
- this.measuredMenuHeight = null;
324
- }
325
- forceReposition() {
326
- if (this.portalContainer) {
327
- this.computeFloatingUIPosition();
328
- }
329
- }
330
- getCurrentPlacement() {
331
- return this.currentPlacement;
332
- }
333
- getCurrentMiddlewareData() {
334
- return this.currentMiddlewareData;
335
- }
336
- isUsingFloatingUI() {
337
- return this.cleanupAutoUpdate !== null;
338
- }
339
- }
340
- //# sourceMappingURL=portal-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"portal-manager.js","sourceRoot":"","sources":["../../../src/nile-menu/portal-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,QAAQ,EAIT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAA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G,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;gBAC9D,IAAI,YAAY,EAAE,CAAC;oBACjB,YAAY,CAAC,MAAM,EAAE,CAAC;gBACxB,CAAC;YACH,CAAC;YAED,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACpE,CAAC;QAED,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAEzE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QACjC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;IACpC,CAAC;IAED,IAAI,sBAAsB;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,mBAAmB;QACjB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,eAAe;QACb,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACnC,CAAC;IACH,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,wBAAwB;QACtB,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACpC,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC;IACzC,CAAC;CACF","sourcesContent":["import { \n autoUpdate, \n computePosition, \n flip, \n offset, \n shift, \n size, \n platform,\n type Placement,\n type MiddlewareData,\n type ComputePositionConfig\n} from '@floating-ui/dom';\nimport { PortalUtils } from './portal-utils';\n\nexport class MenuPortalManager {\n private portalContainer: HTMLElement | null = null;\n private originalMenuParent: HTMLElement | null = null;\n private measuredMenuHeight: number | null = null;\n private component: any;\n private clonedMenu: HTMLElement | null = null;\n private cleanupAutoUpdate: (() => void) | null = null;\n private currentPlacement: Placement = 'bottom';\n private currentMiddlewareData: MiddlewareData | null = null;\n\n constructor(component: any) {\n this.component = component;\n }\n\n private createPortalAppendContainer(): HTMLElement {\n const container = document.createElement('div');\n container.style.position = 'absolute';\n container.style.zIndex = '9999';\n container.style.pointerEvents = 'none';\n container.className = 'nile-menu-portal-append';\n return container;\n }\n\n positionPortalAppend(): void {\n if (!this.portalContainer) return;\n\n this.measureMenuHeight();\n this.computeFloatingUIPosition();\n }\n\n private measureMenuHeight(): void {\n if (this.measuredMenuHeight || !this.portalContainer) return;\n\n this.portalContainer.style.position = 'absolute';\n this.portalContainer.style.visibility = 'hidden';\n this.portalContainer.style.top = '0px';\n this.portalContainer.style.left = '0px';\n \n this.portalContainer.offsetHeight;\n \n this.measuredMenuHeight = this.portalContainer.offsetHeight;\n \n this.portalContainer.style.visibility = '';\n }\n\n private async computeFloatingUIPosition(): Promise<void> {\n if (!this.portalContainer) return;\n\n const referenceElement = PortalUtils.findReferenceElement(this.component);\n if (!referenceElement) {\n console.warn('Reference element not found for menu portal positioning');\n return;\n }\n\n const floatingElement = this.portalContainer;\n\n try {\n const { x, y, placement, middlewareData } = await this.calculateFloatingUIPosition(\n referenceElement,\n floatingElement\n );\n\n this.applyFloatingUIPosition(floatingElement, referenceElement, x, y, placement, middlewareData);\n\n } catch (error) {\n console.warn('Floating UI positioning failed, falling back to simple positioning:', error);\n this.fallbackPositioning();\n }\n }\n\n private async calculateFloatingUIPosition(\n referenceElement: HTMLElement,\n floatingElement: HTMLElement\n ): Promise<{ x: number; y: number; placement: Placement; middlewareData: MiddlewareData }> {\n const boundary = PortalUtils.findBoundaryElements(referenceElement);\n const basePlacement = PortalUtils.getOptimalPlacement(referenceElement);\n const initialPlacement = basePlacement === 'top' ? 'top-start' : 'bottom-start';\n const middleware = this.createFloatingUIMiddleware(boundary);\n\n return await computePosition(referenceElement, floatingElement, {\n placement: initialPlacement,\n strategy: 'fixed',\n middleware,\n platform: this.createCustomPlatform()\n });\n }\n\n private createFloatingUIMiddleware(boundary: Element[] | undefined): ComputePositionConfig['middleware'] {\n return [\n offset(4),\n size({\n apply: this.handleSizeMiddleware.bind(this),\n padding: 10,\n boundary: boundary\n }),\n flip({\n fallbackPlacements: ['bottom-start', 'top-start', 'bottom', 'top', 'bottom-end', 'top-end'],\n fallbackStrategy: 'bestFit',\n padding: 10,\n boundary: boundary\n }),\n shift({\n padding: 10,\n crossAxis: true,\n boundary: boundary\n })\n ];\n }\n\n private handleSizeMiddleware({ availableWidth, availableHeight, elements, rects }: {\n availableWidth: number;\n availableHeight: number;\n elements: { floating: HTMLElement };\n rects: { reference: { x: number; y: number; width: number; height: number } };\n }): void {\n const maxHeight = PortalUtils.calculateOptimalHeight(\n rects.reference,\n window.innerHeight,\n this.currentPlacement\n );\n\n elements.floating.style.maxHeight = `${maxHeight}px`;\n \n elements.floating.style.setProperty('--auto-size-available-width', `${availableWidth}px`);\n elements.floating.style.setProperty('--auto-size-available-height', `${maxHeight}px`);\n }\n\n private createCustomPlatform() {\n return platform;\n }\n\n private applyFloatingUIPosition(\n floatingElement: HTMLElement,\n referenceElement: HTMLElement,\n x: number,\n y: number,\n placement: Placement,\n middlewareData: MiddlewareData\n ): void {\n // Align left edge with reference element\n const referenceRect = referenceElement.getBoundingClientRect();\n \n Object.assign(floatingElement.style, {\n left: `${referenceRect.left}px`,\n top: `${y}px`,\n position: 'fixed',\n pointerEvents: 'auto',\n width: 'auto',\n minWidth: 'auto'\n });\n\n this.currentPlacement = placement;\n this.currentMiddlewareData = middlewareData;\n \n PortalUtils.applyCollisionData(floatingElement, middlewareData, placement);\n \n const placementClass = placement.split('-')[0];\n floatingElement.className = `nile-menu-portal-append menu__listbox--${placementClass}`;\n }\n\n private fallbackPositioning(): void {\n if (!this.portalContainer) return;\n\n const referenceElement = PortalUtils.findReferenceElement(this.component);\n if (!referenceElement) return;\n\n const rect = referenceElement.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const menuHeight = this.measuredMenuHeight || 200;\n \n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n \n let topPosition: number;\n let placementClass: string;\n let maxHeight: number;\n \n if (spaceAbove > spaceBelow) {\n maxHeight = Math.max(spaceAbove - 20, 100);\n topPosition = Math.max(rect.top - maxHeight - 4, 10);\n placementClass = 'top';\n } else {\n maxHeight = Math.max(spaceBelow - 20, 100);\n topPosition = rect.bottom + 4;\n placementClass = 'bottom';\n }\n\n this.portalContainer.style.left = `${rect.left}px`;\n this.portalContainer.style.top = `${topPosition}px`;\n this.portalContainer.style.width = 'auto';\n this.portalContainer.style.minWidth = 'auto';\n this.portalContainer.style.maxHeight = `${maxHeight}px`;\n this.portalContainer.style.pointerEvents = 'auto';\n this.portalContainer.className = `nile-menu-portal-append menu__listbox--${placementClass}`;\n \n this.calculateAndSetAutoSizeProperties(rect, topPosition, placementClass);\n }\n\n private calculateAndSetAutoSizeProperties(rect: DOMRect, topPosition: number, placementClass: string): void {\n if (!this.portalContainer) return;\n\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n \n let availableHeight: number;\n if (placementClass === 'top') {\n availableHeight = rect.top - 10;\n } else {\n availableHeight = viewportHeight - rect.bottom - 10;\n }\n \n const availableWidth = Math.min(rect.width, viewportWidth - rect.left - 10);\n \n this.portalContainer.style.setProperty('--auto-size-available-height', `${Math.max(availableHeight, 100)}px`);\n this.portalContainer.style.setProperty('--auto-size-available-width', `${Math.max(availableWidth, 200)}px`);\n }\n\n updatePortalAppendPosition(): void {\n if (this.component.portal && this.portalContainer) {\n this.positionPortalAppend();\n }\n }\n\n handleWindowResize(): void {\n if (this.component.portal && this.portalContainer) {\n this.positionPortalAppend();\n }\n }\n\n private setupAutoUpdatePositioning(): void {\n if (!this.portalContainer || !this.component) return;\n\n this.cleanupAutoUpdatePositioning();\n\n const referenceElement = PortalUtils.findReferenceElement(this.component);\n if (!referenceElement) return;\n\n this.cleanupAutoUpdate = autoUpdate(\n referenceElement,\n this.portalContainer,\n () => {\n this.computeFloatingUIPosition();\n },\n {\n ancestorScroll: true,\n ancestorResize: true,\n elementResize: true,\n layoutShift: true,\n animationFrame: true\n }\n );\n }\n\n private cleanupAutoUpdatePositioning(): void {\n if (this.cleanupAutoUpdate) {\n this.cleanupAutoUpdate();\n this.cleanupAutoUpdate = null;\n }\n }\n\n private injectStylesToDocument(): void {\n if (!this.portalContainer) return;\n\n const styleId = PortalUtils.generateStyleId();\n \n if (document.getElementById(styleId)) return;\n\n const componentStyles = (this.component.constructor as any).styles;\n if (!componentStyles) return;\n\n const styleElement = document.createElement('style');\n styleElement.id = styleId;\n styleElement.textContent = PortalUtils.extractStylesAsCSS(componentStyles);\n \n document.head.appendChild(styleElement);\n \n (this.portalContainer as any).__injectedStyleId = styleId;\n }\n\n private adoptStylesToPortalAppend(): void {\n if (!this.portalContainer) return;\n this.injectStylesToDocument();\n }\n\n setupPortalAppend(): void {\n if (!this.component.portal) return;\n \n // If portal already exists, don't recreate it\n if (this.portalContainer && this.portalContainer.parentNode) {\n return;\n }\n\n this.component.updateComplete.then(() => {\n setTimeout(() => {\n // Check if menu is inside a parent container (e.g., nile-dropdown) and if it's open\n const parentContainer = this.findParentContainer();\n const isParentOpen = parentContainer ? parentContainer.open : true;\n \n // Portal the menu if parent is open or if no parent found (standalone menu)\n if (isParentOpen || !parentContainer) {\n this.originalMenuParent = this.component.parentElement as HTMLElement;\n \n // Clone the menu element with all its children and attributes\n this.clonedMenu = this.component.cloneNode(true) as HTMLElement;\n \n // Copy all attributes from original to cloned menu\n Array.from(this.component.attributes).forEach((attr: Attr) => {\n this.clonedMenu!.setAttribute(attr.name, attr.value);\n });\n \n this.portalContainer = this.createPortalAppendContainer();\n this.portalContainer.appendChild(this.clonedMenu);\n document.body.appendChild(this.portalContainer);\n \n this.adoptStylesToPortalAppend();\n \n this.clonedMenu.style.display = '';\n this.positionPortalAppend();\n \n this.setupPortalEventListeners();\n \n this.setupAutoUpdatePositioning();\n \n window.addEventListener('resize', this.handleWindowResize.bind(this));\n }\n }, 50);\n });\n }\n\n private findParentContainer(): any {\n // First, check if we're in a slot and find the dropdown through the slot\n const root = this.component.getRootNode();\n if (root instanceof ShadowRoot) {\n // We're in a shadow root, find the dropdown host\n const host = root.host;\n if (host && host.tagName.toLowerCase() === 'nile-dropdown') {\n return host;\n }\n }\n \n // Also check parent element chain\n let current = this.component.parentElement;\n while (current && current !== document.body) {\n // Check for nile-dropdown or other containers that might have open/close behavior\n if (current.tagName.toLowerCase() === 'nile-dropdown') {\n return current;\n }\n \n // If we hit a shadow root, check the host\n if (current instanceof ShadowRoot) {\n const host = current.host;\n if (host && host.tagName.toLowerCase() === 'nile-dropdown') {\n return host;\n }\n }\n \n current = current.parentElement;\n }\n \n // Try to find dropdown through assigned slot\n if (this.component.assignedSlot) {\n const slotRoot = this.component.assignedSlot.getRootNode();\n if (slotRoot instanceof ShadowRoot) {\n const host = slotRoot.host;\n if (host && host.tagName.toLowerCase() === 'nile-dropdown') {\n return host;\n }\n }\n }\n \n return null;\n }\n\n private setupPortalEventListeners(): void {\n if (!this.clonedMenu) return;\n\n // Forward events from cloned menu to original component\n this.clonedMenu.addEventListener('nile-select', (event: Event) => {\n const customEvent = event as CustomEvent;\n this.component.dispatchEvent(new CustomEvent('nile-select', { detail: customEvent.detail, bubbles: true }));\n });\n }\n\n cleanupPortalAppend(): void {\n this.cleanupAutoUpdatePositioning();\n \n if (this.portalContainer && this.portalContainer.parentNode) {\n const injectedStyleId = (this.portalContainer as any).__injectedStyleId;\n if (injectedStyleId) {\n const styleElement = document.getElementById(injectedStyleId);\n if (styleElement) {\n styleElement.remove();\n }\n }\n \n this.portalContainer.parentNode.removeChild(this.portalContainer);\n }\n \n window.removeEventListener('resize', this.handleWindowResize.bind(this));\n \n this.portalContainer = null;\n this.originalMenuParent = null;\n this.clonedMenu = null;\n this.measuredMenuHeight = null;\n this.currentPlacement = 'bottom';\n this.currentMiddlewareData = null;\n }\n\n get portalContainerElement(): HTMLElement | null {\n return this.portalContainer;\n }\n\n resetMeasuredHeight(): void {\n this.measuredMenuHeight = null;\n }\n\n forceReposition(): void {\n if (this.portalContainer) {\n this.computeFloatingUIPosition();\n }\n }\n\n getCurrentPlacement(): Placement {\n return this.currentPlacement;\n }\n\n getCurrentMiddlewareData(): MiddlewareData | null {\n return this.currentMiddlewareData;\n }\n\n isUsingFloatingUI(): boolean {\n return this.cleanupAutoUpdate !== null;\n }\n}\n\n"]}
@@ -1,21 +0,0 @@
1
- import { type Placement, type MiddlewareData } from '@floating-ui/dom';
2
- export declare class PortalUtils {
3
- static calculateAvailableSpace(referenceElement: HTMLElement): {
4
- spaceAbove: number;
5
- spaceBelow: number;
6
- viewportHeight: number;
7
- };
8
- static getOptimalPlacement(referenceElement: HTMLElement): Placement;
9
- static findBoundaryElements(component: HTMLElement): Element[] | undefined;
10
- static calculateOptimalHeight(referenceRect: {
11
- x: number;
12
- y: number;
13
- width: number;
14
- height: number;
15
- }, viewportHeight: number, placement: Placement): number;
16
- static extractStylesAsCSS(styles: any): string;
17
- static generateStyleId(): string;
18
- static isPositioningOptimal(placement: Placement, referenceElement: HTMLElement): boolean;
19
- static applyCollisionData(element: HTMLElement, middlewareData: MiddlewareData, placement: Placement): void;
20
- static findReferenceElement(menu: HTMLElement): HTMLElement | null;
21
- }