@solid2-aria/stately 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -2
  3. package/dist/LICENSES/Apache-2.0.txt +201 -0
  4. package/dist/LICENSES/react-spectrum-NOTICE.txt +242 -0
  5. package/dist/NOTICE.txt +636 -0
  6. package/dist/autocomplete/create-autocomplete-state.d.ts +46 -0
  7. package/dist/autocomplete/create-autocomplete-state.js +41 -0
  8. package/dist/autocomplete/create-autocomplete-state.js.map +1 -0
  9. package/dist/calendar/create-calendar-state.d.ts +62 -0
  10. package/dist/calendar/create-calendar-state.js +357 -0
  11. package/dist/calendar/create-calendar-state.js.map +1 -0
  12. package/dist/calendar/create-range-calendar-state.d.ts +63 -0
  13. package/dist/calendar/create-range-calendar-state.js +204 -0
  14. package/dist/calendar/create-range-calendar-state.js.map +1 -0
  15. package/dist/calendar/types.d.ts +222 -0
  16. package/dist/calendar/types.js +16 -0
  17. package/dist/calendar/utils.d.ts +27 -0
  18. package/dist/calendar/utils.js +81 -0
  19. package/dist/calendar/utils.js.map +1 -0
  20. package/dist/checkbox/create-checkbox-group-state.d.ts +60 -0
  21. package/dist/checkbox/create-checkbox-group-state.js +88 -0
  22. package/dist/checkbox/create-checkbox-group-state.js.map +1 -0
  23. package/dist/collections/collection-builder.d.ts +28 -0
  24. package/dist/collections/collection-builder.js +164 -0
  25. package/dist/collections/collection-builder.js.map +1 -0
  26. package/dist/collections/create-collection.d.ts +24 -0
  27. package/dist/collections/create-collection.js +35 -0
  28. package/dist/collections/create-collection.js.map +1 -0
  29. package/dist/collections/get-child-nodes.d.ts +25 -0
  30. package/dist/collections/get-child-nodes.js +67 -0
  31. package/dist/collections/get-child-nodes.js.map +1 -0
  32. package/dist/collections/get-item-count.d.ts +19 -0
  33. package/dist/collections/get-item-count.js +34 -0
  34. package/dist/collections/get-item-count.js.map +1 -0
  35. package/dist/collections/item.d.ts +29 -0
  36. package/dist/collections/item.js +68 -0
  37. package/dist/collections/item.js.map +1 -0
  38. package/dist/collections/section.d.ts +29 -0
  39. package/dist/collections/section.js +60 -0
  40. package/dist/collections/section.js.map +1 -0
  41. package/dist/collections/types.d.ts +46 -0
  42. package/dist/collections/types.js +29 -0
  43. package/dist/collections/types.js.map +1 -0
  44. package/dist/color/color/base-color.d.ts +40 -0
  45. package/dist/color/color/base-color.js +122 -0
  46. package/dist/color/color/base-color.js.map +1 -0
  47. package/dist/color/color/color-classes.d.ts +27 -0
  48. package/dist/color/color/color-classes.js +29 -0
  49. package/dist/color/color/color-classes.js.map +1 -0
  50. package/dist/color/color/color-constructors.d.ts +23 -0
  51. package/dist/color/color/color-constructors.js +16 -0
  52. package/dist/color/color/color.d.ts +3 -0
  53. package/dist/color/color/color.js +2 -0
  54. package/dist/color/color/hsb-color.d.ts +24 -0
  55. package/dist/color/color/hsb-color.js +183 -0
  56. package/dist/color/color/hsb-color.js.map +1 -0
  57. package/dist/color/color/hsl-color.d.ts +24 -0
  58. package/dist/color/color/hsl-color.js +184 -0
  59. package/dist/color/color/hsl-color.js.map +1 -0
  60. package/dist/color/color/normalize-hue.d.ts +18 -0
  61. package/dist/color/color/normalize-hue.js +24 -0
  62. package/dist/color/color/normalize-hue.js.map +1 -0
  63. package/dist/color/color/oklch.d.ts +19 -0
  64. package/dist/color/color/oklch.js +97 -0
  65. package/dist/color/color/oklch.js.map +1 -0
  66. package/dist/color/color/rgb-color.d.ts +24 -0
  67. package/dist/color/color/rgb-color.js +230 -0
  68. package/dist/color/color/rgb-color.js.map +1 -0
  69. package/dist/color/color.d.ts +25 -0
  70. package/dist/color/color.js +41 -0
  71. package/dist/color/color.js.map +1 -0
  72. package/dist/color/create-color-area-state.d.ts +105 -0
  73. package/dist/color/create-color-area-state.js +138 -0
  74. package/dist/color/create-color-area-state.js.map +1 -0
  75. package/dist/color/create-color-channel-field-state.d.ts +29 -0
  76. package/dist/color/create-color-channel-field-state.js +69 -0
  77. package/dist/color/create-color-channel-field-state.js.map +1 -0
  78. package/dist/color/create-color-field-state.d.ts +61 -0
  79. package/dist/color/create-color-field-state.js +113 -0
  80. package/dist/color/create-color-field-state.js.map +1 -0
  81. package/dist/color/create-color-picker-state.d.ts +16 -0
  82. package/dist/color/create-color-picker-state.js +26 -0
  83. package/dist/color/create-color-picker-state.js.map +1 -0
  84. package/dist/color/create-color-slider-state.d.ts +50 -0
  85. package/dist/color/create-color-slider-state.js +93 -0
  86. package/dist/color/create-color-slider-state.js.map +1 -0
  87. package/dist/color/create-color-wheel-state.d.ts +76 -0
  88. package/dist/color/create-color-wheel-state.js +130 -0
  89. package/dist/color/create-color-wheel-state.js.map +1 -0
  90. package/dist/color/create-color.d.ts +20 -0
  91. package/dist/color/create-color.js +33 -0
  92. package/dist/color/create-color.js.map +1 -0
  93. package/dist/color/types.d.ts +87 -0
  94. package/dist/color/types.js +5 -0
  95. package/dist/combobox/create-combo-box-state.d.ts +157 -0
  96. package/dist/combobox/create-combo-box-state.js +450 -0
  97. package/dist/combobox/create-combo-box-state.js.map +1 -0
  98. package/dist/data/create-async-list.d.ts +88 -0
  99. package/dist/data/create-async-list.js +276 -0
  100. package/dist/data/create-async-list.js.map +1 -0
  101. package/dist/data/create-list-data.d.ts +140 -0
  102. package/dist/data/create-list-data.js +250 -0
  103. package/dist/data/create-list-data.js.map +1 -0
  104. package/dist/data/create-tree-data.d.ts +134 -0
  105. package/dist/data/create-tree-data.js +364 -0
  106. package/dist/data/create-tree-data.js.map +1 -0
  107. package/dist/datepicker/create-date-field-state.d.ts +138 -0
  108. package/dist/datepicker/create-date-field-state.js +449 -0
  109. package/dist/datepicker/create-date-field-state.js.map +1 -0
  110. package/dist/datepicker/create-date-picker-state.d.ts +82 -0
  111. package/dist/datepicker/create-date-picker-state.js +191 -0
  112. package/dist/datepicker/create-date-picker-state.js.map +1 -0
  113. package/dist/datepicker/create-date-range-picker-state.d.ts +97 -0
  114. package/dist/datepicker/create-date-range-picker-state.js +305 -0
  115. package/dist/datepicker/create-date-range-picker-state.js.map +1 -0
  116. package/dist/datepicker/create-time-field-state.d.ts +34 -0
  117. package/dist/datepicker/create-time-field-state.js +128 -0
  118. package/dist/datepicker/create-time-field-state.js.map +1 -0
  119. package/dist/datepicker/incomplete-date.d.ts +71 -0
  120. package/dist/datepicker/incomplete-date.js +324 -0
  121. package/dist/datepicker/incomplete-date.js.map +1 -0
  122. package/dist/datepicker/placeholders.d.ts +18 -0
  123. package/dist/datepicker/placeholders.js +418 -0
  124. package/dist/datepicker/placeholders.js.map +1 -0
  125. package/dist/datepicker/types.d.ts +131 -0
  126. package/dist/datepicker/types.js +16 -0
  127. package/dist/datepicker/utils.d.ts +37 -0
  128. package/dist/datepicker/utils.js +168 -0
  129. package/dist/datepicker/utils.js.map +1 -0
  130. package/dist/disclosure/create-disclosure-group-state.d.ts +47 -0
  131. package/dist/disclosure/create-disclosure-group-state.js +62 -0
  132. package/dist/disclosure/create-disclosure-group-state.js.map +1 -0
  133. package/dist/disclosure/create-disclosure-state.d.ts +42 -0
  134. package/dist/disclosure/create-disclosure-state.js +49 -0
  135. package/dist/disclosure/create-disclosure-state.js.map +1 -0
  136. package/dist/dnd/create-draggable-collection-state.d.ts +63 -0
  137. package/dist/dnd/create-draggable-collection-state.js +136 -0
  138. package/dist/dnd/create-draggable-collection-state.js.map +1 -0
  139. package/dist/dnd/create-droppable-collection-state.d.ts +55 -0
  140. package/dist/dnd/create-droppable-collection-state.js +155 -0
  141. package/dist/dnd/create-droppable-collection-state.js.map +1 -0
  142. package/dist/flags/flags.d.ts +21 -0
  143. package/dist/flags/flags.js +34 -0
  144. package/dist/flags/flags.js.map +1 -0
  145. package/dist/form/create-form-validation-state.d.ts +37 -0
  146. package/dist/form/create-form-validation-state.js +152 -0
  147. package/dist/form/create-form-validation-state.js.map +1 -0
  148. package/dist/grid/create-grid-state.d.ts +38 -0
  149. package/dist/grid/create-grid-state.js +85 -0
  150. package/dist/grid/create-grid-state.js.map +1 -0
  151. package/dist/grid/grid-collection.d.ts +68 -0
  152. package/dist/grid/grid-collection.js +133 -0
  153. package/dist/grid/grid-collection.js.map +1 -0
  154. package/dist/index.d.ts +91 -0
  155. package/dist/index.js +86 -0
  156. package/dist/intl/color/ar-AE.js +44 -0
  157. package/dist/intl/color/ar-AE.js.map +1 -0
  158. package/dist/intl/color/bg-BG.js +44 -0
  159. package/dist/intl/color/bg-BG.js.map +1 -0
  160. package/dist/intl/color/cs-CZ.js +44 -0
  161. package/dist/intl/color/cs-CZ.js.map +1 -0
  162. package/dist/intl/color/da-DK.js +44 -0
  163. package/dist/intl/color/da-DK.js.map +1 -0
  164. package/dist/intl/color/de-DE.js +44 -0
  165. package/dist/intl/color/de-DE.js.map +1 -0
  166. package/dist/intl/color/el-GR.js +44 -0
  167. package/dist/intl/color/el-GR.js.map +1 -0
  168. package/dist/intl/color/en-US.js +44 -0
  169. package/dist/intl/color/en-US.js.map +1 -0
  170. package/dist/intl/color/es-ES.js +44 -0
  171. package/dist/intl/color/es-ES.js.map +1 -0
  172. package/dist/intl/color/et-EE.js +44 -0
  173. package/dist/intl/color/et-EE.js.map +1 -0
  174. package/dist/intl/color/fi-FI.js +44 -0
  175. package/dist/intl/color/fi-FI.js.map +1 -0
  176. package/dist/intl/color/fr-FR.js +44 -0
  177. package/dist/intl/color/fr-FR.js.map +1 -0
  178. package/dist/intl/color/he-IL.js +44 -0
  179. package/dist/intl/color/he-IL.js.map +1 -0
  180. package/dist/intl/color/hr-HR.js +44 -0
  181. package/dist/intl/color/hr-HR.js.map +1 -0
  182. package/dist/intl/color/hu-HU.js +44 -0
  183. package/dist/intl/color/hu-HU.js.map +1 -0
  184. package/dist/intl/color/index.js +75 -0
  185. package/dist/intl/color/index.js.map +1 -0
  186. package/dist/intl/color/it-IT.js +44 -0
  187. package/dist/intl/color/it-IT.js.map +1 -0
  188. package/dist/intl/color/ja-JP.js +44 -0
  189. package/dist/intl/color/ja-JP.js.map +1 -0
  190. package/dist/intl/color/ko-KR.js +44 -0
  191. package/dist/intl/color/ko-KR.js.map +1 -0
  192. package/dist/intl/color/lt-LT.js +44 -0
  193. package/dist/intl/color/lt-LT.js.map +1 -0
  194. package/dist/intl/color/lv-LV.js +44 -0
  195. package/dist/intl/color/lv-LV.js.map +1 -0
  196. package/dist/intl/color/nb-NO.js +44 -0
  197. package/dist/intl/color/nb-NO.js.map +1 -0
  198. package/dist/intl/color/nl-NL.js +44 -0
  199. package/dist/intl/color/nl-NL.js.map +1 -0
  200. package/dist/intl/color/pl-PL.js +44 -0
  201. package/dist/intl/color/pl-PL.js.map +1 -0
  202. package/dist/intl/color/pt-BR.js +44 -0
  203. package/dist/intl/color/pt-BR.js.map +1 -0
  204. package/dist/intl/color/pt-PT.js +44 -0
  205. package/dist/intl/color/pt-PT.js.map +1 -0
  206. package/dist/intl/color/ro-RO.js +44 -0
  207. package/dist/intl/color/ro-RO.js.map +1 -0
  208. package/dist/intl/color/ru-RU.js +44 -0
  209. package/dist/intl/color/ru-RU.js.map +1 -0
  210. package/dist/intl/color/sk-SK.js +44 -0
  211. package/dist/intl/color/sk-SK.js.map +1 -0
  212. package/dist/intl/color/sl-SI.js +44 -0
  213. package/dist/intl/color/sl-SI.js.map +1 -0
  214. package/dist/intl/color/sr-SP.js +44 -0
  215. package/dist/intl/color/sr-SP.js.map +1 -0
  216. package/dist/intl/color/sv-SE.js +44 -0
  217. package/dist/intl/color/sv-SE.js.map +1 -0
  218. package/dist/intl/color/tr-TR.js +44 -0
  219. package/dist/intl/color/tr-TR.js.map +1 -0
  220. package/dist/intl/color/uk-UA.js +44 -0
  221. package/dist/intl/color/uk-UA.js.map +1 -0
  222. package/dist/intl/color/zh-CN.js +44 -0
  223. package/dist/intl/color/zh-CN.js.map +1 -0
  224. package/dist/intl/color/zh-TW.js +44 -0
  225. package/dist/intl/color/zh-TW.js.map +1 -0
  226. package/dist/intl/datepicker/ar-AE.js +11 -0
  227. package/dist/intl/datepicker/ar-AE.js.map +1 -0
  228. package/dist/intl/datepicker/bg-BG.js +11 -0
  229. package/dist/intl/datepicker/bg-BG.js.map +1 -0
  230. package/dist/intl/datepicker/cs-CZ.js +11 -0
  231. package/dist/intl/datepicker/cs-CZ.js.map +1 -0
  232. package/dist/intl/datepicker/da-DK.js +11 -0
  233. package/dist/intl/datepicker/da-DK.js.map +1 -0
  234. package/dist/intl/datepicker/de-DE.js +11 -0
  235. package/dist/intl/datepicker/de-DE.js.map +1 -0
  236. package/dist/intl/datepicker/el-GR.js +11 -0
  237. package/dist/intl/datepicker/el-GR.js.map +1 -0
  238. package/dist/intl/datepicker/en-US.js +11 -0
  239. package/dist/intl/datepicker/en-US.js.map +1 -0
  240. package/dist/intl/datepicker/es-ES.js +11 -0
  241. package/dist/intl/datepicker/es-ES.js.map +1 -0
  242. package/dist/intl/datepicker/et-EE.js +11 -0
  243. package/dist/intl/datepicker/et-EE.js.map +1 -0
  244. package/dist/intl/datepicker/fi-FI.js +11 -0
  245. package/dist/intl/datepicker/fi-FI.js.map +1 -0
  246. package/dist/intl/datepicker/fr-FR.js +11 -0
  247. package/dist/intl/datepicker/fr-FR.js.map +1 -0
  248. package/dist/intl/datepicker/he-IL.js +11 -0
  249. package/dist/intl/datepicker/he-IL.js.map +1 -0
  250. package/dist/intl/datepicker/hr-HR.js +11 -0
  251. package/dist/intl/datepicker/hr-HR.js.map +1 -0
  252. package/dist/intl/datepicker/hu-HU.js +11 -0
  253. package/dist/intl/datepicker/hu-HU.js.map +1 -0
  254. package/dist/intl/datepicker/index.js +75 -0
  255. package/dist/intl/datepicker/index.js.map +1 -0
  256. package/dist/intl/datepicker/it-IT.js +11 -0
  257. package/dist/intl/datepicker/it-IT.js.map +1 -0
  258. package/dist/intl/datepicker/ja-JP.js +11 -0
  259. package/dist/intl/datepicker/ja-JP.js.map +1 -0
  260. package/dist/intl/datepicker/ko-KR.js +11 -0
  261. package/dist/intl/datepicker/ko-KR.js.map +1 -0
  262. package/dist/intl/datepicker/lt-LT.js +11 -0
  263. package/dist/intl/datepicker/lt-LT.js.map +1 -0
  264. package/dist/intl/datepicker/lv-LV.js +11 -0
  265. package/dist/intl/datepicker/lv-LV.js.map +1 -0
  266. package/dist/intl/datepicker/nb-NO.js +11 -0
  267. package/dist/intl/datepicker/nb-NO.js.map +1 -0
  268. package/dist/intl/datepicker/nl-NL.js +11 -0
  269. package/dist/intl/datepicker/nl-NL.js.map +1 -0
  270. package/dist/intl/datepicker/pl-PL.js +11 -0
  271. package/dist/intl/datepicker/pl-PL.js.map +1 -0
  272. package/dist/intl/datepicker/pt-BR.js +11 -0
  273. package/dist/intl/datepicker/pt-BR.js.map +1 -0
  274. package/dist/intl/datepicker/pt-PT.js +11 -0
  275. package/dist/intl/datepicker/pt-PT.js.map +1 -0
  276. package/dist/intl/datepicker/ro-RO.js +11 -0
  277. package/dist/intl/datepicker/ro-RO.js.map +1 -0
  278. package/dist/intl/datepicker/ru-RU.js +11 -0
  279. package/dist/intl/datepicker/ru-RU.js.map +1 -0
  280. package/dist/intl/datepicker/sk-SK.js +11 -0
  281. package/dist/intl/datepicker/sk-SK.js.map +1 -0
  282. package/dist/intl/datepicker/sl-SI.js +11 -0
  283. package/dist/intl/datepicker/sl-SI.js.map +1 -0
  284. package/dist/intl/datepicker/sr-SP.js +11 -0
  285. package/dist/intl/datepicker/sr-SP.js.map +1 -0
  286. package/dist/intl/datepicker/sv-SE.js +11 -0
  287. package/dist/intl/datepicker/sv-SE.js.map +1 -0
  288. package/dist/intl/datepicker/tr-TR.js +11 -0
  289. package/dist/intl/datepicker/tr-TR.js.map +1 -0
  290. package/dist/intl/datepicker/uk-UA.js +11 -0
  291. package/dist/intl/datepicker/uk-UA.js.map +1 -0
  292. package/dist/intl/datepicker/zh-CN.js +11 -0
  293. package/dist/intl/datepicker/zh-CN.js.map +1 -0
  294. package/dist/intl/datepicker/zh-TW.js +11 -0
  295. package/dist/intl/datepicker/zh-TW.js.map +1 -0
  296. package/dist/layout/grid-layout.d.ts +107 -0
  297. package/dist/layout/grid-layout.js +253 -0
  298. package/dist/layout/grid-layout.js.map +1 -0
  299. package/dist/layout/list-layout.d.ts +187 -0
  300. package/dist/layout/list-layout.js +488 -0
  301. package/dist/layout/list-layout.js.map +1 -0
  302. package/dist/layout/table-layout.d.ts +98 -0
  303. package/dist/layout/table-layout.js +476 -0
  304. package/dist/layout/table-layout.js.map +1 -0
  305. package/dist/layout/waterfall-layout.d.ts +85 -0
  306. package/dist/layout/waterfall-layout.js +225 -0
  307. package/dist/layout/waterfall-layout.js.map +1 -0
  308. package/dist/list/create-list-state.d.ts +48 -0
  309. package/dist/list/create-list-state.js +123 -0
  310. package/dist/list/create-list-state.js.map +1 -0
  311. package/dist/list/create-single-select-list-state.d.ts +38 -0
  312. package/dist/list/create-single-select-list-state.js +55 -0
  313. package/dist/list/create-single-select-list-state.js.map +1 -0
  314. package/dist/list/list-collection.d.ts +36 -0
  315. package/dist/list/list-collection.js +91 -0
  316. package/dist/list/list-collection.js.map +1 -0
  317. package/dist/menu/create-menu-trigger-state.d.ts +55 -0
  318. package/dist/menu/create-menu-trigger-state.js +58 -0
  319. package/dist/menu/create-menu-trigger-state.js.map +1 -0
  320. package/dist/menu/create-submenu-trigger-state.d.ts +47 -0
  321. package/dist/menu/create-submenu-trigger-state.js +59 -0
  322. package/dist/menu/create-submenu-trigger-state.js.map +1 -0
  323. package/dist/numberfield/create-number-field-state.d.ts +93 -0
  324. package/dist/numberfield/create-number-field-state.js +139 -0
  325. package/dist/numberfield/create-number-field-state.js.map +1 -0
  326. package/dist/overlays/create-overlay-trigger-state.d.ts +51 -0
  327. package/dist/overlays/create-overlay-trigger-state.js +56 -0
  328. package/dist/overlays/create-overlay-trigger-state.js.map +1 -0
  329. package/dist/radio/create-radio-group-state.d.ts +61 -0
  330. package/dist/radio/create-radio-group-state.js +71 -0
  331. package/dist/radio/create-radio-group-state.js.map +1 -0
  332. package/dist/searchfield/create-search-field-state.d.ts +35 -0
  333. package/dist/searchfield/create-search-field-state.js +34 -0
  334. package/dist/searchfield/create-search-field-state.js.map +1 -0
  335. package/dist/select/create-select-state.d.ts +116 -0
  336. package/dist/select/create-select-state.js +151 -0
  337. package/dist/select/create-select-state.js.map +1 -0
  338. package/dist/selection/create-multiple-selection-state.d.ts +39 -0
  339. package/dist/selection/create-multiple-selection-state.js +114 -0
  340. package/dist/selection/create-multiple-selection-state.js.map +1 -0
  341. package/dist/selection/selection-manager.d.ts +139 -0
  342. package/dist/selection/selection-manager.js +334 -0
  343. package/dist/selection/selection-manager.js.map +1 -0
  344. package/dist/selection/selection.d.ts +27 -0
  345. package/dist/selection/selection.js +38 -0
  346. package/dist/selection/selection.js.map +1 -0
  347. package/dist/selection/types.d.ts +116 -0
  348. package/dist/selection/types.js +16 -0
  349. package/dist/slider/create-slider-state.d.ts +182 -0
  350. package/dist/slider/create-slider-state.js +131 -0
  351. package/dist/slider/create-slider-state.js.map +1 -0
  352. package/dist/steplist/create-step-list-state.d.ts +40 -0
  353. package/dist/steplist/create-step-list-state.js +132 -0
  354. package/dist/steplist/create-step-list-state.js.map +1 -0
  355. package/dist/table/cell.d.ts +37 -0
  356. package/dist/table/cell.js +47 -0
  357. package/dist/table/cell.js.map +1 -0
  358. package/dist/table/collection-context.d.ts +4 -0
  359. package/dist/table/collection-context.js +8 -0
  360. package/dist/table/collection-context.js.map +1 -0
  361. package/dist/table/column.d.ts +66 -0
  362. package/dist/table/column.js +71 -0
  363. package/dist/table/column.js.map +1 -0
  364. package/dist/table/create-table-column-resize-state.d.ts +65 -0
  365. package/dist/table/create-table-column-resize-state.js +100 -0
  366. package/dist/table/create-table-column-resize-state.js.map +1 -0
  367. package/dist/table/create-table-state.d.ts +112 -0
  368. package/dist/table/create-table-state.js +122 -0
  369. package/dist/table/create-table-state.js.map +1 -0
  370. package/dist/table/create-tree-grid-state.d.ts +44 -0
  371. package/dist/table/create-tree-grid-state.js +145 -0
  372. package/dist/table/create-tree-grid-state.js.map +1 -0
  373. package/dist/table/row.d.ts +44 -0
  374. package/dist/table/row.js +91 -0
  375. package/dist/table/row.js.map +1 -0
  376. package/dist/table/table-body.d.ts +36 -0
  377. package/dist/table/table-body.js +57 -0
  378. package/dist/table/table-body.js.map +1 -0
  379. package/dist/table/table-collection.d.ts +62 -0
  380. package/dist/table/table-collection.js +274 -0
  381. package/dist/table/table-collection.js.map +1 -0
  382. package/dist/table/table-column-layout.d.ts +47 -0
  383. package/dist/table/table-column-layout.js +94 -0
  384. package/dist/table/table-column-layout.js.map +1 -0
  385. package/dist/table/table-header.d.ts +37 -0
  386. package/dist/table/table-header.js +52 -0
  387. package/dist/table/table-header.js.map +1 -0
  388. package/dist/table/table-utils.d.ts +60 -0
  389. package/dist/table/table-utils.js +203 -0
  390. package/dist/table/table-utils.js.map +1 -0
  391. package/dist/tabs/create-tab-list-state.d.ts +42 -0
  392. package/dist/tabs/create-tab-list-state.js +78 -0
  393. package/dist/tabs/create-tab-list-state.js.map +1 -0
  394. package/dist/toast/create-toast-state.d.ts +97 -0
  395. package/dist/toast/create-toast-state.js +166 -0
  396. package/dist/toast/create-toast-state.js.map +1 -0
  397. package/dist/toggle/create-toggle-group-state.d.ts +55 -0
  398. package/dist/toggle/create-toggle-group-state.js +62 -0
  399. package/dist/toggle/create-toggle-group-state.js.map +1 -0
  400. package/dist/toggle/create-toggle-state.d.ts +58 -0
  401. package/dist/toggle/create-toggle-state.js +43 -0
  402. package/dist/toggle/create-toggle-state.js.map +1 -0
  403. package/dist/tokenfield/create-token-field-state.d.ts +39 -0
  404. package/dist/tokenfield/create-token-field-state.js +44 -0
  405. package/dist/tokenfield/create-token-field-state.js.map +1 -0
  406. package/dist/tokenfield/token-field-value.d.ts +111 -0
  407. package/dist/tokenfield/token-field-value.js +327 -0
  408. package/dist/tokenfield/token-field-value.js.map +1 -0
  409. package/dist/tooltip/create-tooltip-trigger-state.d.ts +73 -0
  410. package/dist/tooltip/create-tooltip-trigger-state.js +136 -0
  411. package/dist/tooltip/create-tooltip-trigger-state.js.map +1 -0
  412. package/dist/tree/create-tree-state.d.ts +42 -0
  413. package/dist/tree/create-tree-state.js +75 -0
  414. package/dist/tree/create-tree-state.js.map +1 -0
  415. package/dist/tree/tree-collection.d.ts +36 -0
  416. package/dist/tree/tree-collection.js +84 -0
  417. package/dist/tree/tree-collection.js.map +1 -0
  418. package/dist/utils/create-controlled-signal.d.ts +23 -0
  419. package/dist/utils/create-controlled-signal.js +54 -0
  420. package/dist/utils/create-controlled-signal.js.map +1 -0
  421. package/dist/utils/get-item-key.d.ts +5 -0
  422. package/dist/utils/get-item-key.js +12 -0
  423. package/dist/utils/get-item-key.js.map +1 -0
  424. package/dist/utils/get-node-props.d.ts +23 -0
  425. package/dist/utils/get-node-props.js +38 -0
  426. package/dist/utils/get-node-props.js.map +1 -0
  427. package/dist/utils/has-content.d.ts +5 -0
  428. package/dist/utils/has-content.js +7 -0
  429. package/dist/utils/has-content.js.map +1 -0
  430. package/dist/utils/legacy-props.d.ts +10 -0
  431. package/dist/utils/legacy-props.js +17 -0
  432. package/dist/utils/legacy-props.js.map +1 -0
  433. package/dist/utils/number.d.ts +25 -0
  434. package/dist/utils/number.js +59 -0
  435. package/dist/utils/number.js.map +1 -0
  436. package/dist/utils/parse-calendar-identifier.d.ts +5 -0
  437. package/dist/utils/parse-calendar-identifier.js +31 -0
  438. package/dist/utils/parse-calendar-identifier.js.map +1 -0
  439. package/dist/utils/require-value.d.ts +4 -0
  440. package/dist/utils/require-value.js +10 -0
  441. package/dist/utils/require-value.js.map +1 -0
  442. package/dist/virtualizer/create-virtualizer-state.d.ts +44 -0
  443. package/dist/virtualizer/create-virtualizer-state.js +92 -0
  444. package/dist/virtualizer/create-virtualizer-state.js.map +1 -0
  445. package/dist/virtualizer/layout-info.d.ts +94 -0
  446. package/dist/virtualizer/layout-info.js +118 -0
  447. package/dist/virtualizer/layout-info.js.map +1 -0
  448. package/dist/virtualizer/layout.d.ts +91 -0
  449. package/dist/virtualizer/layout.js +71 -0
  450. package/dist/virtualizer/layout.js.map +1 -0
  451. package/dist/virtualizer/overscan-manager.d.ts +25 -0
  452. package/dist/virtualizer/overscan-manager.js +46 -0
  453. package/dist/virtualizer/overscan-manager.js.map +1 -0
  454. package/dist/virtualizer/point.d.ts +36 -0
  455. package/dist/virtualizer/point.js +48 -0
  456. package/dist/virtualizer/point.js.map +1 -0
  457. package/dist/virtualizer/rect.d.ts +103 -0
  458. package/dist/virtualizer/rect.js +156 -0
  459. package/dist/virtualizer/rect.js.map +1 -0
  460. package/dist/virtualizer/reusable-view.d.ts +51 -0
  461. package/dist/virtualizer/reusable-view.js +81 -0
  462. package/dist/virtualizer/reusable-view.js.map +1 -0
  463. package/dist/virtualizer/scroll-anchor.d.ts +98 -0
  464. package/dist/virtualizer/scroll-anchor.js +150 -0
  465. package/dist/virtualizer/scroll-anchor.js.map +1 -0
  466. package/dist/virtualizer/size.d.ts +34 -0
  467. package/dist/virtualizer/size.js +46 -0
  468. package/dist/virtualizer/size.js.map +1 -0
  469. package/dist/virtualizer/types.d.ts +47 -0
  470. package/dist/virtualizer/types.js +16 -0
  471. package/dist/virtualizer/utils.d.ts +19 -0
  472. package/dist/virtualizer/utils.js +27 -0
  473. package/dist/virtualizer/utils.js.map +1 -0
  474. package/dist/virtualizer/virtualizer.d.ts +99 -0
  475. package/dist/virtualizer/virtualizer.js +314 -0
  476. package/dist/virtualizer/virtualizer.js.map +1 -0
  477. package/package.json +174 -4
