@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 @@
1
+ {"version":3,"file":"require-value.js","names":[],"sources":["../../src/utils/require-value.ts"],"sourcesContent":["/** Check collection and layout invariants that TypeScript cannot infer from key or index bounds. */\nexport function requireValue<T>(value: T, message: string): NonNullable<T> {\n if (value === null || value === undefined) {\n throw new Error(message);\n }\n\n return value;\n}\n"],"mappings":";;;AACA,SAAgB,aAAgB,OAAU,SAAiC;CACzE,IAAI,UAAU,QAAQ,UAAU,KAAA,GAC9B,MAAM,IAAI,MAAM,OAAO;CAGzB,OAAO;AACT"}
@@ -0,0 +1,44 @@
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/virtualizer/useVirtualizerState.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 { Size } from "./size.js";
18
+ import { Rect } from "./rect.js";
19
+ import { ReusableView } from "./reusable-view.js";
20
+ import { Virtualizer } from "./virtualizer.js";
21
+ import { Layout } from "./layout.js";
22
+ import { Collection, Key } from "@solid2-aria/types-shared";
23
+ export interface VirtualizerProps<T extends object, V, O> {
24
+ renderView: (type: string, content: T | null) => V;
25
+ layout: Layout<T>;
26
+ collection: Collection<T>;
27
+ onVisibleRectChange: (rect: Rect) => void;
28
+ persistedKeys?: Set<Key> | null;
29
+ layoutOptions?: O;
30
+ allowsWindowScrolling?: boolean;
31
+ }
32
+ export interface VirtualizerState<T extends object, V> {
33
+ visibleViews: ReusableView<T, V>[];
34
+ setVisibleRect: (rect: Rect) => void;
35
+ size: Size;
36
+ setSize: (size: Size) => void;
37
+ contentSize: Size;
38
+ virtualizer: Virtualizer<T, V>;
39
+ isScrolling: boolean;
40
+ startScrolling: () => void;
41
+ endScrolling: () => void;
42
+ }
43
+ export declare function createVirtualizerState<T extends object, V, O = unknown>(opts: VirtualizerProps<T, V, O>): VirtualizerState<T, V>;
44
+ //# sourceMappingURL=create-virtualizer-state.d.ts.map
@@ -0,0 +1,92 @@
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/virtualizer/useVirtualizerState.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 { Rect } from "./rect.js";
18
+ import { Size } from "./size.js";
19
+ import { Virtualizer } from "./virtualizer.js";
20
+ import { createEffect, createMemo, createSignal, untrack } from "solid-js";
21
+ // src/virtualizer/create-virtualizer-state.ts
22
+ function createVirtualizerState(opts) {
23
+ const [visibleRect, setVisibleRect] = createSignal(new Rect(0, 0, 0, 0), { ownedWrite: true });
24
+ const [size, setSize] = createSignal(new Size(), { ownedWrite: true });
25
+ const [isScrolling, setScrolling] = createSignal(false, { ownedWrite: true });
26
+ const [invalidationContext, setInvalidationContext] = createSignal({}, { ownedWrite: true });
27
+ let visibleRectChanged = false;
28
+ const virtualizer = untrack(() => new Virtualizer({
29
+ collection: opts.collection,
30
+ delegate: {
31
+ invalidate: (context) => {
32
+ setInvalidationContext(context);
33
+ },
34
+ renderView: (type, content) => opts.renderView(type, content),
35
+ setVisibleRect(rect) {
36
+ visibleRectChanged = true;
37
+ setVisibleRect(rect);
38
+ }
39
+ },
40
+ layout: opts.layout
41
+ }));
42
+ createEffect(() => visibleRect(), (rect) => {
43
+ if (visibleRectChanged) {
44
+ visibleRectChanged = false;
45
+ opts.onVisibleRectChange(rect);
46
+ }
47
+ });
48
+ const visibleViews = createMemo(() => virtualizer.render({
49
+ collection: opts.collection,
50
+ invalidationContext: {
51
+ ...invalidationContext(),
52
+ layoutOptions: opts.layoutOptions
53
+ },
54
+ isScrolling: isScrolling(),
55
+ layout: opts.layout,
56
+ layoutOptions: opts.layoutOptions,
57
+ persistedKeys: opts.persistedKeys,
58
+ size: opts.allowsWindowScrolling === true ? size() : visibleRect(),
59
+ visibleRect: visibleRect()
60
+ }));
61
+ return {
62
+ get contentSize() {
63
+ visibleViews();
64
+ return virtualizer.contentSize;
65
+ },
66
+ endScrolling: () => {
67
+ setScrolling(false);
68
+ },
69
+ get isScrolling() {
70
+ return isScrolling();
71
+ },
72
+ setSize(next) {
73
+ setSize(next);
74
+ },
75
+ setVisibleRect(next) {
76
+ setVisibleRect(next);
77
+ },
78
+ get size() {
79
+ return size();
80
+ },
81
+ startScrolling: () => {
82
+ setScrolling(true);
83
+ },
84
+ virtualizer,
85
+ get visibleViews() {
86
+ return visibleViews();
87
+ }
88
+ };
89
+ }
90
+ export { createVirtualizerState };
91
+
92
+ //# sourceMappingURL=create-virtualizer-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-virtualizer-state.js","names":[],"sources":["../../src/virtualizer/create-virtualizer-state.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/virtualizer/useVirtualizerState.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 { Collection, Key } from \"@solid2-aria/types-shared\";\nimport { createEffect, createMemo, createSignal, untrack } from \"solid-js\";\n\nimport type { Layout } from \"./layout\";\nimport { Rect } from \"./rect\";\nimport type { ReusableView } from \"./reusable-view\";\nimport { Size } from \"./size\";\nimport type { InvalidationContext } from \"./types\";\nimport { Virtualizer } from \"./virtualizer\";\n\nexport interface VirtualizerProps<T extends object, V, O> {\n renderView: (type: string, content: T | null) => V;\n layout: Layout<T>;\n collection: Collection<T>;\n onVisibleRectChange: (rect: Rect) => void;\n persistedKeys?: Set<Key> | null;\n layoutOptions?: O;\n allowsWindowScrolling?: boolean;\n}\n\nexport interface VirtualizerState<T extends object, V> {\n visibleViews: ReusableView<T, V>[];\n setVisibleRect: (rect: Rect) => void;\n size: Size;\n setSize: (size: Size) => void;\n contentSize: Size;\n virtualizer: Virtualizer<T, V>;\n isScrolling: boolean;\n startScrolling: () => void;\n endScrolling: () => void;\n}\n\nexport function createVirtualizerState<T extends object, V, O = unknown>(\n opts: VirtualizerProps<T, V, O>\n): VirtualizerState<T, V> {\n const [visibleRect, setVisibleRect] = createSignal(new Rect(0, 0, 0, 0), {\n ownedWrite: true,\n });\n\n const [size, setSize] = createSignal(new Size(), { ownedWrite: true });\n const [isScrolling, setScrolling] = createSignal(false, { ownedWrite: true });\n\n const [invalidationContext, setInvalidationContext] =\n createSignal<InvalidationContext>({}, { ownedWrite: true });\n\n let visibleRectChanged = false;\n\n const virtualizer = untrack(\n () =>\n new Virtualizer<T, V>({\n collection: opts.collection,\n delegate: {\n invalidate: (context) => {\n setInvalidationContext(context);\n },\n renderView: (type, content) => opts.renderView(type, content),\n setVisibleRect(rect) {\n visibleRectChanged = true;\n setVisibleRect(rect);\n },\n },\n layout: opts.layout,\n })\n );\n\n createEffect(\n () => visibleRect(),\n (rect) => {\n if (visibleRectChanged) {\n visibleRectChanged = false;\n opts.onVisibleRectChange(rect);\n }\n }\n );\n\n const visibleViews = createMemo(() =>\n virtualizer.render({\n collection: opts.collection,\n invalidationContext: {\n ...invalidationContext(),\n layoutOptions: opts.layoutOptions,\n },\n isScrolling: isScrolling(),\n layout: opts.layout,\n layoutOptions: opts.layoutOptions,\n persistedKeys: opts.persistedKeys,\n size: opts.allowsWindowScrolling === true ? size() : visibleRect(),\n visibleRect: visibleRect(),\n })\n );\n\n return {\n get contentSize() {\n visibleViews();\n\n return virtualizer.contentSize;\n },\n endScrolling: () => {\n setScrolling(false);\n },\n get isScrolling() {\n return isScrolling();\n },\n setSize(next: Size) {\n setSize(next);\n },\n setVisibleRect(next: Rect) {\n setVisibleRect(next);\n },\n get size() {\n return size();\n },\n startScrolling: () => {\n setScrolling(true);\n },\n virtualizer,\n get visibleViews() {\n return visibleViews();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiDA,SAAgB,uBACd,MACwB;CACxB,MAAM,CAAC,aAAa,kBAAkB,aAAa,IAAI,KAAK,GAAG,GAAG,GAAG,CAAC,GAAG,EACvE,YAAY,KACd,CAAC;CAED,MAAM,CAAC,MAAM,WAAW,aAAa,IAAI,KAAK,GAAG,EAAE,YAAY,KAAK,CAAC;CACrE,MAAM,CAAC,aAAa,gBAAgB,aAAa,OAAO,EAAE,YAAY,KAAK,CAAC;CAE5E,MAAM,CAAC,qBAAqB,0BAC1B,aAAkC,CAAC,GAAG,EAAE,YAAY,KAAK,CAAC;CAE5D,IAAI,qBAAqB;CAEzB,MAAM,cAAc,cAEhB,IAAI,YAAkB;EACpB,YAAY,KAAK;EACjB,UAAU;GACR,aAAa,YAAY;IACvB,uBAAuB,OAAO;GAChC;GACA,aAAa,MAAM,YAAY,KAAK,WAAW,MAAM,OAAO;GAC5D,eAAe,MAAM;IACnB,qBAAqB;IACrB,eAAe,IAAI;GACrB;EACF;EACA,QAAQ,KAAK;CACf,CAAC,CACL;CAEA,mBACQ,YAAY,IACjB,SAAS;EACR,IAAI,oBAAoB;GACtB,qBAAqB;GACrB,KAAK,oBAAoB,IAAI;EAC/B;CACF,CACF;CAEA,MAAM,eAAe,iBACnB,YAAY,OAAO;EACjB,YAAY,KAAK;EACjB,qBAAqB;GACnB,GAAG,oBAAoB;GACvB,eAAe,KAAK;EACtB;EACA,aAAa,YAAY;EACzB,QAAQ,KAAK;EACb,eAAe,KAAK;EACpB,eAAe,KAAK;EACpB,MAAM,KAAK,0BAA0B,OAAO,KAAK,IAAI,YAAY;EACjE,aAAa,YAAY;CAC3B,CAAC,CACH;CAEA,OAAO;EACL,IAAI,cAAc;GAChB,aAAa;GAEb,OAAO,YAAY;EACrB;EACA,oBAAoB;GAClB,aAAa,KAAK;EACpB;EACA,IAAI,cAAc;GAChB,OAAO,YAAY;EACrB;EACA,QAAQ,MAAY;GAClB,QAAQ,IAAI;EACd;EACA,eAAe,MAAY;GACzB,eAAe,IAAI;EACrB;EACA,IAAI,OAAO;GACT,OAAO,KAAK;EACd;EACA,sBAAsB;GACpB,aAAa,IAAI;EACnB;EACA;EACA,IAAI,eAAe;GACjB,OAAO,aAAa;EACtB;CACF;AACF"}
@@ -0,0 +1,94 @@
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/virtualizer/LayoutInfo.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 { Rect } from "./rect.js";
18
+ import { Key } from "@solid2-aria/types-shared";
19
+ /**
20
+ * Instances of this lightweight class are created by `Layout` subclasses
21
+ * to represent each item in the `Virtualizer`. LayoutInfo objects describe
22
+ * various properties of an item, such as its position and size, and style information.
23
+ * The virtualizer uses this information when creating actual DOM elements to display.
24
+ */
25
+ export declare class LayoutInfo<T = unknown> {
26
+ /**
27
+ * The type of element represented by this LayoutInfo. Should match the `type` of the
28
+ * corresponding collection node.
29
+ */
30
+ type: string;
31
+ /**
32
+ * A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.
33
+ */
34
+ key: Key;
35
+ /**
36
+ * The key for a parent LayoutInfo, if any.
37
+ */
38
+ parentKey: Key | null;
39
+ /**
40
+ * Content for this item if it was generated by the layout rather than coming from the Collection.
41
+ */
42
+ content: T | null;
43
+ /**
44
+ * The rectangle describing the size and position of this element.
45
+ */
46
+ rect: Rect;
47
+ /**
48
+ * Whether the size is estimated. `false` by default.
49
+ * Items with estimated sizes will be measured the first time they are added to the DOM.
50
+ * The estimated size is used to calculate the size and position of the scrollbar.
51
+ *
52
+ * @default false
53
+ */
54
+ estimatedSize: boolean;
55
+ /**
56
+ * Whether the layout info sticks to the viewport when scrolling.
57
+ *
58
+ * @default false
59
+ */
60
+ isSticky: boolean;
61
+ /**
62
+ * The element's opacity.
63
+ *
64
+ * @default 1
65
+ */
66
+ opacity: number;
67
+ /**
68
+ * A CSS transform string to apply to the element. `null` by default.
69
+ */
70
+ transform: string | null;
71
+ /**
72
+ * The z-index of the element. 0 by default.
73
+ */
74
+ zIndex: number;
75
+ /**
76
+ * Whether the element allows its contents to overflow its container.
77
+ *
78
+ * @default false
79
+ */
80
+ allowOverflow: boolean;
81
+ /**
82
+ * @param type The type of element represented by this LayoutInfo. Should match the `type` of the
83
+ * corresponding collection node.
84
+ * @param key A unique key for this LayoutInfo. Should match the `key` of the corresponding
85
+ * collection node.
86
+ * @param rect The rectangle describing the size and position of this element.
87
+ */
88
+ constructor(type: string, key: Key, rect: Rect);
89
+ /**
90
+ * Returns a copy of the LayoutInfo.
91
+ */
92
+ copy(): LayoutInfo<T>;
93
+ }
94
+ //# sourceMappingURL=layout-info.d.ts.map
@@ -0,0 +1,118 @@
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/virtualizer/LayoutInfo.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
+ // src/virtualizer/layout-info.ts
18
+ /**
19
+ * Instances of this lightweight class are created by `Layout` subclasses
20
+ * to represent each item in the `Virtualizer`. LayoutInfo objects describe
21
+ * various properties of an item, such as its position and size, and style information.
22
+ * The virtualizer uses this information when creating actual DOM elements to display.
23
+ */
24
+ var LayoutInfo = class LayoutInfo {
25
+ /**
26
+ * The type of element represented by this LayoutInfo. Should match the `type` of the
27
+ * corresponding collection node.
28
+ */
29
+ type;
30
+ /**
31
+ * A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.
32
+ */
33
+ key;
34
+ /**
35
+ * The key for a parent LayoutInfo, if any.
36
+ */
37
+ parentKey;
38
+ /**
39
+ * Content for this item if it was generated by the layout rather than coming from the Collection.
40
+ */
41
+ content;
42
+ /**
43
+ * The rectangle describing the size and position of this element.
44
+ */
45
+ rect;
46
+ /**
47
+ * Whether the size is estimated. `false` by default.
48
+ * Items with estimated sizes will be measured the first time they are added to the DOM.
49
+ * The estimated size is used to calculate the size and position of the scrollbar.
50
+ *
51
+ * @default false
52
+ */
53
+ estimatedSize;
54
+ /**
55
+ * Whether the layout info sticks to the viewport when scrolling.
56
+ *
57
+ * @default false
58
+ */
59
+ isSticky;
60
+ /**
61
+ * The element's opacity.
62
+ *
63
+ * @default 1
64
+ */
65
+ opacity;
66
+ /**
67
+ * A CSS transform string to apply to the element. `null` by default.
68
+ */
69
+ transform;
70
+ /**
71
+ * The z-index of the element. 0 by default.
72
+ */
73
+ zIndex;
74
+ /**
75
+ * Whether the element allows its contents to overflow its container.
76
+ *
77
+ * @default false
78
+ */
79
+ allowOverflow;
80
+ /**
81
+ * @param type The type of element represented by this LayoutInfo. Should match the `type` of the
82
+ * corresponding collection node.
83
+ * @param key A unique key for this LayoutInfo. Should match the `key` of the corresponding
84
+ * collection node.
85
+ * @param rect The rectangle describing the size and position of this element.
86
+ */
87
+ constructor(type, key, rect) {
88
+ this.type = type;
89
+ this.key = key;
90
+ this.parentKey = null;
91
+ this.content = null;
92
+ this.rect = rect;
93
+ this.estimatedSize = false;
94
+ this.isSticky = false;
95
+ this.opacity = 1;
96
+ this.transform = null;
97
+ this.zIndex = 0;
98
+ this.allowOverflow = false;
99
+ }
100
+ /**
101
+ * Returns a copy of the LayoutInfo.
102
+ */
103
+ copy() {
104
+ const res = new LayoutInfo(this.type, this.key, this.rect.copy());
105
+ res.estimatedSize = this.estimatedSize;
106
+ res.opacity = this.opacity;
107
+ res.transform = this.transform;
108
+ res.parentKey = this.parentKey;
109
+ res.content = this.content;
110
+ res.isSticky = this.isSticky;
111
+ res.zIndex = this.zIndex;
112
+ res.allowOverflow = this.allowOverflow;
113
+ return res;
114
+ }
115
+ };
116
+ export { LayoutInfo };
117
+
118
+ //# sourceMappingURL=layout-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-info.js","names":[],"sources":["../../src/virtualizer/layout-info.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/virtualizer/LayoutInfo.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 { Key } from \"@solid2-aria/types-shared\";\n\nimport type { Rect } from \"./rect\";\n\n/**\n * Instances of this lightweight class are created by `Layout` subclasses\n * to represent each item in the `Virtualizer`. LayoutInfo objects describe\n * various properties of an item, such as its position and size, and style information.\n * The virtualizer uses this information when creating actual DOM elements to display.\n */\nexport class LayoutInfo<T = unknown> {\n /**\n * The type of element represented by this LayoutInfo. Should match the `type` of the\n * corresponding collection node.\n */\n type: string;\n /**\n * A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.\n */\n key: Key;\n /**\n * The key for a parent LayoutInfo, if any.\n */\n parentKey: Key | null;\n /**\n * Content for this item if it was generated by the layout rather than coming from the Collection.\n */\n content: T | null;\n /**\n * The rectangle describing the size and position of this element.\n */\n rect: Rect;\n /**\n * Whether the size is estimated. `false` by default.\n * Items with estimated sizes will be measured the first time they are added to the DOM.\n * The estimated size is used to calculate the size and position of the scrollbar.\n *\n * @default false\n */\n estimatedSize: boolean;\n /**\n * Whether the layout info sticks to the viewport when scrolling.\n *\n * @default false\n */\n isSticky: boolean;\n /**\n * The element's opacity.\n *\n * @default 1\n */\n opacity: number;\n /**\n * A CSS transform string to apply to the element. `null` by default.\n */\n transform: string | null;\n /**\n * The z-index of the element. 0 by default.\n */\n zIndex: number;\n /**\n * Whether the element allows its contents to overflow its container.\n *\n * @default false\n */\n allowOverflow: boolean;\n /**\n * @param type The type of element represented by this LayoutInfo. Should match the `type` of the\n * corresponding collection node.\n * @param key A unique key for this LayoutInfo. Should match the `key` of the corresponding\n * collection node.\n * @param rect The rectangle describing the size and position of this element.\n */\n constructor(type: string, key: Key, rect: Rect) {\n this.type = type;\n this.key = key;\n this.parentKey = null;\n this.content = null;\n this.rect = rect;\n this.estimatedSize = false;\n this.isSticky = false;\n this.opacity = 1;\n this.transform = null;\n this.zIndex = 0;\n this.allowOverflow = false;\n }\n /**\n * Returns a copy of the LayoutInfo.\n */\n copy(): LayoutInfo<T> {\n const res = new LayoutInfo<T>(this.type, this.key, this.rect.copy());\n res.estimatedSize = this.estimatedSize;\n res.opacity = this.opacity;\n res.transform = this.transform;\n res.parentKey = this.parentKey;\n res.content = this.content;\n res.isSticky = this.isSticky;\n res.zIndex = this.zIndex;\n res.allowOverflow = this.allowOverflow;\n\n return res;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAa,aAAb,MAAa,WAAwB;;;;;CAKnC;;;;CAIA;;;;CAIA;;;;CAIA;;;;CAIA;;;;;;;;CAQA;;;;;;CAMA;;;;;;CAMA;;;;CAIA;;;;CAIA;;;;;;CAMA;;;;;;;;CAQA,YAAY,MAAc,KAAU,MAAY;EAC9C,KAAK,OAAO;EACZ,KAAK,MAAM;EACX,KAAK,YAAY;EACjB,KAAK,UAAU;EACf,KAAK,OAAO;EACZ,KAAK,gBAAgB;EACrB,KAAK,WAAW;EAChB,KAAK,UAAU;EACf,KAAK,YAAY;EACjB,KAAK,SAAS;EACd,KAAK,gBAAgB;CACvB;;;;CAIA,OAAsB;EACpB,MAAM,MAAM,IAAI,WAAc,KAAK,MAAM,KAAK,KAAK,KAAK,KAAK,KAAK,CAAC;EACnE,IAAI,gBAAgB,KAAK;EACzB,IAAI,UAAU,KAAK;EACnB,IAAI,YAAY,KAAK;EACrB,IAAI,YAAY,KAAK;EACrB,IAAI,UAAU,KAAK;EACnB,IAAI,WAAW,KAAK;EACpB,IAAI,SAAS,KAAK;EAClB,IAAI,gBAAgB,KAAK;EAEzB,OAAO;CACT;AACF"}
@@ -0,0 +1,91 @@
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/virtualizer/Layout.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 { Size } from "./size.js";
18
+ import { Rect } from "./rect.js";
19
+ import { LayoutInfo } from "./layout-info.js";
20
+ import { ScrollAnchorInfo } from "./scroll-anchor.js";
21
+ import { InvalidationContext } from "./types.js";
22
+ import { Virtualizer } from "./virtualizer.js";
23
+ import { ItemDropTarget, Key, LayoutDelegate, Node } from "@solid2-aria/types-shared";
24
+ /**
25
+ * Virtualizer supports arbitrary layout objects, which compute what items are visible, and how
26
+ * to position and style them. However, layouts do not render items directly. Instead,
27
+ * layouts produce lightweight LayoutInfo objects which describe various properties of an item,
28
+ * such as its position and size. The Virtualizer is then responsible for creating the actual
29
+ * views as needed, based on this layout information.
30
+ *
31
+ * Every layout extends from the Layout abstract base class. Layouts must implement the
32
+ * `getVisibleLayoutInfos`, `getLayoutInfo`, and `getContentSize` methods. All other methods can be
33
+ * optionally overridden to implement custom behavior.
34
+ */
35
+ export declare abstract class Layout<T extends object = Node<unknown>, O = unknown> implements LayoutDelegate {
36
+ /** The Virtualizer the layout is currently attached to. */
37
+ virtualizer: Virtualizer<T, unknown> | null;
38
+ protected get attachedVirtualizer(): Virtualizer<T, unknown>;
39
+ /**
40
+ * Returns an array of `LayoutInfo` objects which are inside the given rectangle.
41
+ * Should be implemented by subclasses.
42
+ *
43
+ * @param rect The rectangle that should contain the returned LayoutInfo objects.
44
+ */
45
+ abstract getVisibleLayoutInfos(rect: Rect): LayoutInfo[];
46
+ /**
47
+ * Returns a `LayoutInfo` for the given key.
48
+ * Should be implemented by subclasses.
49
+ *
50
+ * @param key The key of the LayoutInfo to retrieve.
51
+ */
52
+ abstract getLayoutInfo(key: Key): LayoutInfo | null;
53
+ /**
54
+ * Returns size of the content. By default, it returns virtualizer's size.
55
+ */
56
+ abstract getContentSize(): Size;
57
+ /**
58
+ * Returns whether the layout should invalidate in response to
59
+ * visible rectangle changes. By default, it only invalidates
60
+ * when the virtualizer's size changes. Return true always
61
+ * to make the layout invalidate while scrolling (e.g. sticky headers).
62
+ */
63
+ shouldInvalidate(newRect: Rect, oldRect: Rect): boolean;
64
+ /**
65
+ * Returns whether the layout should invalidate when the layout options change.
66
+ * By default it invalidates when the object identity changes. Override this
67
+ * method to optimize layout updates based on specific option changes.
68
+ */
69
+ shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean;
70
+ /**
71
+ * This method allows the layout to perform any pre-computation
72
+ * it needs to in order to prepare LayoutInfos for retrieval.
73
+ * Called by the virtualizer before `getVisibleLayoutInfos`
74
+ * or `getLayoutInfo` are called.
75
+ */
76
+ update(_invalidationContext: InvalidationContext<O>): void;
77
+ /**
78
+ * Updates the size of the given item.
79
+ */
80
+ updateItemSize?(key: Key, size: Size): boolean;
81
+ /**
82
+ * Returns a `LayoutInfo` for the given drop target.
83
+ */
84
+ getDropTargetLayoutInfo?(target: ItemDropTarget): LayoutInfo;
85
+ UNSTABLE_getScrollAnchorInfo?(options: O | undefined): ScrollAnchorInfo | null;
86
+ /** @private */
87
+ getItemRect(key: Key): Rect | null;
88
+ /** @private */
89
+ getVisibleRect(): Rect;
90
+ }
91
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1,71 @@
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/virtualizer/Layout.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
+ // src/virtualizer/layout.ts
18
+ /**
19
+ * Virtualizer supports arbitrary layout objects, which compute what items are visible, and how
20
+ * to position and style them. However, layouts do not render items directly. Instead,
21
+ * layouts produce lightweight LayoutInfo objects which describe various properties of an item,
22
+ * such as its position and size. The Virtualizer is then responsible for creating the actual
23
+ * views as needed, based on this layout information.
24
+ *
25
+ * Every layout extends from the Layout abstract base class. Layouts must implement the
26
+ * `getVisibleLayoutInfos`, `getLayoutInfo`, and `getContentSize` methods. All other methods can be
27
+ * optionally overridden to implement custom behavior.
28
+ */
29
+ var Layout = class {
30
+ /** The Virtualizer the layout is currently attached to. */
31
+ virtualizer = null;
32
+ get attachedVirtualizer() {
33
+ if (this.virtualizer === null) throw new Error("Attach the layout to a virtualizer before using it.");
34
+ return this.virtualizer;
35
+ }
36
+ /**
37
+ * Returns whether the layout should invalidate in response to
38
+ * visible rectangle changes. By default, it only invalidates
39
+ * when the virtualizer's size changes. Return true always
40
+ * to make the layout invalidate while scrolling (e.g. sticky headers).
41
+ */
42
+ shouldInvalidate(newRect, oldRect) {
43
+ return newRect.width !== oldRect.width || newRect.height !== oldRect.height;
44
+ }
45
+ /**
46
+ * Returns whether the layout should invalidate when the layout options change.
47
+ * By default it invalidates when the object identity changes. Override this
48
+ * method to optimize layout updates based on specific option changes.
49
+ */
50
+ shouldInvalidateLayoutOptions(newOptions, oldOptions) {
51
+ return newOptions !== oldOptions;
52
+ }
53
+ /**
54
+ * This method allows the layout to perform any pre-computation
55
+ * it needs to in order to prepare LayoutInfos for retrieval.
56
+ * Called by the virtualizer before `getVisibleLayoutInfos`
57
+ * or `getLayoutInfo` are called.
58
+ */
59
+ update(_invalidationContext) {}
60
+ /** @private */
61
+ getItemRect(key) {
62
+ return this.getLayoutInfo(key)?.rect ?? null;
63
+ }
64
+ /** @private */
65
+ getVisibleRect() {
66
+ return this.attachedVirtualizer.visibleRect;
67
+ }
68
+ };
69
+ export { Layout };
70
+
71
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","names":[],"sources":["../../src/virtualizer/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/virtualizer/Layout.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 ItemDropTarget,\n Key,\n LayoutDelegate,\n Node,\n} from \"@solid2-aria/types-shared\";\n\nimport type { LayoutInfo } from \"./layout-info\";\nimport type { Rect } from \"./rect\";\nimport type { ScrollAnchorInfo } from \"./scroll-anchor\";\nimport type { Size } from \"./size\";\nimport type { InvalidationContext } from \"./types\";\nimport type { Virtualizer } from \"./virtualizer\";\n\n/**\n * Virtualizer supports arbitrary layout objects, which compute what items are visible, and how\n * to position and style them. However, layouts do not render items directly. Instead,\n * layouts produce lightweight LayoutInfo objects which describe various properties of an item,\n * such as its position and size. The Virtualizer is then responsible for creating the actual\n * views as needed, based on this layout information.\n *\n * Every layout extends from the Layout abstract base class. Layouts must implement the\n * `getVisibleLayoutInfos`, `getLayoutInfo`, and `getContentSize` methods. All other methods can be\n * optionally overridden to implement custom behavior.\n */\nexport abstract class Layout<\n T extends object = Node<unknown>,\n O = unknown,\n> implements LayoutDelegate {\n /** The Virtualizer the layout is currently attached to. */\n virtualizer: Virtualizer<T, unknown> | null = null;\n protected get attachedVirtualizer(): Virtualizer<T, unknown> {\n if (this.virtualizer === null) {\n throw new Error(\"Attach the layout to a virtualizer before using it.\");\n }\n\n return this.virtualizer;\n }\n /**\n * Returns an array of `LayoutInfo` objects which are inside the given rectangle.\n * Should be implemented by subclasses.\n *\n * @param rect The rectangle that should contain the returned LayoutInfo objects.\n */\n abstract getVisibleLayoutInfos(rect: Rect): LayoutInfo[];\n /**\n * Returns a `LayoutInfo` for the given key.\n * Should be implemented by subclasses.\n *\n * @param key The key of the LayoutInfo to retrieve.\n */\n abstract getLayoutInfo(key: Key): LayoutInfo | null;\n /**\n * Returns size of the content. By default, it returns virtualizer's size.\n */\n abstract getContentSize(): Size;\n /**\n * Returns whether the layout should invalidate in response to\n * visible rectangle changes. By default, it only invalidates\n * when the virtualizer's size changes. Return true always\n * to make the layout invalidate while scrolling (e.g. sticky headers).\n */\n shouldInvalidate(newRect: Rect, oldRect: Rect): boolean {\n // By default, invalidate when the size changes\n return newRect.width !== oldRect.width || newRect.height !== oldRect.height;\n }\n /**\n * Returns whether the layout should invalidate when the layout options change.\n * By default it invalidates when the object identity changes. Override this\n * method to optimize layout updates based on specific option changes.\n */\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return newOptions !== oldOptions;\n }\n /**\n * This method allows the layout to perform any pre-computation\n * it needs to in order to prepare LayoutInfos for retrieval.\n * Called by the virtualizer before `getVisibleLayoutInfos`\n * or `getLayoutInfo` are called.\n */\n update(_invalidationContext: InvalidationContext<O>): void {\n /* Layout subclasses may precompute positions here. */\n }\n /**\n * Updates the size of the given item.\n */\n updateItemSize?(key: Key, size: Size): boolean;\n /**\n * Returns a `LayoutInfo` for the given drop target.\n */\n getDropTargetLayoutInfo?(target: ItemDropTarget): LayoutInfo;\n UNSTABLE_getScrollAnchorInfo?(\n options: O | undefined\n ): ScrollAnchorInfo | null;\n /** @private */\n getItemRect(key: Key): Rect | null {\n return this.getLayoutInfo(key)?.rect ?? null;\n }\n /** @private */\n getVisibleRect(): Rect {\n return this.attachedVirtualizer.visibleRect;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,IAAsB,SAAtB,MAG4B;;CAE1B,cAA8C;CAC9C,IAAc,sBAA+C;EAC3D,IAAI,KAAK,gBAAgB,MACvB,MAAM,IAAI,MAAM,qDAAqD;EAGvE,OAAO,KAAK;CACd;;;;;;;CAyBA,iBAAiB,SAAe,SAAwB;EAEtD,OAAO,QAAQ,UAAU,QAAQ,SAAS,QAAQ,WAAW,QAAQ;CACvE;;;;;;CAMA,8BAA8B,YAAe,YAAwB;EACnE,OAAO,eAAe;CACxB;;;;;;;CAOA,OAAO,sBAAoD,CAE3D;;CAaA,YAAY,KAAuB;EACjC,OAAO,KAAK,cAAc,GAAG,CAAC,EAAE,QAAQ;CAC1C;;CAEA,iBAAuB;EACrB,OAAO,KAAK,oBAAoB;CAClC;AACF"}
@@ -0,0 +1,25 @@
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/virtualizer/OverscanManager.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 { Rect } from "./rect.js";
18
+ export declare class OverscanManager {
19
+ private startTime;
20
+ private readonly velocity;
21
+ private visibleRect;
22
+ setVisibleRect(rect: Rect): void;
23
+ getOverscannedRect(): Rect;
24
+ }
25
+ //# sourceMappingURL=overscan-manager.d.ts.map
@@ -0,0 +1,46 @@
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/virtualizer/OverscanManager.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 { Point } from "./point.js";
18
+ import { Rect } from "./rect.js";
19
+ // src/virtualizer/overscan-manager.ts
20
+ var OverscanManager = class {
21
+ startTime = 0;
22
+ velocity = new Point(0, 0);
23
+ visibleRect = new Rect();
24
+ setVisibleRect(rect) {
25
+ const time = performance.now() - this.startTime;
26
+ if (time < 500) {
27
+ if (rect.x !== this.visibleRect.x && time > 0) this.velocity.x = (rect.x - this.visibleRect.x) / time;
28
+ if (rect.y !== this.visibleRect.y && time > 0) this.velocity.y = (rect.y - this.visibleRect.y) / time;
29
+ }
30
+ this.startTime = performance.now();
31
+ this.visibleRect = rect;
32
+ }
33
+ getOverscannedRect() {
34
+ const overscanned = this.visibleRect.copy();
35
+ const overscanY = this.visibleRect.height / 3;
36
+ overscanned.height += overscanY;
37
+ if (this.velocity.y < 0) overscanned.y -= overscanY;
38
+ const overscanX = this.visibleRect.width / 3;
39
+ overscanned.width += overscanX;
40
+ if (this.velocity.x < 0) overscanned.x -= overscanX;
41
+ return overscanned;
42
+ }
43
+ };
44
+ export { OverscanManager };
45
+
46
+ //# sourceMappingURL=overscan-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overscan-manager.js","names":[],"sources":["../../src/virtualizer/overscan-manager.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/virtualizer/OverscanManager.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 { Point } from \"./point\";\nimport { Rect } from \"./rect\";\n\nexport class OverscanManager {\n private startTime = 0;\n private readonly velocity = new Point(0, 0);\n private visibleRect = new Rect();\n\n setVisibleRect(rect: Rect): void {\n const time = performance.now() - this.startTime;\n\n if (time < 500) {\n if (rect.x !== this.visibleRect.x && time > 0) {\n this.velocity.x = (rect.x - this.visibleRect.x) / time;\n }\n\n if (rect.y !== this.visibleRect.y && time > 0) {\n this.velocity.y = (rect.y - this.visibleRect.y) / time;\n }\n }\n\n this.startTime = performance.now();\n this.visibleRect = rect;\n }\n\n getOverscannedRect(): Rect {\n const overscanned = this.visibleRect.copy();\n\n const overscanY = this.visibleRect.height / 3;\n overscanned.height += overscanY;\n\n if (this.velocity.y < 0) {\n overscanned.y -= overscanY;\n }\n\n const overscanX = this.visibleRect.width / 3;\n overscanned.width += overscanX;\n\n if (this.velocity.x < 0) {\n overscanned.x -= overscanX;\n }\n\n return overscanned;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAa,kBAAb,MAA6B;CAC3B,YAAoB;CACpB,WAA4B,IAAI,MAAM,GAAG,CAAC;CAC1C,cAAsB,IAAI,KAAK;CAE/B,eAAe,MAAkB;EAC/B,MAAM,OAAO,YAAY,IAAI,IAAI,KAAK;EAEtC,IAAI,OAAO,KAAK;GACd,IAAI,KAAK,MAAM,KAAK,YAAY,KAAK,OAAO,GAC1C,KAAK,SAAS,KAAK,KAAK,IAAI,KAAK,YAAY,KAAK;GAGpD,IAAI,KAAK,MAAM,KAAK,YAAY,KAAK,OAAO,GAC1C,KAAK,SAAS,KAAK,KAAK,IAAI,KAAK,YAAY,KAAK;EAEtD;EAEA,KAAK,YAAY,YAAY,IAAI;EACjC,KAAK,cAAc;CACrB;CAEA,qBAA2B;EACzB,MAAM,cAAc,KAAK,YAAY,KAAK;EAE1C,MAAM,YAAY,KAAK,YAAY,SAAS;EAC5C,YAAY,UAAU;EAEtB,IAAI,KAAK,SAAS,IAAI,GACpB,YAAY,KAAK;EAGnB,MAAM,YAAY,KAAK,YAAY,QAAQ;EAC3C,YAAY,SAAS;EAErB,IAAI,KAAK,SAAS,IAAI,GACpB,YAAY,KAAK;EAGnB,OAAO;CACT;AACF"}