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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,196 +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
- import { autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom';
8
- export class BasePortalManager {
9
- constructor(contentHandler, config = {}) {
10
- this.portalContainer = null;
11
- this.cleanupAutoUpdate = null;
12
- this.currentPlacement = 'bottom';
13
- this.currentMiddlewareData = null;
14
- this.contentHandler = contentHandler;
15
- this.config = {
16
- placement: 'bottom',
17
- offset: 4,
18
- padding: 10,
19
- strategy: 'fixed',
20
- flip: true,
21
- shift: true,
22
- ...config
23
- };
24
- }
25
- setupPortal() {
26
- if (this.portalContainer)
27
- return;
28
- this.portalContainer = this.createPortalContainer();
29
- const portalContent = this.contentHandler.createPortalContent();
30
- this.portalContainer.appendChild(portalContent);
31
- document.body.appendChild(this.portalContainer);
32
- this.injectStyles();
33
- this.positionPortal();
34
- this.setupAutoUpdate();
35
- this.contentHandler.setupEventListeners(portalContent);
36
- }
37
- updatePortal() {
38
- if (!this.portalContainer)
39
- return;
40
- const portalContent = this.portalContainer.firstElementChild;
41
- if (portalContent) {
42
- this.contentHandler.updatePortalContent(portalContent);
43
- this.positionPortal();
44
- }
45
- }
46
- cleanupPortal() {
47
- if (this.cleanupAutoUpdate) {
48
- this.cleanupAutoUpdate();
49
- this.cleanupAutoUpdate = null;
50
- }
51
- if (this.portalContainer) {
52
- const portalContent = this.portalContainer.firstElementChild;
53
- if (portalContent) {
54
- this.contentHandler.cleanupEventListeners(portalContent);
55
- }
56
- this.portalContainer.remove();
57
- this.portalContainer = null;
58
- }
59
- }
60
- createPortalContainer() {
61
- const container = document.createElement('div');
62
- container.style.position = 'absolute';
63
- container.style.zIndex = '9999';
64
- container.style.pointerEvents = 'none';
65
- container.className = 'nile-portal-container';
66
- return container;
67
- }
68
- async positionPortal() {
69
- if (!this.portalContainer)
70
- return;
71
- const referenceElement = this.contentHandler.getReferenceElement();
72
- const floatingElement = this.portalContainer;
73
- try {
74
- const { x, y, placement, middlewareData } = await this.calculatePosition(referenceElement, floatingElement);
75
- this.applyPosition(floatingElement, x, y, placement, middlewareData);
76
- }
77
- catch (error) {
78
- console.warn('Portal positioning failed, using fallback:', error);
79
- this.fallbackPositioning();
80
- }
81
- }
82
- async calculatePosition(referenceElement, floatingElement) {
83
- const middleware = this.createMiddleware();
84
- return await computePosition(referenceElement, floatingElement, {
85
- placement: this.config.placement,
86
- strategy: this.config.strategy,
87
- middleware
88
- });
89
- }
90
- createMiddleware() {
91
- const middleware = [
92
- offset(this.config.offset)
93
- ];
94
- if (this.config.sync) {
95
- middleware.push(size({
96
- apply: ({ elements, availableWidth, availableHeight }) => {
97
- if (this.config.sync === 'width' || this.config.sync === 'both') {
98
- elements.floating.style.width = `${availableWidth}px`;
99
- }
100
- if (this.config.sync === 'height' || this.config.sync === 'both') {
101
- elements.floating.style.height = `${availableHeight}px`;
102
- }
103
- },
104
- padding: this.config.padding,
105
- boundary: this.config.boundary
106
- }));
107
- }
108
- if (this.config.flip) {
109
- middleware.push(flip({
110
- fallbackPlacements: ['bottom', 'top', 'bottom-start', 'top-start'],
111
- boundary: this.config.boundary,
112
- padding: this.config.padding
113
- }));
114
- }
115
- if (this.config.shift) {
116
- middleware.push(shift({
117
- boundary: this.config.boundary,
118
- padding: this.config.padding
119
- }));
120
- }
121
- return middleware;
122
- }
123
- applyPosition(floatingElement, x, y, placement, middlewareData) {
124
- Object.assign(floatingElement.style, {
125
- left: `${x}px`,
126
- top: `${y}px`,
127
- position: this.config.strategy,
128
- pointerEvents: 'auto'
129
- });
130
- this.currentPlacement = placement;
131
- this.currentMiddlewareData = middlewareData;
132
- }
133
- fallbackPositioning() {
134
- if (!this.portalContainer)
135
- return;
136
- const referenceElement = this.contentHandler.getReferenceElement();
137
- const rect = referenceElement.getBoundingClientRect();
138
- this.portalContainer.style.left = `${rect.left}px`;
139
- this.portalContainer.style.top = `${rect.bottom + 4}px`;
140
- this.portalContainer.style.width = `${rect.width}px`;
141
- this.portalContainer.style.pointerEvents = 'auto';
142
- }
143
- setupAutoUpdate() {
144
- if (!this.portalContainer)
145
- return;
146
- this.cleanupAutoUpdate = autoUpdate(this.contentHandler.getReferenceElement(), this.portalContainer, () => this.positionPortal(), {
147
- ancestorScroll: true,
148
- ancestorResize: true,
149
- elementResize: true,
150
- layoutShift: true
151
- });
152
- }
153
- injectStyles() {
154
- const styles = this.contentHandler.getComponentStyles();
155
- if (!styles)
156
- return;
157
- // Extract and inject styles into document
158
- const styleId = `nile-portal-styles-${Date.now()}`;
159
- if (document.getElementById(styleId))
160
- return;
161
- const styleElement = document.createElement('style');
162
- styleElement.id = styleId;
163
- styleElement.textContent = this.extractStylesAsCSS(styles);
164
- document.head.appendChild(styleElement);
165
- if (this.portalContainer) {
166
- this.portalContainer.__injectedStyleId = styleId;
167
- }
168
- }
169
- extractStylesAsCSS(styles) {
170
- if (Array.isArray(styles)) {
171
- return styles.map(style => {
172
- if ('cssText' in style) {
173
- return style.cssText;
174
- }
175
- return style.toString();
176
- }).join('\n');
177
- }
178
- if ('cssText' in styles) {
179
- return styles.cssText;
180
- }
181
- return styles.toString();
182
- }
183
- get portalElement() {
184
- return this.portalContainer;
185
- }
186
- getCurrentPlacement() {
187
- return this.currentPlacement;
188
- }
189
- getCurrentMiddlewareData() {
190
- return this.currentMiddlewareData;
191
- }
192
- isActive() {
193
- return this.portalContainer !== null;
194
- }
195
- }
196
- //# sourceMappingURL=portal-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"portal-manager.js","sourceRoot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Aa,CAAC,OAAO,CAAC,CAAC;QACrD,YAAY,CAAC,EAAE,GAAG,OAAO,CAAC;QAC1B,YAAY,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAE3D,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAExC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACxB,IAAI,CAAC,eAAuB,CAAC,iBAAiB,GAAG,OAAO,CAAC;QAC5D,CAAC;IACH,CAAC;IAEO,kBAAkB,CAAC,MAAsB;QAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;gBACxB,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;oBACvB,OAAO,KAAK,CAAC,OAAO,CAAC;gBACvB,CAAC;gBACD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC1B,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;QAED,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;YACxB,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC;QACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,wBAAwB;QACtB,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACpC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,eAAe,KAAK,IAAI,CAAC;IACvC,CAAC;CACF","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\nimport { \n autoUpdate, \n computePosition, \n flip, \n offset, \n shift, \n size,\n type Placement,\n type MiddlewareData,\n type ComputePositionConfig,\n type Boundary\n} from '@floating-ui/dom';\nimport type { CSSResultGroup } from 'lit';\n\nexport interface PortalConfig {\n placement?: Placement;\n offset?: number;\n padding?: number;\n boundary?: Boundary;\n strategy?: 'absolute' | 'fixed';\n flip?: boolean;\n shift?: boolean;\n sync?: 'width' | 'height' | 'both' | boolean;\n autoSize?: 'width' | 'height' | 'both' | boolean;\n autoSizePadding?: number;\n}\n\nexport interface PortalContentHandler {\n createPortalContent(): HTMLElement;\n updatePortalContent(portalElement: HTMLElement): void;\n setupEventListeners(portalElement: HTMLElement): void;\n cleanupEventListeners(portalElement: HTMLElement): void;\n getReferenceElement(): HTMLElement;\n getComponentStyles(): CSSResultGroup | undefined;\n}\n\nexport class BasePortalManager {\n private portalContainer: HTMLElement | null = null;\n private cleanupAutoUpdate: (() => void) | null = null;\n private currentPlacement: Placement = 'bottom';\n private currentMiddlewareData: MiddlewareData | null = null;\n private config: PortalConfig;\n private contentHandler: PortalContentHandler;\n\n constructor(contentHandler: PortalContentHandler, config: PortalConfig = {}) {\n this.contentHandler = contentHandler;\n this.config = {\n placement: 'bottom',\n offset: 4,\n padding: 10,\n strategy: 'fixed',\n flip: true,\n shift: true,\n ...config\n };\n }\n\n setupPortal(): void {\n if (this.portalContainer) return;\n\n this.portalContainer = this.createPortalContainer();\n const portalContent = this.contentHandler.createPortalContent();\n this.portalContainer.appendChild(portalContent);\n \n document.body.appendChild(this.portalContainer);\n \n this.injectStyles();\n this.positionPortal();\n this.setupAutoUpdate();\n this.contentHandler.setupEventListeners(portalContent);\n }\n\n updatePortal(): void {\n if (!this.portalContainer) return;\n \n const portalContent = this.portalContainer.firstElementChild as HTMLElement;\n if (portalContent) {\n this.contentHandler.updatePortalContent(portalContent);\n this.positionPortal();\n }\n }\n\n cleanupPortal(): void {\n if (this.cleanupAutoUpdate) {\n this.cleanupAutoUpdate();\n this.cleanupAutoUpdate = null;\n }\n\n if (this.portalContainer) {\n const portalContent = this.portalContainer.firstElementChild as HTMLElement;\n if (portalContent) {\n this.contentHandler.cleanupEventListeners(portalContent);\n }\n \n this.portalContainer.remove();\n this.portalContainer = null;\n }\n }\n\n private createPortalContainer(): 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-portal-container';\n return container;\n }\n\n private async positionPortal(): Promise<void> {\n if (!this.portalContainer) return;\n\n const referenceElement = this.contentHandler.getReferenceElement();\n const floatingElement = this.portalContainer;\n\n try {\n const { x, y, placement, middlewareData } = await this.calculatePosition(\n referenceElement,\n floatingElement\n );\n\n this.applyPosition(floatingElement, x, y, placement, middlewareData);\n } catch (error) {\n console.warn('Portal positioning failed, using fallback:', error);\n this.fallbackPositioning();\n }\n }\n\n private async calculatePosition(\n referenceElement: HTMLElement,\n floatingElement: HTMLElement\n ): Promise<{ x: number; y: number; placement: Placement; middlewareData: MiddlewareData }> {\n const middleware = this.createMiddleware();\n\n return await computePosition(referenceElement, floatingElement, {\n placement: this.config.placement!,\n strategy: this.config.strategy!,\n middleware\n });\n }\n\n private createMiddleware(): ComputePositionConfig['middleware'] {\n const middleware: ComputePositionConfig['middleware'] = [\n offset(this.config.offset!)\n ];\n\n if (this.config.sync) {\n middleware.push(\n size({\n apply: ({ elements, availableWidth, availableHeight }) => {\n if (this.config.sync === 'width' || this.config.sync === 'both') {\n elements.floating.style.width = `${availableWidth}px`;\n }\n if (this.config.sync === 'height' || this.config.sync === 'both') {\n elements.floating.style.height = `${availableHeight}px`;\n }\n },\n padding: this.config.padding,\n boundary: this.config.boundary\n })\n );\n }\n\n if (this.config.flip) {\n middleware.push(\n flip({\n fallbackPlacements: ['bottom', 'top', 'bottom-start', 'top-start'],\n boundary: this.config.boundary,\n padding: this.config.padding\n })\n );\n }\n\n if (this.config.shift) {\n middleware.push(\n shift({\n boundary: this.config.boundary,\n padding: this.config.padding\n })\n );\n }\n\n return middleware;\n }\n\n private applyPosition(\n floatingElement: HTMLElement,\n x: number,\n y: number,\n placement: Placement,\n middlewareData: MiddlewareData\n ): void {\n Object.assign(floatingElement.style, {\n left: `${x}px`,\n top: `${y}px`,\n position: this.config.strategy!,\n pointerEvents: 'auto'\n });\n\n this.currentPlacement = placement;\n this.currentMiddlewareData = middlewareData;\n }\n\n private fallbackPositioning(): void {\n if (!this.portalContainer) return;\n\n const referenceElement = this.contentHandler.getReferenceElement();\n const rect = referenceElement.getBoundingClientRect();\n \n this.portalContainer.style.left = `${rect.left}px`;\n this.portalContainer.style.top = `${rect.bottom + 4}px`;\n this.portalContainer.style.width = `${rect.width}px`;\n this.portalContainer.style.pointerEvents = 'auto';\n }\n\n private setupAutoUpdate(): void {\n if (!this.portalContainer) return;\n\n this.cleanupAutoUpdate = autoUpdate(\n this.contentHandler.getReferenceElement(),\n this.portalContainer,\n () => this.positionPortal(),\n {\n ancestorScroll: true,\n ancestorResize: true,\n elementResize: true,\n layoutShift: true\n }\n );\n }\n\n private injectStyles(): void {\n const styles = this.contentHandler.getComponentStyles();\n if (!styles) return;\n\n // Extract and inject styles into document\n const styleId = `nile-portal-styles-${Date.now()}`;\n \n if (document.getElementById(styleId)) return;\n\n const styleElement = document.createElement('style');\n styleElement.id = styleId;\n styleElement.textContent = this.extractStylesAsCSS(styles);\n \n document.head.appendChild(styleElement);\n \n if (this.portalContainer) {\n (this.portalContainer as any).__injectedStyleId = styleId;\n }\n }\n\n private extractStylesAsCSS(styles: CSSResultGroup): string {\n if (Array.isArray(styles)) {\n return styles.map(style => {\n if ('cssText' in style) {\n return style.cssText;\n }\n return style.toString();\n }).join('\\n');\n }\n \n if ('cssText' in styles) {\n return styles.cssText;\n }\n return styles.toString();\n }\n\n get portalElement(): HTMLElement | null {\n return this.portalContainer;\n }\n\n getCurrentPlacement(): Placement {\n return this.currentPlacement;\n }\n\n getCurrentMiddlewareData(): MiddlewareData | null {\n return this.currentMiddlewareData;\n }\n\n isActive(): boolean {\n return this.portalContainer !== null;\n }\n}\n"]}
@@ -1,60 +0,0 @@
1
- /**
2
- * Copyright Aquera Inc 2023
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 type { LitElement } from 'lit';
8
- export declare class PortalManager {
9
- private component;
10
- private portalContainer;
11
- private originalListboxParent;
12
- private measuredPopupHeight;
13
- private listboxSelector;
14
- private portalClassName;
15
- constructor(component: LitElement, listboxSelector?: string, portalClassName?: string);
16
- /**
17
- * Creates a portal container with proper styling
18
- */
19
- private createPortalContainer;
20
- /**
21
- * Positions the portal container relative to the component
22
- */
23
- private positionPortal;
24
- /**
25
- * Updates portal position (called on window resize/scroll)
26
- */
27
- updatePortalPosition(): void;
28
- /**
29
- * Updates portal content (called when content changes)
30
- */
31
- updatePortalContent(): void;
32
- /**
33
- * Injects component styles into document head for portal containers
34
- */
35
- private injectStylesToDocument;
36
- /**
37
- * Extracts styles as CSS string from various style formats
38
- */
39
- private extractStylesAsCSS;
40
- /**
41
- * Sets up the portal by moving the listbox to document body
42
- */
43
- setupPortal(): void;
44
- /**
45
- * Cleans up the portal by restoring the listbox to its original position
46
- */
47
- cleanupPortal(): void;
48
- /**
49
- * Resets the measured height (call when content changes)
50
- */
51
- resetMeasuredHeight(): void;
52
- /**
53
- * Gets the portal container element
54
- */
55
- getPortalContainer(): HTMLElement | null;
56
- /**
57
- * Checks if portal is currently active
58
- */
59
- isPortalActive(): boolean;
60
- }
@@ -1,199 +0,0 @@
1
- /**
2
- * Copyright Aquera Inc 2023
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 class PortalManager {
8
- constructor(component, listboxSelector = '#listbox', portalClassName = 'nile-portal-append') {
9
- this.portalContainer = null;
10
- this.originalListboxParent = null;
11
- this.measuredPopupHeight = null;
12
- this.component = component;
13
- this.listboxSelector = listboxSelector;
14
- this.portalClassName = portalClassName;
15
- }
16
- /**
17
- * Creates a portal container with proper styling
18
- */
19
- createPortalContainer() {
20
- const container = document.createElement('div');
21
- container.style.position = 'absolute';
22
- container.style.zIndex = '9999';
23
- container.style.pointerEvents = 'none';
24
- container.className = this.portalClassName;
25
- // Apply additional styling to match the original popup
26
- container.style.background = 'white';
27
- container.style.border = '1px solid #e0e0e0';
28
- container.style.borderRadius = '4px';
29
- container.style.boxShadow = '0 4px 6px rgba(0, 0, 0, 0.1)';
30
- container.style.maxHeight = '300px';
31
- container.style.overflow = 'hidden';
32
- return container;
33
- }
34
- /**
35
- * Positions the portal container relative to the component
36
- */
37
- positionPortal() {
38
- if (!this.portalContainer)
39
- return;
40
- const rect = this.component.getBoundingClientRect();
41
- const viewportHeight = window.innerHeight;
42
- const estimatedPopupHeight = 300; // Fallback estimate
43
- // If this is the first positioning, measure actual height
44
- if (!this.measuredPopupHeight && this.portalContainer) {
45
- // Temporarily position the container to measure its height
46
- this.portalContainer.style.position = 'absolute';
47
- this.portalContainer.style.visibility = 'hidden';
48
- this.portalContainer.style.top = '0px';
49
- this.portalContainer.style.left = '0px';
50
- // Force a reflow to ensure the container is rendered
51
- this.portalContainer.offsetHeight;
52
- // Measure the actual height
53
- this.measuredPopupHeight = this.portalContainer.offsetHeight;
54
- // Reset visibility
55
- this.portalContainer.style.visibility = '';
56
- }
57
- // Use measured height or fallback to estimate
58
- const popupHeight = this.measuredPopupHeight || estimatedPopupHeight;
59
- // Calculate available space above and below
60
- const spaceBelow = viewportHeight - rect.bottom;
61
- const spaceAbove = rect.top;
62
- let topPosition;
63
- let placementClass;
64
- // Smart positioning: flip to top if insufficient space below and more space above
65
- if (spaceBelow < popupHeight && spaceAbove > spaceBelow) {
66
- // Open upward
67
- topPosition = rect.top - popupHeight - 6;
68
- placementClass = 'top';
69
- }
70
- else {
71
- // Open downward
72
- topPosition = rect.bottom + 6;
73
- placementClass = 'bottom';
74
- }
75
- // Apply positioning
76
- this.portalContainer.style.left = `${rect.left}px`;
77
- this.portalContainer.style.top = `${topPosition}px`;
78
- this.portalContainer.style.width = `${rect.width}px`;
79
- this.portalContainer.style.pointerEvents = 'auto';
80
- // Update placement class for styling
81
- this.portalContainer.className = `${this.portalClassName} select__listbox--${placementClass}`;
82
- }
83
- /**
84
- * Updates portal position (called on window resize/scroll)
85
- */
86
- updatePortalPosition() {
87
- if (this.portalContainer) {
88
- this.positionPortal();
89
- }
90
- }
91
- /**
92
- * Updates portal content (called when content changes)
93
- */
94
- updatePortalContent() {
95
- if (this.portalContainer) {
96
- this.positionPortal();
97
- }
98
- }
99
- /**
100
- * Injects component styles into document head for portal containers
101
- */
102
- injectStylesToDocument() {
103
- if (!this.portalContainer)
104
- return;
105
- // Create a unique identifier for this component instance
106
- const styleId = `nile-portal-styles-${Math.random().toString(36).substr(2, 9)}`;
107
- // Check if styles are already injected
108
- if (document.getElementById(styleId))
109
- return;
110
- // Get the component's styles
111
- const componentStyles = this.component.constructor.styles;
112
- if (!componentStyles)
113
- return;
114
- // Create a style element
115
- const styleElement = document.createElement('style');
116
- styleElement.id = styleId;
117
- styleElement.textContent = this.extractStylesAsCSS(componentStyles);
118
- // Inject into document head
119
- document.head.appendChild(styleElement);
120
- // Store reference for cleanup
121
- this.portalContainer.__injectedStyleId = styleId;
122
- }
123
- /**
124
- * Extracts styles as CSS string from various style formats
125
- */
126
- extractStylesAsCSS(styles) {
127
- if (typeof styles === 'string') {
128
- return styles;
129
- }
130
- if (Array.isArray(styles)) {
131
- return styles.map(style => this.extractStylesAsCSS(style)).join('\n');
132
- }
133
- if (styles && typeof styles === 'object' && styles.cssText) {
134
- return styles.cssText;
135
- }
136
- return '';
137
- }
138
- /**
139
- * Sets up the portal by moving the listbox to document body
140
- */
141
- setupPortal() {
142
- this.component.updateComplete.then(() => {
143
- const listbox = this.component.shadowRoot?.querySelector(this.listboxSelector);
144
- if (listbox) {
145
- this.originalListboxParent = listbox.parentElement;
146
- this.portalContainer = this.createPortalContainer();
147
- this.portalContainer.appendChild(listbox);
148
- document.body.appendChild(this.portalContainer);
149
- // Inject the component's styles to the body append container
150
- this.injectStylesToDocument();
151
- listbox.style.display = '';
152
- this.positionPortal();
153
- }
154
- });
155
- }
156
- /**
157
- * Cleans up the portal by restoring the listbox to its original position
158
- */
159
- cleanupPortal() {
160
- if (this.portalContainer && this.portalContainer.parentNode) {
161
- const listbox = this.portalContainer.querySelector(this.listboxSelector);
162
- if (listbox && this.originalListboxParent) {
163
- this.originalListboxParent.appendChild(listbox);
164
- listbox.style.display = '';
165
- }
166
- // Clean up injected styles if they exist
167
- const injectedStyleId = this.portalContainer.__injectedStyleId;
168
- if (injectedStyleId) {
169
- const styleElement = document.getElementById(injectedStyleId);
170
- if (styleElement) {
171
- styleElement.remove();
172
- }
173
- }
174
- this.portalContainer.parentNode.removeChild(this.portalContainer);
175
- }
176
- this.portalContainer = null;
177
- this.originalListboxParent = null;
178
- this.measuredPopupHeight = null;
179
- }
180
- /**
181
- * Resets the measured height (call when content changes)
182
- */
183
- resetMeasuredHeight() {
184
- this.measuredPopupHeight = null;
185
- }
186
- /**
187
- * Gets the portal container element
188
- */
189
- getPortalContainer() {
190
- return this.portalContainer;
191
- }
192
- /**
193
- * Checks if portal is currently active
194
- */
195
- isPortalActive() {
196
- return this.portalContainer !== null;
197
- }
198
- }
199
- //# sourceMappingURL=portal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"portal.js","sourceRoot":"","sources":["../../../src/internal/portal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,OAAO,aAAa;IAQxB,YAAY,SAAqB,EAAE,kBAA0B,UAAU,EAAE,kBAA0B,oBAAoB;QAN/G,oBAAe,GAAuB,IAAI,CAAC;QAC3C,0BAAqB,GAAuB,IAAI,CAAC;QACjD,wBAAmB,GAAkB,IAAI,CAAC;QAKhD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAED;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D,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAgB,CAAC;YAExF,IAAI,OAAO,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC1C,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAChD,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;YAC7B,CAAC;YAED,yCAAyC;YACzC,MAAM,eAAe,GAAI,IAAI,CAAC,eAAuB,CAAC,iBAAiB,CAAC;YACxE,IAAI,eAAe,EAAE,CAAC;gBACpB,MAAM,YAAY,GAAG,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;QACD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAClC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,KAAK,IAAI,CAAC;IACvC,CAAC;CACF","sourcesContent":["/**\n * Copyright Aquera Inc 2023\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\nimport type { LitElement } from 'lit';\n\nexport class PortalManager {\n private component: LitElement;\n private portalContainer: HTMLElement | null = null;\n private originalListboxParent: HTMLElement | null = null;\n private measuredPopupHeight: number | null = null;\n private listboxSelector: string;\n private portalClassName: string;\n\n constructor(component: LitElement, listboxSelector: string = '#listbox', portalClassName: string = 'nile-portal-append') {\n this.component = component;\n this.listboxSelector = listboxSelector;\n this.portalClassName = portalClassName;\n }\n\n /**\n * Creates a portal container with proper styling\n */\n private createPortalContainer(): 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 = this.portalClassName;\n \n // Apply additional styling to match the original popup\n container.style.background = 'white';\n container.style.border = '1px solid #e0e0e0';\n container.style.borderRadius = '4px';\n container.style.boxShadow = '0 4px 6px rgba(0, 0, 0, 0.1)';\n container.style.maxHeight = '300px';\n container.style.overflow = 'hidden';\n \n return container;\n }\n\n /**\n * Positions the portal container relative to the component\n */\n private positionPortal(): void {\n if (!this.portalContainer) return;\n\n const rect = this.component.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const estimatedPopupHeight = 300; // Fallback estimate\n \n // If this is the first positioning, measure actual height\n if (!this.measuredPopupHeight && this.portalContainer) {\n // Temporarily position the container to measure its height\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 // Force a reflow to ensure the container is rendered\n this.portalContainer.offsetHeight;\n \n // Measure the actual height\n this.measuredPopupHeight = this.portalContainer.offsetHeight;\n \n // Reset visibility\n this.portalContainer.style.visibility = '';\n }\n \n // Use measured height or fallback to estimate\n const popupHeight = this.measuredPopupHeight || estimatedPopupHeight;\n \n // Calculate available space above and below\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n \n let topPosition: number;\n let placementClass: string;\n \n // Smart positioning: flip to top if insufficient space below and more space above\n if (spaceBelow < popupHeight && spaceAbove > spaceBelow) {\n // Open upward\n topPosition = rect.top - popupHeight - 6;\n placementClass = 'top';\n } else {\n // Open downward\n topPosition = rect.bottom + 6;\n placementClass = 'bottom';\n }\n \n // Apply positioning\n this.portalContainer.style.left = `${rect.left}px`;\n this.portalContainer.style.top = `${topPosition}px`;\n this.portalContainer.style.width = `${rect.width}px`;\n this.portalContainer.style.pointerEvents = 'auto';\n \n // Update placement class for styling\n this.portalContainer.className = `${this.portalClassName} select__listbox--${placementClass}`;\n }\n\n /**\n * Updates portal position (called on window resize/scroll)\n */\n updatePortalPosition(): void {\n if (this.portalContainer) {\n this.positionPortal();\n }\n }\n\n /**\n * Updates portal content (called when content changes)\n */\n updatePortalContent(): void {\n if (this.portalContainer) {\n this.positionPortal();\n }\n }\n\n /**\n * Injects component styles into document head for portal containers\n */\n private injectStylesToDocument(): void {\n if (!this.portalContainer) return;\n\n // Create a unique identifier for this component instance\n const styleId = `nile-portal-styles-${Math.random().toString(36).substr(2, 9)}`;\n \n // Check if styles are already injected\n if (document.getElementById(styleId)) return;\n\n // Get the component's styles\n const componentStyles = (this.component.constructor as any).styles;\n if (!componentStyles) return;\n\n // Create a style element\n const styleElement = document.createElement('style');\n styleElement.id = styleId;\n styleElement.textContent = this.extractStylesAsCSS(componentStyles);\n \n // Inject into document head\n document.head.appendChild(styleElement);\n \n // Store reference for cleanup\n (this.portalContainer as any).__injectedStyleId = styleId;\n }\n\n /**\n * Extracts styles as CSS string from various style formats\n */\n private extractStylesAsCSS(styles: any): string {\n if (typeof styles === 'string') {\n return styles;\n }\n \n if (Array.isArray(styles)) {\n return styles.map(style => this.extractStylesAsCSS(style)).join('\\n');\n }\n \n if (styles && typeof styles === 'object' && styles.cssText) {\n return styles.cssText;\n }\n \n return '';\n }\n\n /**\n * Sets up the portal by moving the listbox to document body\n */\n setupPortal(): void {\n this.component.updateComplete.then(() => {\n const listbox = this.component.shadowRoot?.querySelector(this.listboxSelector) as HTMLElement;\n if (listbox) {\n this.originalListboxParent = listbox.parentElement as HTMLElement;\n \n this.portalContainer = this.createPortalContainer();\n this.portalContainer.appendChild(listbox);\n document.body.appendChild(this.portalContainer);\n \n // Inject the component's styles to the body append container\n this.injectStylesToDocument();\n \n listbox.style.display = '';\n this.positionPortal();\n }\n });\n }\n\n /**\n * Cleans up the portal by restoring the listbox to its original position\n */\n cleanupPortal(): void {\n if (this.portalContainer && this.portalContainer.parentNode) {\n const listbox = this.portalContainer.querySelector(this.listboxSelector) as HTMLElement;\n \n if (listbox && this.originalListboxParent) {\n this.originalListboxParent.appendChild(listbox);\n listbox.style.display = '';\n }\n \n // Clean up injected styles if they exist\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 this.portalContainer = null;\n this.originalListboxParent = null;\n this.measuredPopupHeight = null;\n }\n\n /**\n * Resets the measured height (call when content changes)\n */\n resetMeasuredHeight(): void {\n this.measuredPopupHeight = null;\n }\n\n /**\n * Gets the portal container element\n */\n getPortalContainer(): HTMLElement | null {\n return this.portalContainer;\n }\n\n /**\n * Checks if portal is currently active\n */\n isPortalActive(): boolean {\n return this.portalContainer !== null;\n }\n}\n"]}
@@ -1,59 +0,0 @@
1
- /**
2
- * Copyright Aquera Inc 2023
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
- /**
8
- * Resizable Helper Utility
9
- * Provides common functionality for resizable table columns
10
- */
11
- export interface ResizeOptions {
12
- minWidth?: number;
13
- startX: number;
14
- startWidth: number;
15
- element: HTMLElement;
16
- }
17
- export interface ColumnResizeData {
18
- columnIndex: number;
19
- newWidth: number;
20
- }
21
- /**
22
- * Handles the start of a resize operation
23
- * @param e Mouse event
24
- * @param options Resize configuration options
25
- * @returns Cleanup function to remove event listeners
26
- */
27
- export declare function handleResizeStart(e: MouseEvent, options: ResizeOptions): () => void;
28
- /**
29
- * Gets the column index of an element within its table row
30
- * @param element The table cell or header element
31
- * @param selector The CSS selector for the column elements
32
- * @returns Column index (0-based)
33
- */
34
- export declare function getColumnIndex(element: HTMLElement, selector: string): number;
35
- /**
36
- * Synchronizes the width of all cells in the same column
37
- * @param sourceElement The element that was resized
38
- * @param newWidth The new width to apply
39
- */
40
- export declare function synchronizeColumnWidth(sourceElement: HTMLElement, newWidth: number): void;
41
- /**
42
- * Checks if an element has the resizable attribute
43
- * @param element The element to check
44
- * @returns True if the element is resizable
45
- */
46
- export declare function isResizable(element: HTMLElement): boolean;
47
- /**
48
- * Creates a resize handler function for use in component event listeners
49
- * @param element The element to make resizable
50
- * @param minWidth Minimum width constraint
51
- * @returns Event handler function
52
- */
53
- export declare function createResizeHandler(element: HTMLElement, minWidth?: number): (e: MouseEvent) => void;
54
- /**
55
- * Detects if any columns in a table are resizable
56
- * @param tableBody The table body element
57
- * @returns True if any columns have resizable attribute
58
- */
59
- export declare function hasResizableColumns(tableBody: HTMLElement): boolean;