@@ -0,0 +1,98 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/layout/TableLayout.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ import { GridNode } from "../grid/grid-collection.js";
18
+ import { Rect } from "../virtualizer/rect.js";
19
+ import { LayoutInfo } from "../virtualizer/layout-info.js";
20
+ import { InvalidationContext } from "../virtualizer/types.js";
21
+ import { LayoutNode, ListLayout, ListLayoutOptions } from "./list-layout.js";
22
+ import { ITableCollection } from "../table/table-collection.js";
23
+ import { DropTarget, ItemDropTarget, Key } from "@solid2-aria/types-shared";
24
+ export interface TableLayoutProps extends Omit<ListLayoutOptions, "orientation" | "rowSize" | "estimatedRowSize" | "headingSize" | "estimatedHeadingSize" | "loaderSize"> {
25
+ /**
26
+ * The fixed height of a row in px.
27
+ *
28
+ * @default 48
29
+ */
30
+ rowHeight?: number;
31
+ /**
32
+ * The estimated height of a row, when row heights are variable.
33
+ */
34
+ estimatedRowHeight?: number;
35
+ /**
36
+ * The fixed height of a section header in px.
37
+ *
38
+ * @default 48
39
+ */
40
+ headingHeight?: number;
41
+ /**
42
+ * The estimated height of a section header, when the height is variable.
43
+ */
44
+ estimatedHeadingHeight?: number;
45
+ /**
46
+ * The fixed height of a loader element in px. This loader is specifically for "load more"
47
+ * elements rendered when loading more rows at the root level or inside nested row/sections.
48
+ *
49
+ * @default 48
50
+ */
51
+ loaderHeight?: number;
52
+ columnWidths?: Map<Key, number>;
53
+ }
54
+ /**
55
+ * TableLayout is a virtualizer Layout implementation that arranges
56
+ * items in rows and columns.
57
+ */
58
+ export declare class TableLayout<T, O extends TableLayoutProps = TableLayoutProps> extends ListLayout<T, O> {
59
+ protected lastCollection: ITableCollection<T> | null;
60
+ private columnWidths;
61
+ private stickyColumnIndices;
62
+ private lastPersistedKeys;
63
+ private readonly persistedIndices;
64
+ constructor(options?: TableLayoutProps);
65
+ protected get collection(): ITableCollection<T>;
66
+ protected get rowHeight(): number | null;
67
+ protected get estimatedRowHeight(): number | null;
68
+ protected get headingHeight(): number | null;
69
+ protected get estimatedHeadingHeight(): number | null;
70
+ protected get loaderHeight(): number | null;
71
+ private static columnsChanged;
72
+ shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean;
73
+ update(invalidationContext: InvalidationContext<O>): void;
74
+ protected buildCollection(): LayoutNode[];
75
+ protected buildTableHeader(): LayoutNode;
76
+ protected buildHeaderRow(headerRow: GridNode<T>, initialX: number, y: number): LayoutNode;
77
+ private static setChildHeights;
78
+ private getRenderedColumnWidth;
79
+ private getEstimatedHeight;
80
+ protected getEstimatedRowHeight(): number;
81
+ protected buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode;
82
+ protected isStickyColumn(_node: GridNode<T>): boolean;
83
+ protected buildBody(y: number): LayoutNode;
84
+ protected buildRowGroup(initialY: number, node: GridNode<T>): LayoutNode;
85
+ protected buildLoader(node: GridNode<T>, x: number, y: number): LayoutNode;
86
+ protected buildNode(node: GridNode<T>, x: number, y: number): LayoutNode;
87
+ protected buildRow(node: GridNode<T>, initialX: number, y: number): LayoutNode;
88
+ protected buildCell(node: GridNode<T>, x: number, y: number): LayoutNode;
89
+ getVisibleLayoutInfos(rect: Rect): LayoutInfo[];
90
+ private addVisibleLayoutInfos;
91
+ private addVisibleRows;
92
+ private static visibleChildren;
93
+ private static binarySearch;
94
+ private buildPersistedIndices;
95
+ getDropTargetFromPoint(initialX: number, initialY: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null;
96
+ getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo;
97
+ }
98
+ //# sourceMappingURL=table-layout.d.ts.map
@@ -0,0 +1,476 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /*
13
+ * Derived from Adobe React Spectrum: packages/react-stately/src/layout/TableLayout.ts.
14
+ * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.
15
+ * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.
16
+ */
17
+ import { getChildNodes } from "../collections/get-child-nodes.js";
18
+ import { getNodeProps } from "../utils/get-node-props.js";
19
+ import { requireValue } from "../utils/require-value.js";
20
+ import { LayoutInfo } from "../virtualizer/layout-info.js";
21
+ import { Rect } from "../virtualizer/rect.js";
22
+ import { Size } from "../virtualizer/size.js";
23
+ import { ListLayout } from "./list-layout.js";
24
+ import { isTableCollection } from "../table/table-collection.js";
25
+ import { TableColumnLayout } from "../table/table-column-layout.js";
26
+ // src/layout/table-layout.ts
27
+ const DEFAULT_ROW_HEIGHT = 48;
28
+ /**
29
+ * TableLayout is a virtualizer Layout implementation that arranges
30
+ * items in rows and columns.
31
+ */
32
+ var TableLayout = class TableLayout extends ListLayout {
33
+ lastCollection = null;
34
+ columnWidths = /* @__PURE__ */ new Map();
35
+ stickyColumnIndices;
36
+ lastPersistedKeys = null;
37
+ persistedIndices = /* @__PURE__ */ new Map();
38
+ constructor(options) {
39
+ super(options);
40
+ this.stickyColumnIndices = [];
41
+ }
42
+ get collection() {
43
+ const { collection } = this.attachedVirtualizer;
44
+ if (!isTableCollection(collection)) throw new TypeError("TableLayout requires a table collection.");
45
+ return collection;
46
+ }
47
+ get rowHeight() {
48
+ return this.rowSize;
49
+ }
50
+ get estimatedRowHeight() {
51
+ return this.estimatedRowSize;
52
+ }
53
+ get headingHeight() {
54
+ return this.headingSize;
55
+ }
56
+ get estimatedHeadingHeight() {
57
+ return this.estimatedHeadingSize;
58
+ }
59
+ get loaderHeight() {
60
+ return this.loaderSize;
61
+ }
62
+ static columnsChanged(newCollection, oldCollection) {
63
+ return !oldCollection || newCollection.columns !== oldCollection.columns && newCollection.columns.length !== oldCollection.columns.length || newCollection.columns.some((c, i) => c.key !== requireValue(oldCollection.columns[i], "Expected oldCollection.columns[i] to exist.").key || getNodeProps(c).width !== getNodeProps(oldCollection.columns[i]).width || getNodeProps(c).minWidth !== getNodeProps(oldCollection.columns[i]).minWidth || getNodeProps(c).maxWidth !== getNodeProps(oldCollection.columns[i]).maxWidth);
64
+ }
65
+ shouldInvalidateLayoutOptions(newOptions, oldOptions) {
66
+ return newOptions.columnWidths !== oldOptions.columnWidths || super.shouldInvalidateLayoutOptions(newOptions, oldOptions);
67
+ }
68
+ update(invalidationContext) {
69
+ const newCollection = this.collection;
70
+ if (invalidationContext.layoutOptions?.columnWidths) {
71
+ for (const [key, val] of invalidationContext.layoutOptions.columnWidths) if (this.columnWidths.get(key) !== val) {
72
+ this.columnWidths = invalidationContext.layoutOptions.columnWidths;
73
+ invalidationContext.sizeChanged = true;
74
+ break;
75
+ }
76
+ } else if (invalidationContext.sizeChanged === true || TableLayout.columnsChanged(newCollection, this.lastCollection)) {
77
+ const columnLayout = new TableColumnLayout({});
78
+ this.columnWidths = columnLayout.buildColumnWidths(this.attachedVirtualizer.size.width - this.padding * 2, newCollection, /* @__PURE__ */ new Map());
79
+ invalidationContext.sizeChanged = true;
80
+ }
81
+ super.update(invalidationContext);
82
+ }
83
+ buildCollection() {
84
+ this.stickyColumnIndices = [];
85
+ const { collection } = this;
86
+ for (const column of collection.columns) if (this.isStickyColumn(column) || collection.rowHeaderColumnKeys.has(column.key)) this.stickyColumnIndices.push(column.index);
87
+ let layoutNodes = [];
88
+ let y = 0;
89
+ let width = 0;
90
+ if (collection.head) {
91
+ for (const node of collection) switch (node.type) {
92
+ case "tableheader": {
93
+ const header = this.buildTableHeader();
94
+ y = header.layoutInfo.rect.maxY + this.gap;
95
+ width = Math.max(width, header.layoutInfo.rect.width);
96
+ this.layoutNodes.set(header.layoutInfo.key, header);
97
+ layoutNodes.push(header);
98
+ break;
99
+ }
100
+ case "tablebody":
101
+ case "tablefooter": {
102
+ const body = this.buildRowGroup(y, node);
103
+ y = body.layoutInfo.rect.maxY + this.gap;
104
+ width = Math.max(width, body.layoutInfo.rect.width);
105
+ this.layoutNodes.set(body.layoutInfo.key, body);
106
+ layoutNodes.push(body);
107
+ break;
108
+ }
109
+ }
110
+ if (y > 0) y -= this.gap;
111
+ for (const layoutNode of layoutNodes) layoutNode.layoutInfo.rect.width = width;
112
+ } else {
113
+ const header = this.buildTableHeader();
114
+ this.layoutNodes.set(header.layoutInfo.key, header);
115
+ const body = this.buildBody(header.layoutInfo.rect.maxY + this.gap);
116
+ body.layoutInfo.rect.width = Math.max(header.layoutInfo.rect.width, body.layoutInfo.rect.width);
117
+ y = body.layoutInfo.rect.maxY;
118
+ ({width} = body.layoutInfo.rect);
119
+ layoutNodes = [header, body];
120
+ }
121
+ this.lastPersistedKeys = null;
122
+ this.contentSize = new Size(width + this.padding * 2, y + this.padding);
123
+ return layoutNodes;
124
+ }
125
+ buildTableHeader() {
126
+ const { collection } = this;
127
+ const rect = new Rect(this.padding, this.padding, 0, 0);
128
+ const layoutInfo = new LayoutInfo("header", collection.head?.key ?? "header", rect);
129
+ layoutInfo.isSticky = true;
130
+ layoutInfo.zIndex = 1;
131
+ let y = this.padding;
132
+ let width = 0;
133
+ const children = [];
134
+ for (const headerRow of collection.headerRows) {
135
+ const layoutNode = this.buildChild(headerRow, this.padding, y, layoutInfo.key);
136
+ layoutNode.layoutInfo.parentKey = layoutInfo.key;
137
+ y = layoutNode.layoutInfo.rect.maxY;
138
+ width = Math.max(width, layoutNode.layoutInfo.rect.width);
139
+ layoutNode.index = children.length;
140
+ children.push(layoutNode);
141
+ }
142
+ rect.width = width;
143
+ rect.height = y - this.padding;
144
+ return {
145
+ children,
146
+ layoutInfo,
147
+ node: collection.head,
148
+ validRect: layoutInfo.rect
149
+ };
150
+ }
151
+ buildHeaderRow(headerRow, initialX, y) {
152
+ let x = initialX;
153
+ const rect = new Rect(x, y, 0, 0);
154
+ const row = new LayoutInfo("headerrow", headerRow.key, rect);
155
+ let height = 0;
156
+ const columns = [];
157
+ for (const cell of getChildNodes(headerRow, this.attachedVirtualizer.collection)) {
158
+ const layoutNode = this.buildChild(cell, x, y, row.key);
159
+ layoutNode.layoutInfo.parentKey = row.key;
160
+ x = layoutNode.layoutInfo.rect.maxX;
161
+ height = Math.max(height, layoutNode.layoutInfo.rect.height);
162
+ layoutNode.index = columns.length;
163
+ columns.push(layoutNode);
164
+ }
165
+ for (const [i, layout] of columns.entries()) layout.layoutInfo.zIndex = columns.length - i + 1;
166
+ TableLayout.setChildHeights(columns, height);
167
+ rect.height = height;
168
+ rect.width = x - rect.x;
169
+ return {
170
+ children: columns,
171
+ layoutInfo: row,
172
+ node: headerRow,
173
+ validRect: rect
174
+ };
175
+ }
176
+ static setChildHeights(children, height) {
177
+ for (const child of children) if (child.layoutInfo.rect.height !== height) {
178
+ child.layoutInfo = child.layoutInfo.copy();
179
+ child.layoutInfo.rect.height = height;
180
+ }
181
+ }
182
+ getRenderedColumnWidth(node) {
183
+ const { collection } = this;
184
+ const colSpan = node.colSpan ?? 1;
185
+ const colIndex = node.colIndex ?? node.index;
186
+ let width = 0;
187
+ for (let i = colIndex; i < colIndex + colSpan; i += 1) {
188
+ const column = collection.columns[i];
189
+ if (column?.key !== null && column?.key !== void 0) width += this.columnWidths.get(column.key) ?? 0;
190
+ }
191
+ return width;
192
+ }
193
+ getEstimatedHeight(node, width, initialHeight, estimatedHeight) {
194
+ let height = initialHeight;
195
+ let isEstimated = false;
196
+ if (height === null || height === void 0) {
197
+ const previousLayoutNode = this.layoutNodes.get(node.key);
198
+ if (previousLayoutNode) {
199
+ ({height} = previousLayoutNode.layoutInfo.rect);
200
+ isEstimated = node !== previousLayoutNode.node || width !== previousLayoutNode.layoutInfo.rect.width || previousLayoutNode.layoutInfo.estimatedSize;
201
+ } else {
202
+ height = estimatedHeight ?? DEFAULT_ROW_HEIGHT;
203
+ isEstimated = true;
204
+ }
205
+ }
206
+ return {
207
+ height,
208
+ isEstimated
209
+ };
210
+ }
211
+ getEstimatedRowHeight() {
212
+ return this.rowSize ?? this.estimatedRowSize ?? DEFAULT_ROW_HEIGHT;
213
+ }
214
+ buildColumn(node, x, y) {
215
+ const width = this.getRenderedColumnWidth(node);
216
+ const { height, isEstimated } = this.getEstimatedHeight(node, width, this.headingSize ?? this.rowSize, this.estimatedHeadingSize ?? this.estimatedRowSize);
217
+ const rect = new Rect(x, y, width, height);
218
+ const layoutInfo = new LayoutInfo(node.type, node.key, rect);
219
+ layoutInfo.isSticky = this.isStickyColumn(node);
220
+ layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;
221
+ layoutInfo.estimatedSize = isEstimated;
222
+ return {
223
+ children: [],
224
+ layoutInfo,
225
+ node,
226
+ validRect: layoutInfo.rect
227
+ };
228
+ }
229
+ isStickyColumn(_node) {
230
+ return false;
231
+ }
232
+ buildBody(y) {
233
+ const { collection } = this;
234
+ return this.buildRowGroup(y, collection.body);
235
+ }
236
+ buildRowGroup(initialY, node) {
237
+ let y = initialY;
238
+ const { collection } = this;
239
+ const rect = new Rect(this.padding, y, 0, 0);
240
+ const layoutInfo = new LayoutInfo("rowgroup", node.key, rect);
241
+ const startY = y;
242
+ let width = 0;
243
+ const children = [];
244
+ const rowHeight = this.getEstimatedRowHeight() + this.gap;
245
+ const childNodes = getChildNodes(node, collection);
246
+ for (const localNode of childNodes) {
247
+ if (y + rowHeight < this.requestedRect.y && !this.isValid(localNode, y) || y > this.requestedRect.maxY && localNode.type !== "loader") {
248
+ y += rowHeight;
249
+ continue;
250
+ }
251
+ const layoutNode = this.buildChild(localNode, this.padding, y, layoutInfo.key);
252
+ layoutNode.layoutInfo.parentKey = layoutInfo.key;
253
+ layoutNode.index = children.length;
254
+ y = layoutNode.layoutInfo.rect.maxY + this.gap;
255
+ width = Math.max(width, layoutNode.layoutInfo.rect.width);
256
+ children.push(layoutNode);
257
+ }
258
+ if (collection?.size === 0) y = this.attachedVirtualizer.size.height;
259
+ else y -= this.gap;
260
+ rect.width = width;
261
+ rect.height = y - startY;
262
+ return {
263
+ children,
264
+ layoutInfo,
265
+ node,
266
+ validRect: layoutInfo.rect.intersection(this.requestedRect)
267
+ };
268
+ }
269
+ buildLoader(node, x, y) {
270
+ const layoutNode = super.buildLoader(node, x, y);
271
+ const { collection } = this;
272
+ layoutNode.layoutInfo.rect.width = requireValue(this.layoutNodes.get(collection.head?.key ?? "header"), "Expected this.layoutNodes.get( collection.head?.key ?? \"header\" ) to exist.").layoutInfo.rect.width;
273
+ layoutNode.validRect = layoutNode.layoutInfo.rect.intersection(this.requestedRect);
274
+ return layoutNode;
275
+ }
276
+ buildNode(node, x, y) {
277
+ switch (node.type) {
278
+ case "headerrow": return this.buildHeaderRow(node, x, y);
279
+ case "item": return this.buildRow(node, x, y);
280
+ case "column":
281
+ case "placeholder": return this.buildColumn(node, x, y);
282
+ case "cell": return this.buildCell(node, x, y);
283
+ case "loader": return this.buildLoader(node, x, y);
284
+ default: throw new Error(`Unknown node type ${node.type}`);
285
+ }
286
+ }
287
+ buildRow(node, initialX, y) {
288
+ let x = initialX;
289
+ const { collection } = this;
290
+ const rect = new Rect(x, y, 0, 0);
291
+ const layoutInfo = new LayoutInfo("row", node.key, rect);
292
+ const children = [];
293
+ let height = 0;
294
+ for (const child of getChildNodes(node, collection)) if (child.type === "cell") {
295
+ if (x > this.requestedRect.maxX) {
296
+ const layoutNode = this.layoutNodes.get(child.key);
297
+ if (layoutNode) {
298
+ layoutNode.layoutInfo.rect.x = x;
299
+ x += layoutNode.layoutInfo.rect.width;
300
+ } else break;
301
+ } else {
302
+ const layoutNode = this.buildChild(child, x, y, layoutInfo.key);
303
+ x = layoutNode.layoutInfo.rect.maxX;
304
+ height = Math.max(height, layoutNode.layoutInfo.rect.height);
305
+ layoutNode.index = children.length;
306
+ children.push(layoutNode);
307
+ }
308
+ }
309
+ TableLayout.setChildHeights(children, height);
310
+ rect.width = requireValue(this.layoutNodes.get(collection.head?.key ?? "header"), "Expected this.layoutNodes.get( collection.head?.key ?? \"header\" ) to exist.").layoutInfo.rect.width;
311
+ rect.height = height;
312
+ return {
313
+ children,
314
+ layoutInfo,
315
+ node,
316
+ validRect: rect.intersection(this.requestedRect)
317
+ };
318
+ }
319
+ buildCell(node, x, y) {
320
+ const width = this.getRenderedColumnWidth(node);
321
+ const { height, isEstimated } = this.getEstimatedHeight(node, width, this.rowSize, this.estimatedRowSize);
322
+ const rect = new Rect(x, y, width, height);
323
+ const layoutInfo = new LayoutInfo(node.type, node.key, rect);
324
+ layoutInfo.isSticky = this.isStickyColumn(node);
325
+ layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;
326
+ layoutInfo.estimatedSize = isEstimated;
327
+ return {
328
+ children: [],
329
+ layoutInfo,
330
+ node,
331
+ validRect: rect
332
+ };
333
+ }
334
+ getVisibleLayoutInfos(rect) {
335
+ if (rect.height > 1) {
336
+ const rowHeight = this.getEstimatedRowHeight();
337
+ rect.y = Math.floor(rect.y / rowHeight) * rowHeight;
338
+ rect.height = Math.ceil(rect.height / rowHeight) * rowHeight;
339
+ }
340
+ this.layoutIfNeeded(rect);
341
+ const res = [];
342
+ this.buildPersistedIndices();
343
+ for (const node of this.rootNodes) {
344
+ res.push(node.layoutInfo);
345
+ this.addVisibleLayoutInfos(res, node, rect);
346
+ }
347
+ return res;
348
+ }
349
+ addVisibleLayoutInfos(res, node, rect) {
350
+ if (!node.children || node.children.length === 0) return;
351
+ switch (node.layoutInfo.type) {
352
+ case "header":
353
+ for (const child of node.children) {
354
+ res.push(child.layoutInfo);
355
+ this.addVisibleLayoutInfos(res, child, rect);
356
+ }
357
+ break;
358
+ case "rowgroup":
359
+ this.addVisibleRows(res, node, rect);
360
+ break;
361
+ case "headerrow":
362
+ case "row": {
363
+ const persisted = this.persistedIndices.get(node.layoutInfo.key) ?? this.stickyColumnIndices;
364
+ for (const child of TableLayout.visibleChildren(node, rect, "x", persisted)) res.push(child.layoutInfo);
365
+ break;
366
+ }
367
+ default: throw new Error(`Unknown node type ${node.layoutInfo.type}`);
368
+ }
369
+ }
370
+ addVisibleRows(res, node, rect) {
371
+ const persisted = this.persistedIndices.get(node.layoutInfo.key) ?? [];
372
+ for (const child of TableLayout.visibleChildren(node, rect, "y", persisted)) {
373
+ res.push(child.layoutInfo);
374
+ this.addVisibleLayoutInfos(res, child, rect);
375
+ }
376
+ }
377
+ static visibleChildren(node, rect, axis, persisted) {
378
+ const children = node.children ?? [];
379
+ if (children.length === 0) return [];
380
+ const first = TableLayout.binarySearch(children, rect.topLeft, axis);
381
+ const last = TableLayout.binarySearch(children, axis === "x" ? rect.topRight : rect.bottomRight, axis);
382
+ const indices = new Set(persisted);
383
+ for (let index = first; index <= last; index += 1) indices.add(index);
384
+ return [...indices].toSorted((a, b) => a - b).flatMap((index) => {
385
+ const child = children[index];
386
+ return child ? [child] : [];
387
+ });
388
+ }
389
+ static binarySearch(items, point, axis) {
390
+ let low = 0;
391
+ let high = items.length - 1;
392
+ while (low <= high) {
393
+ const mid = Math.floor((low + high) / 2);
394
+ const item = requireValue(items[mid], "Binary search must stay within the layout nodes.");
395
+ if (axis === "x" && item.layoutInfo.rect.maxX <= point.x || axis === "y" && item.layoutInfo.rect.maxY <= point.y) low = mid + 1;
396
+ else if (axis === "x" && item.layoutInfo.rect.x > point.x || axis === "y" && item.layoutInfo.rect.y > point.y) high = mid - 1;
397
+ else return mid;
398
+ }
399
+ return Math.max(0, Math.min(items.length - 1, low));
400
+ }
401
+ buildPersistedIndices() {
402
+ if (this.attachedVirtualizer.persistedKeys === this.lastPersistedKeys) return;
403
+ this.lastPersistedKeys = this.attachedVirtualizer.persistedKeys;
404
+ this.persistedIndices.clear();
405
+ for (const key of this.attachedVirtualizer.persistedKeys) {
406
+ let layoutInfo = this.layoutNodes.get(key)?.layoutInfo;
407
+ while (layoutInfo && layoutInfo.parentKey !== null && layoutInfo.parentKey !== void 0) {
408
+ const collectionNode = this.attachedVirtualizer.collection.getItem(layoutInfo.key);
409
+ let indices = this.persistedIndices.get(layoutInfo.parentKey);
410
+ if (!indices) {
411
+ indices = collectionNode?.type === "cell" || collectionNode?.type === "column" ? [...this.stickyColumnIndices] : [];
412
+ this.persistedIndices.set(layoutInfo.parentKey, indices);
413
+ }
414
+ const index = this.layoutNodes.get(layoutInfo.key)?.index;
415
+ if (index !== null && index !== void 0 && !indices.includes(index)) indices.push(index);
416
+ layoutInfo = this.layoutNodes.get(layoutInfo.parentKey)?.layoutInfo;
417
+ }
418
+ }
419
+ for (const indices of this.persistedIndices.values()) indices.sort((a, b) => a - b);
420
+ }
421
+ getDropTargetFromPoint(initialX, initialY, isValidDropTarget) {
422
+ let x = initialX;
423
+ let y = initialY;
424
+ x += this.attachedVirtualizer.visibleRect.x;
425
+ y += this.attachedVirtualizer.visibleRect.y;
426
+ const searchRect = new Rect(x, Math.max(0, y - this.gap), 1, Math.max(1, this.gap * 2));
427
+ const candidates = this.getVisibleLayoutInfos(searchRect);
428
+ let key = null;
429
+ let minDistance = Infinity;
430
+ for (const candidate of candidates) {
431
+ if (candidate.type !== "row" || !candidate.rect.intersects(searchRect)) continue;
432
+ const yDist = Math.abs(candidate.rect.y - y);
433
+ const maxYDist = Math.abs(candidate.rect.maxY - y);
434
+ const dist = Math.min(yDist, maxYDist);
435
+ if (dist < minDistance) {
436
+ minDistance = dist;
437
+ ({key} = candidate);
438
+ }
439
+ }
440
+ if (key === null || key === void 0 || this.attachedVirtualizer.collection.size === 0) return { type: "root" };
441
+ const layoutInfo = this.getLayoutInfo(key);
442
+ if (!layoutInfo) return null;
443
+ const { rect } = layoutInfo;
444
+ const target = {
445
+ dropPosition: "on",
446
+ key: layoutInfo.key,
447
+ type: "item"
448
+ };
449
+ if (!isValidDropTarget(target)) {
450
+ if (y <= rect.y + rect.height / 2 && isValidDropTarget({
451
+ ...target,
452
+ dropPosition: "before"
453
+ })) target.dropPosition = "before";
454
+ else if (isValidDropTarget({
455
+ ...target,
456
+ dropPosition: "after"
457
+ })) target.dropPosition = "after";
458
+ } else if (y <= rect.y + 10 && isValidDropTarget({
459
+ ...target,
460
+ dropPosition: "before"
461
+ })) target.dropPosition = "before";
462
+ else if (y >= rect.maxY - 10 && isValidDropTarget({
463
+ ...target,
464
+ dropPosition: "after"
465
+ })) target.dropPosition = "after";
466
+ return target;
467
+ }
468
+ getDropTargetLayoutInfo(target) {
469
+ const layoutInfo = super.getDropTargetLayoutInfo(target);
470
+ layoutInfo.parentKey = this.attachedVirtualizer.collection.getItem(target.key)?.parentKey ?? null;
471
+ return layoutInfo;
472
+ }
473
+ };
474
+ export { TableLayout };
475
+
476
+ //# sourceMappingURL=table-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-layout.js","names":[],"sources":["../../src/layout/table-layout.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/*\n * Derived from Adobe React Spectrum: packages/react-stately/src/layout/TableLayout.ts.\n * Modified for Solid Aria: adapted imports, collection descriptors, and reactive state APIs for Solid 2.\n * Licensed under Apache-2.0. See LICENSES/Apache-2.0.txt and NOTICE.txt at the repository root.\n */\n\nimport type {\n DropTarget,\n ItemDropTarget,\n Key,\n} from \"@solid2-aria/types-shared\";\n\nimport { getChildNodes } from \"../collections/get-child-nodes\";\nimport type { GridNode } from \"../grid/grid-collection\";\nimport { isTableCollection } from \"../table/table-collection\";\nimport type { ITableCollection as TableCollection } from \"../table/table-collection\";\nimport { TableColumnLayout } from \"../table/table-column-layout\";\nimport { getNodeProps } from \"../utils/get-node-props\";\nimport { requireValue } from \"../utils/require-value\";\nimport { LayoutInfo } from \"../virtualizer/layout-info\";\nimport type { Point } from \"../virtualizer/point\";\nimport { Rect } from \"../virtualizer/rect\";\nimport { Size } from \"../virtualizer/size\";\nimport type { InvalidationContext } from \"../virtualizer/types\";\nimport { ListLayout } from \"./list-layout\";\nimport type { LayoutNode, ListLayoutOptions } from \"./list-layout\";\n\nexport interface TableLayoutProps extends Omit<\n ListLayoutOptions,\n | \"orientation\"\n | \"rowSize\"\n | \"estimatedRowSize\"\n | \"headingSize\"\n | \"estimatedHeadingSize\"\n | \"loaderSize\"\n> {\n /**\n * The fixed height of a row in px.\n *\n * @default 48\n */\n rowHeight?: number;\n /**\n * The estimated height of a row, when row heights are variable.\n */\n estimatedRowHeight?: number;\n /**\n * The fixed height of a section header in px.\n *\n * @default 48\n */\n headingHeight?: number;\n /**\n * The estimated height of a section header, when the height is variable.\n */\n estimatedHeadingHeight?: number;\n /**\n * The fixed height of a loader element in px. This loader is specifically for \"load more\"\n * elements rendered when loading more rows at the root level or inside nested row/sections.\n *\n * @default 48\n */\n loaderHeight?: number;\n columnWidths?: Map<Key, number>;\n}\n\nconst DEFAULT_ROW_HEIGHT = 48;\n\n/**\n * TableLayout is a virtualizer Layout implementation that arranges\n * items in rows and columns.\n */\nexport class TableLayout<\n T,\n O extends TableLayoutProps = TableLayoutProps,\n> extends ListLayout<T, O> {\n protected override lastCollection: TableCollection<T> | null = null;\n private columnWidths = new Map<Key, number>();\n private stickyColumnIndices: number[];\n private lastPersistedKeys: Set<Key> | null = null;\n private readonly persistedIndices = new Map<Key, number[]>();\n constructor(options?: TableLayoutProps) {\n super(options);\n this.stickyColumnIndices = [];\n }\n // Backward compatibility for subclassing.\n protected override get collection(): TableCollection<T> {\n const { collection } = this.attachedVirtualizer;\n\n if (!isTableCollection(collection)) {\n throw new TypeError(\"TableLayout requires a table collection.\");\n }\n\n return collection;\n }\n // Preserve the old rowHeight/other \"height\" properties since Table doesn't support a \"horizontal\" orientation\n protected override get rowHeight(): number | null {\n return this.rowSize;\n }\n protected override get estimatedRowHeight(): number | null {\n return this.estimatedRowSize;\n }\n protected override get headingHeight(): number | null {\n return this.headingSize;\n }\n protected override get estimatedHeadingHeight(): number | null {\n return this.estimatedHeadingSize;\n }\n protected override get loaderHeight(): number | null {\n return this.loaderSize;\n }\n private static columnsChanged<T>(\n newCollection: TableCollection<T>,\n oldCollection: TableCollection<T> | null\n ) {\n return (\n !oldCollection ||\n (newCollection.columns !== oldCollection.columns &&\n newCollection.columns.length !== oldCollection.columns.length) ||\n newCollection.columns.some(\n (c, i) =>\n c.key !==\n requireValue(\n oldCollection.columns[i],\n \"Expected oldCollection.columns[i] to exist.\"\n ).key ||\n getNodeProps(c).width !==\n getNodeProps(oldCollection.columns[i]).width ||\n getNodeProps(c).minWidth !==\n getNodeProps(oldCollection.columns[i]).minWidth ||\n getNodeProps(c).maxWidth !==\n getNodeProps(oldCollection.columns[i]).maxWidth\n )\n );\n }\n override shouldInvalidateLayoutOptions(\n newOptions: O,\n oldOptions: O\n ): boolean {\n return (\n newOptions.columnWidths !== oldOptions.columnWidths ||\n super.shouldInvalidateLayoutOptions(newOptions, oldOptions)\n );\n }\n override update(invalidationContext: InvalidationContext<O>): void {\n const newCollection = this.collection;\n\n // If columnWidths were provided via layoutOptions, update those.\n // Otherwise, calculate column widths ourselves.\n if (invalidationContext.layoutOptions?.columnWidths) {\n for (const [key, val] of invalidationContext.layoutOptions.columnWidths) {\n if (this.columnWidths.get(key) !== val) {\n this.columnWidths = invalidationContext.layoutOptions.columnWidths;\n invalidationContext.sizeChanged = true;\n break;\n }\n }\n } else if (\n invalidationContext.sizeChanged === true ||\n TableLayout.columnsChanged(newCollection, this.lastCollection)\n ) {\n const columnLayout = new TableColumnLayout({});\n this.columnWidths = columnLayout.buildColumnWidths(\n this.attachedVirtualizer.size.width - this.padding * 2,\n newCollection,\n new Map()\n );\n invalidationContext.sizeChanged = true;\n }\n\n super.update(invalidationContext);\n }\n protected override buildCollection(): LayoutNode[] {\n this.stickyColumnIndices = [];\n const { collection } = this;\n\n for (const column of collection.columns) {\n // The selection cell and any other sticky columns always need to be visible.\n // In addition, row headers need to be in the DOM for accessibility labeling.\n if (\n this.isStickyColumn(column) ||\n collection.rowHeaderColumnKeys.has(column.key)\n ) {\n this.stickyColumnIndices.push(column.index);\n }\n }\n\n let layoutNodes: LayoutNode[] = [];\n let y = 0;\n let width = 0;\n\n if (collection.head) {\n for (const node of collection) {\n switch (node.type) {\n case \"tableheader\": {\n const header = this.buildTableHeader();\n y = header.layoutInfo.rect.maxY + this.gap;\n width = Math.max(width, header.layoutInfo.rect.width);\n this.layoutNodes.set(header.layoutInfo.key, header);\n layoutNodes.push(header);\n break;\n }\n\n case \"tablebody\":\n case \"tablefooter\": {\n const body = this.buildRowGroup(y, node);\n y = body.layoutInfo.rect.maxY + this.gap;\n width = Math.max(width, body.layoutInfo.rect.width);\n this.layoutNodes.set(body.layoutInfo.key, body);\n layoutNodes.push(body);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n\n if (y > 0) {\n y -= this.gap;\n }\n\n for (const layoutNode of layoutNodes) {\n layoutNode.layoutInfo.rect.width = width;\n }\n } else {\n const header = this.buildTableHeader();\n this.layoutNodes.set(header.layoutInfo.key, header);\n const body = this.buildBody(header.layoutInfo.rect.maxY + this.gap);\n body.layoutInfo.rect.width = Math.max(\n header.layoutInfo.rect.width,\n body.layoutInfo.rect.width\n );\n y = body.layoutInfo.rect.maxY;\n ({ width } = body.layoutInfo.rect);\n layoutNodes = [header, body];\n }\n\n this.lastPersistedKeys = null;\n this.contentSize = new Size(width + this.padding * 2, y + this.padding);\n\n return layoutNodes;\n }\n protected buildTableHeader(): LayoutNode {\n const { collection } = this;\n const rect = new Rect(this.padding, this.padding, 0, 0);\n\n const layoutInfo = new LayoutInfo(\n \"header\",\n collection.head?.key ?? \"header\",\n rect\n );\n\n layoutInfo.isSticky = true;\n layoutInfo.zIndex = 1;\n let y = this.padding;\n let width = 0;\n const children: LayoutNode[] = [];\n\n for (const headerRow of collection.headerRows) {\n const layoutNode = this.buildChild(\n headerRow,\n this.padding,\n y,\n layoutInfo.key\n );\n\n layoutNode.layoutInfo.parentKey = layoutInfo.key;\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n layoutNode.index = children.length;\n children.push(layoutNode);\n }\n\n rect.width = width;\n rect.height = y - this.padding;\n\n return {\n children,\n layoutInfo,\n node: collection.head,\n validRect: layoutInfo.rect,\n };\n }\n protected buildHeaderRow(\n headerRow: GridNode<T>,\n initialX: number,\n y: number\n ): LayoutNode {\n let x = initialX;\n\n const rect = new Rect(x, y, 0, 0);\n const row = new LayoutInfo(\"headerrow\", headerRow.key, rect);\n let height = 0;\n const columns: LayoutNode[] = [];\n\n for (const cell of getChildNodes(\n headerRow,\n this.attachedVirtualizer.collection\n )) {\n const layoutNode = this.buildChild(cell, x, y, row.key);\n layoutNode.layoutInfo.parentKey = row.key;\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = columns.length;\n columns.push(layoutNode);\n }\n\n for (const [i, layout] of columns.entries()) {\n layout.layoutInfo.zIndex = columns.length - i + 1;\n }\n\n TableLayout.setChildHeights(columns, height);\n rect.height = height;\n rect.width = x - rect.x;\n\n return {\n children: columns,\n layoutInfo: row,\n node: headerRow,\n validRect: rect,\n };\n }\n private static setChildHeights(children: LayoutNode[], height: number) {\n for (const child of children) {\n if (child.layoutInfo.rect.height !== height) {\n // Need to copy the layout info before we mutate it.\n child.layoutInfo = child.layoutInfo.copy();\n child.layoutInfo.rect.height = height;\n }\n }\n }\n // used to get the column widths when rendering to the DOM\n private getRenderedColumnWidth(node: GridNode<T>) {\n const { collection } = this;\n const colSpan = node.colSpan ?? 1;\n const colIndex = node.colIndex ?? node.index;\n let width = 0;\n\n for (let i = colIndex; i < colIndex + colSpan; i += 1) {\n const column = collection.columns[i];\n\n if (column?.key !== null && column?.key !== undefined) {\n width += this.columnWidths.get(column.key) ?? 0;\n }\n }\n\n return width;\n }\n private getEstimatedHeight(\n node: GridNode<T>,\n width: number,\n initialHeight: number | null,\n estimatedHeight: number | null\n ) {\n let height = initialHeight;\n\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (height === null || height === undefined) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n const previousLayoutNode = this.layoutNodes.get(node.key);\n\n if (previousLayoutNode) {\n ({ height } = previousLayoutNode.layoutInfo.rect);\n isEstimated =\n node !== previousLayoutNode.node ||\n width !== previousLayoutNode.layoutInfo.rect.width ||\n previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n height = estimatedHeight ?? DEFAULT_ROW_HEIGHT;\n isEstimated = true;\n }\n }\n\n return { height, isEstimated };\n }\n protected getEstimatedRowHeight(): number {\n return this.rowSize ?? this.estimatedRowSize ?? DEFAULT_ROW_HEIGHT;\n }\n protected buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n const width = this.getRenderedColumnWidth(node);\n\n const { height, isEstimated } = this.getEstimatedHeight(\n node,\n width,\n this.headingSize ?? this.rowSize,\n this.estimatedHeadingSize ?? this.estimatedRowSize\n );\n\n const rect = new Rect(x, y, width, height);\n const layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = this.isStickyColumn(node);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n children: [],\n layoutInfo,\n node,\n validRect: layoutInfo.rect,\n };\n }\n // For subclasses.\n protected isStickyColumn(_node: GridNode<T>) {\n return false;\n }\n protected buildBody(y: number): LayoutNode {\n const { collection } = this;\n\n return this.buildRowGroup(y, collection.body);\n }\n protected buildRowGroup(initialY: number, node: GridNode<T>): LayoutNode {\n let y = initialY;\n\n const { collection } = this;\n const rect = new Rect(this.padding, y, 0, 0);\n const layoutInfo = new LayoutInfo(\"rowgroup\", node.key, rect);\n const startY = y;\n let width = 0;\n const children: LayoutNode[] = [];\n const rowHeight = this.getEstimatedRowHeight() + this.gap;\n const childNodes = getChildNodes(node, collection);\n\n for (const localNode of childNodes) {\n // Skip rows outside the valid rectangle unless they are already cached.\n if (\n (y + rowHeight < this.requestedRect.y && !this.isValid(localNode, y)) ||\n (y > this.requestedRect.maxY && localNode.type !== \"loader\")\n ) {\n y += rowHeight;\n continue;\n }\n\n const layoutNode = this.buildChild(\n localNode,\n this.padding,\n y,\n layoutInfo.key\n );\n\n layoutNode.layoutInfo.parentKey = layoutInfo.key;\n layoutNode.index = children.length;\n y = layoutNode.layoutInfo.rect.maxY + this.gap;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n children.push(layoutNode);\n }\n\n // Make sure that the table body gets a height if empty or performing initial load\n const isEmptyOrLoading = collection?.size === 0;\n\n if (isEmptyOrLoading) {\n y = this.attachedVirtualizer.size.height;\n } else {\n y -= this.gap;\n }\n\n rect.width = width;\n rect.height = y - startY;\n\n return {\n children,\n layoutInfo,\n node,\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n };\n }\n protected override buildLoader(\n node: GridNode<T>,\n x: number,\n y: number\n ): LayoutNode {\n const layoutNode = super.buildLoader(node, x, y);\n const { collection } = this;\n // use the same approach as buildRow to get the proper width of the loader, otherwise\n // we get a outdated loader width\n layoutNode.layoutInfo.rect.width = requireValue(\n this.layoutNodes.get(collection.head?.key ?? \"header\"),\n 'Expected this.layoutNodes.get( collection.head?.key ?? \"header\" ) to exist.'\n ).layoutInfo.rect.width;\n layoutNode.validRect = layoutNode.layoutInfo.rect.intersection(\n this.requestedRect\n );\n\n return layoutNode;\n }\n protected override buildNode(\n node: GridNode<T>,\n x: number,\n y: number\n ): LayoutNode {\n switch (node.type) {\n case \"headerrow\": {\n return this.buildHeaderRow(node, x, y);\n }\n\n case \"item\": {\n return this.buildRow(node, x, y);\n }\n\n case \"column\":\n case \"placeholder\": {\n return this.buildColumn(node, x, y);\n }\n\n case \"cell\": {\n return this.buildCell(node, x, y);\n }\n\n case \"loader\": {\n return this.buildLoader(node, x, y);\n }\n\n default: {\n throw new Error(`Unknown node type ${node.type}`);\n }\n }\n }\n protected buildRow(\n node: GridNode<T>,\n initialX: number,\n y: number\n ): LayoutNode {\n let x = initialX;\n\n const { collection } = this;\n const rect = new Rect(x, y, 0, 0);\n const layoutInfo = new LayoutInfo(\"row\", node.key, rect);\n const children: LayoutNode[] = [];\n let height = 0;\n\n for (const child of getChildNodes(node, collection)) {\n if (child.type === \"cell\") {\n if (x > this.requestedRect.maxX) {\n // Adjust existing cached layoutInfo to ensure that it is out of view.\n // This can happen due to column resizing.\n const layoutNode = this.layoutNodes.get(child.key);\n\n if (layoutNode) {\n layoutNode.layoutInfo.rect.x = x;\n x += layoutNode.layoutInfo.rect.width;\n } else {\n break;\n }\n } else {\n const layoutNode = this.buildChild(child, x, y, layoutInfo.key);\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = children.length;\n children.push(layoutNode);\n }\n }\n }\n\n TableLayout.setChildHeights(children, height);\n rect.width = requireValue(\n this.layoutNodes.get(collection.head?.key ?? \"header\"),\n 'Expected this.layoutNodes.get( collection.head?.key ?? \"header\" ) to exist.'\n ).layoutInfo.rect.width;\n rect.height = height;\n\n return {\n children,\n layoutInfo,\n node,\n validRect: rect.intersection(this.requestedRect),\n };\n }\n protected buildCell(node: GridNode<T>, x: number, y: number): LayoutNode {\n const width = this.getRenderedColumnWidth(node);\n\n const { height, isEstimated } = this.getEstimatedHeight(\n node,\n width,\n this.rowSize,\n this.estimatedRowSize\n );\n\n const rect = new Rect(x, y, width, height);\n const layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = this.isStickyColumn(node);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n children: [],\n layoutInfo,\n node,\n validRect: rect,\n };\n }\n override getVisibleLayoutInfos(rect: Rect): LayoutInfo[] {\n // Adjust rect to keep number of visible rows consistent.\n // (only if height > 1 for getDropTargetFromPoint)\n if (rect.height > 1) {\n const rowHeight = this.getEstimatedRowHeight();\n rect.y = Math.floor(rect.y / rowHeight) * rowHeight;\n rect.height = Math.ceil(rect.height / rowHeight) * rowHeight;\n }\n\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n this.layoutIfNeeded(rect);\n const res: LayoutInfo[] = [];\n this.buildPersistedIndices();\n\n for (const node of this.rootNodes) {\n res.push(node.layoutInfo);\n this.addVisibleLayoutInfos(res, node, rect);\n }\n\n return res;\n }\n private addVisibleLayoutInfos(\n res: LayoutInfo[],\n node: LayoutNode,\n rect: Rect\n ) {\n if (!node.children || node.children.length === 0) {\n return;\n }\n\n switch (node.layoutInfo.type) {\n case \"header\": {\n for (const child of node.children) {\n res.push(child.layoutInfo);\n this.addVisibleLayoutInfos(res, child, rect);\n }\n\n break;\n }\n\n case \"rowgroup\": {\n this.addVisibleRows(res, node, rect);\n break;\n }\n\n case \"headerrow\":\n case \"row\": {\n const persisted =\n this.persistedIndices.get(node.layoutInfo.key) ??\n this.stickyColumnIndices;\n\n for (const child of TableLayout.visibleChildren(\n node,\n rect,\n \"x\",\n persisted\n )) {\n res.push(child.layoutInfo);\n }\n\n break;\n }\n\n default: {\n throw new Error(`Unknown node type ${node.layoutInfo.type}`);\n }\n }\n }\n private addVisibleRows(\n res: LayoutInfo[],\n node: LayoutNode,\n rect: Rect\n ): void {\n const persisted = this.persistedIndices.get(node.layoutInfo.key) ?? [];\n\n for (const child of TableLayout.visibleChildren(\n node,\n rect,\n \"y\",\n persisted\n )) {\n res.push(child.layoutInfo);\n this.addVisibleLayoutInfos(res, child, rect);\n }\n }\n private static visibleChildren(\n node: LayoutNode,\n rect: Rect,\n axis: \"x\" | \"y\",\n persisted: readonly number[]\n ): LayoutNode[] {\n const children = node.children ?? [];\n\n if (children.length === 0) {\n return [];\n }\n\n const first = TableLayout.binarySearch(children, rect.topLeft, axis);\n\n const last = TableLayout.binarySearch(\n children,\n axis === \"x\" ? rect.topRight : rect.bottomRight,\n axis\n );\n\n const indices = new Set(persisted);\n\n for (let index = first; index <= last; index += 1) {\n indices.add(index);\n }\n\n return [...indices]\n .toSorted((a, b) => a - b)\n .flatMap((index) => {\n const child = children[index];\n\n return child ? [child] : [];\n });\n }\n\n private static binarySearch(\n items: LayoutNode[],\n point: Point,\n axis: \"x\" | \"y\"\n ) {\n let low = 0;\n let high = items.length - 1;\n\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n\n const item = requireValue(\n items[mid],\n \"Binary search must stay within the layout nodes.\"\n );\n\n if (\n (axis === \"x\" && item.layoutInfo.rect.maxX <= point.x) ||\n (axis === \"y\" && item.layoutInfo.rect.maxY <= point.y)\n ) {\n low = mid + 1;\n } else if (\n (axis === \"x\" && item.layoutInfo.rect.x > point.x) ||\n (axis === \"y\" && item.layoutInfo.rect.y > point.y)\n ) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n\n return Math.max(0, Math.min(items.length - 1, low));\n }\n private buildPersistedIndices() {\n if (this.attachedVirtualizer.persistedKeys === this.lastPersistedKeys) {\n return;\n }\n\n this.lastPersistedKeys = this.attachedVirtualizer.persistedKeys;\n this.persistedIndices.clear();\n\n // Build a map of parentKey => indices of children to persist.\n for (const key of this.attachedVirtualizer.persistedKeys) {\n let layoutInfo = this.layoutNodes.get(key)?.layoutInfo;\n\n // Walk up ancestors so parents are also persisted if children are.\n while (\n layoutInfo &&\n layoutInfo.parentKey !== null &&\n layoutInfo.parentKey !== undefined\n ) {\n const collectionNode = this.attachedVirtualizer.collection.getItem(\n layoutInfo.key\n );\n\n let indices = this.persistedIndices.get(layoutInfo.parentKey);\n\n if (!indices) {\n // stickyColumnIndices are always persisted along with any cells from persistedKeys.\n indices =\n collectionNode?.type === \"cell\" || collectionNode?.type === \"column\"\n ? [...this.stickyColumnIndices]\n : [];\n this.persistedIndices.set(layoutInfo.parentKey, indices);\n }\n\n const index = this.layoutNodes.get(layoutInfo.key)?.index;\n\n if (index !== null && index !== undefined && !indices.includes(index)) {\n indices.push(index);\n }\n\n layoutInfo = this.layoutNodes.get(layoutInfo.parentKey)?.layoutInfo;\n }\n }\n\n for (const indices of this.persistedIndices.values()) {\n indices.sort((a, b) => a - b);\n }\n }\n override getDropTargetFromPoint(\n initialX: number,\n initialY: number,\n isValidDropTarget: (target: DropTarget) => boolean\n ): DropTarget | null {\n let x = initialX;\n\n let y = initialY;\n\n x += this.attachedVirtualizer.visibleRect.x;\n y += this.attachedVirtualizer.visibleRect.y;\n\n // Find the closest item within on either side of the point using the gap width.\n const searchRect = new Rect(\n x,\n Math.max(0, y - this.gap),\n 1,\n Math.max(1, this.gap * 2)\n );\n\n const candidates = this.getVisibleLayoutInfos(searchRect);\n let key: Key | null = null;\n let minDistance = Infinity;\n\n for (const candidate of candidates) {\n // Ignore items outside the search rect, e.g. persisted keys.\n if (candidate.type !== \"row\" || !candidate.rect.intersects(searchRect)) {\n continue;\n }\n\n const yDist = Math.abs(candidate.rect.y - y);\n const maxYDist = Math.abs(candidate.rect.maxY - y);\n const dist = Math.min(yDist, maxYDist);\n\n if (dist < minDistance) {\n minDistance = dist;\n ({ key } = candidate);\n }\n }\n\n if (\n key === null ||\n key === undefined ||\n this.attachedVirtualizer.collection.size === 0\n ) {\n return { type: \"root\" };\n }\n\n const layoutInfo = this.getLayoutInfo(key);\n\n if (!layoutInfo) {\n return null;\n }\n\n const { rect } = layoutInfo;\n\n const target: DropTarget = {\n dropPosition: \"on\",\n key: layoutInfo.key,\n type: \"item\",\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (\n y <= rect.y + rect.height / 2 &&\n isValidDropTarget({ ...target, dropPosition: \"before\" })\n ) {\n target.dropPosition = \"before\";\n } else if (isValidDropTarget({ ...target, dropPosition: \"after\" })) {\n target.dropPosition = \"after\";\n }\n } else if (\n y <= rect.y + 10 &&\n isValidDropTarget({ ...target, dropPosition: \"before\" })\n ) {\n target.dropPosition = \"before\";\n } else if (\n y >= rect.maxY - 10 &&\n isValidDropTarget({ ...target, dropPosition: \"after\" })\n ) {\n target.dropPosition = \"after\";\n }\n\n return target;\n }\n override getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {\n const layoutInfo = super.getDropTargetLayoutInfo(target);\n layoutInfo.parentKey =\n this.attachedVirtualizer.collection.getItem(target.key)?.parentKey ??\n null;\n\n return layoutInfo;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,MAAM,qBAAqB;;;;;AAM3B,IAAa,cAAb,MAAa,oBAGH,WAAiB;CACzB,iBAA+D;CAC/D,+BAAuB,IAAI,IAAiB;CAC5C;CACA,oBAA6C;CAC7C,mCAAoC,IAAI,IAAmB;CAC3D,YAAY,SAA4B;EACtC,MAAM,OAAO;EACb,KAAK,sBAAsB,CAAC;CAC9B;CAEA,IAAuB,aAAiC;EACtD,MAAM,EAAE,eAAe,KAAK;EAE5B,IAAI,CAAC,kBAAkB,UAAU,GAC/B,MAAM,IAAI,UAAU,0CAA0C;EAGhE,OAAO;CACT;CAEA,IAAuB,YAA2B;EAChD,OAAO,KAAK;CACd;CACA,IAAuB,qBAAoC;EACzD,OAAO,KAAK;CACd;CACA,IAAuB,gBAA+B;EACpD,OAAO,KAAK;CACd;CACA,IAAuB,yBAAwC;EAC7D,OAAO,KAAK;CACd;CACA,IAAuB,eAA8B;EACnD,OAAO,KAAK;CACd;CACA,OAAe,eACb,eACA,eACA;EACA,OACE,CAAC,iBACA,cAAc,YAAY,cAAc,WACvC,cAAc,QAAQ,WAAW,cAAc,QAA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