@workday/canvas-kit-react 9.0.0-alpha.416-next.18 → 9.0.0-alpha.418-next.20

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 (192) hide show
  1. package/collection/index.ts +1 -0
  2. package/collection/lib/useCursorListModel.tsx +17 -3
  3. package/collection/lib/useListItemAllowChildStrings.ts +3 -3
  4. package/collection/lib/useListItemRovingFocus.tsx +19 -7
  5. package/collection/lib/useListLoader.ts +313 -0
  6. package/dist/commonjs/action-bar/lib/ActionBar.d.ts +303 -0
  7. package/dist/commonjs/action-bar/lib/ActionBar.d.ts.map +1 -1
  8. package/dist/commonjs/action-bar/lib/ActionBarItem.d.ts +9 -0
  9. package/dist/commonjs/action-bar/lib/ActionBarItem.d.ts.map +1 -1
  10. package/dist/commonjs/action-bar/lib/ActionBarList.d.ts +9 -0
  11. package/dist/commonjs/action-bar/lib/ActionBarList.d.ts.map +1 -1
  12. package/dist/commonjs/action-bar/lib/ActionBarOverflowButton.d.ts +12 -0
  13. package/dist/commonjs/action-bar/lib/ActionBarOverflowButton.d.ts.map +1 -1
  14. package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts +153 -0
  15. package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts.map +1 -1
  16. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs.d.ts +312 -0
  17. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs.d.ts.map +1 -1
  18. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsCurrentItem.d.ts +12 -0
  19. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsCurrentItem.d.ts.map +1 -1
  20. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsItem.d.ts +9 -0
  21. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsItem.d.ts.map +1 -1
  22. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsList.d.ts +6 -0
  23. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsList.d.ts.map +1 -1
  24. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsMenu.d.ts +144 -0
  25. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsMenu.d.ts.map +1 -1
  26. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsOverflowButton.d.ts +12 -0
  27. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsOverflowButton.d.ts.map +1 -1
  28. package/dist/commonjs/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts +153 -0
  29. package/dist/commonjs/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts.map +1 -1
  30. package/dist/commonjs/collection/index.d.ts +1 -0
  31. package/dist/commonjs/collection/index.d.ts.map +1 -1
  32. package/dist/commonjs/collection/index.js +1 -0
  33. package/dist/commonjs/collection/lib/ListBox.d.ts +114 -0
  34. package/dist/commonjs/collection/lib/ListBox.d.ts.map +1 -1
  35. package/dist/commonjs/collection/lib/useCursorListModel.d.ts +310 -0
  36. package/dist/commonjs/collection/lib/useCursorListModel.d.ts.map +1 -1
  37. package/dist/commonjs/collection/lib/useCursorListModel.js +10 -0
  38. package/dist/commonjs/collection/lib/useGridModel.d.ts +111 -0
  39. package/dist/commonjs/collection/lib/useGridModel.d.ts.map +1 -1
  40. package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts +6 -3
  41. package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
  42. package/dist/commonjs/collection/lib/useListItemAllowChildStrings.js +3 -3
  43. package/dist/commonjs/collection/lib/useListItemRegister.d.ts +3 -0
  44. package/dist/commonjs/collection/lib/useListItemRegister.d.ts.map +1 -1
  45. package/dist/commonjs/collection/lib/useListItemRovingFocus.d.ts +3 -1
  46. package/dist/commonjs/collection/lib/useListItemRovingFocus.d.ts.map +1 -1
  47. package/dist/commonjs/collection/lib/useListItemRovingFocus.js +15 -8
  48. package/dist/commonjs/collection/lib/useListItemSelect.d.ts +3 -0
  49. package/dist/commonjs/collection/lib/useListItemSelect.d.ts.map +1 -1
  50. package/dist/commonjs/collection/lib/useListLoader.d.ts +67 -0
  51. package/dist/commonjs/collection/lib/useListLoader.d.ts.map +1 -0
  52. package/dist/commonjs/collection/lib/useListLoader.js +213 -0
  53. package/dist/commonjs/collection/lib/useListModel.d.ts +111 -0
  54. package/dist/commonjs/collection/lib/useListModel.d.ts.map +1 -1
  55. package/dist/commonjs/collection/lib/useListResetCursorOnBlur.d.ts +3 -0
  56. package/dist/commonjs/collection/lib/useListResetCursorOnBlur.d.ts.map +1 -1
  57. package/dist/commonjs/collection/lib/useOverflowListItemMeasure.d.ts +3 -0
  58. package/dist/commonjs/collection/lib/useOverflowListItemMeasure.d.ts.map +1 -1
  59. package/dist/commonjs/collection/lib/useOverflowListMeasure.d.ts +3 -0
  60. package/dist/commonjs/collection/lib/useOverflowListMeasure.d.ts.map +1 -1
  61. package/dist/commonjs/collection/lib/useOverflowListModel.d.ts +147 -0
  62. package/dist/commonjs/collection/lib/useOverflowListModel.d.ts.map +1 -1
  63. package/dist/commonjs/collection/lib/useOverflowListTarget.d.ts +3 -0
  64. package/dist/commonjs/collection/lib/useOverflowListTarget.d.ts.map +1 -1
  65. package/dist/commonjs/collection/lib/useSelectionListModel.d.ts +111 -0
  66. package/dist/commonjs/collection/lib/useSelectionListModel.d.ts.map +1 -1
  67. package/dist/commonjs/menu/lib/Menu.d.ts +141 -0
  68. package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
  69. package/dist/commonjs/menu/lib/MenuCard.d.ts +6 -0
  70. package/dist/commonjs/menu/lib/MenuCard.d.ts.map +1 -1
  71. package/dist/commonjs/menu/lib/MenuContextTarget.d.ts +9 -0
  72. package/dist/commonjs/menu/lib/MenuContextTarget.d.ts.map +1 -1
  73. package/dist/commonjs/menu/lib/MenuItem.d.ts +6 -1
  74. package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
  75. package/dist/commonjs/menu/lib/MenuList.d.ts +6 -0
  76. package/dist/commonjs/menu/lib/MenuList.d.ts.map +1 -1
  77. package/dist/commonjs/menu/lib/MenuPopper.d.ts +3 -0
  78. package/dist/commonjs/menu/lib/MenuPopper.d.ts.map +1 -1
  79. package/dist/commonjs/menu/lib/MenuTarget.d.ts +15 -0
  80. package/dist/commonjs/menu/lib/MenuTarget.d.ts.map +1 -1
  81. package/dist/commonjs/menu/lib/useMenuModel.d.ts +129 -0
  82. package/dist/commonjs/menu/lib/useMenuModel.d.ts.map +1 -1
  83. package/dist/commonjs/tabs/lib/Tabs.d.ts +450 -0
  84. package/dist/commonjs/tabs/lib/Tabs.d.ts.map +1 -1
  85. package/dist/commonjs/tabs/lib/TabsItem.d.ts +12 -1
  86. package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
  87. package/dist/commonjs/tabs/lib/TabsList.d.ts +12 -0
  88. package/dist/commonjs/tabs/lib/TabsList.d.ts.map +1 -1
  89. package/dist/commonjs/tabs/lib/TabsMenuPopper.d.ts +3 -0
  90. package/dist/commonjs/tabs/lib/TabsMenuPopper.d.ts.map +1 -1
  91. package/dist/commonjs/tabs/lib/TabsOverflowButton.d.ts +12 -0
  92. package/dist/commonjs/tabs/lib/TabsOverflowButton.d.ts.map +1 -1
  93. package/dist/commonjs/tabs/lib/TabsPanel.d.ts +12 -0
  94. package/dist/commonjs/tabs/lib/TabsPanel.d.ts.map +1 -1
  95. package/dist/commonjs/tabs/lib/TabsPanels.d.ts +6 -0
  96. package/dist/commonjs/tabs/lib/TabsPanels.d.ts.map +1 -1
  97. package/dist/commonjs/tabs/lib/useTabsModel.d.ts +405 -0
  98. package/dist/commonjs/tabs/lib/useTabsModel.d.ts.map +1 -1
  99. package/dist/es6/action-bar/lib/ActionBar.d.ts +303 -0
  100. package/dist/es6/action-bar/lib/ActionBar.d.ts.map +1 -1
  101. package/dist/es6/action-bar/lib/ActionBarItem.d.ts +9 -0
  102. package/dist/es6/action-bar/lib/ActionBarItem.d.ts.map +1 -1
  103. package/dist/es6/action-bar/lib/ActionBarList.d.ts +9 -0
  104. package/dist/es6/action-bar/lib/ActionBarList.d.ts.map +1 -1
  105. package/dist/es6/action-bar/lib/ActionBarOverflowButton.d.ts +12 -0
  106. package/dist/es6/action-bar/lib/ActionBarOverflowButton.d.ts.map +1 -1
  107. package/dist/es6/action-bar/lib/useActionBarModel.d.ts +153 -0
  108. package/dist/es6/action-bar/lib/useActionBarModel.d.ts.map +1 -1
  109. package/dist/es6/breadcrumbs/lib/Breadcrumbs.d.ts +312 -0
  110. package/dist/es6/breadcrumbs/lib/Breadcrumbs.d.ts.map +1 -1
  111. package/dist/es6/breadcrumbs/lib/BreadcrumbsCurrentItem.d.ts +12 -0
  112. package/dist/es6/breadcrumbs/lib/BreadcrumbsCurrentItem.d.ts.map +1 -1
  113. package/dist/es6/breadcrumbs/lib/BreadcrumbsItem.d.ts +9 -0
  114. package/dist/es6/breadcrumbs/lib/BreadcrumbsItem.d.ts.map +1 -1
  115. package/dist/es6/breadcrumbs/lib/BreadcrumbsList.d.ts +6 -0
  116. package/dist/es6/breadcrumbs/lib/BreadcrumbsList.d.ts.map +1 -1
  117. package/dist/es6/breadcrumbs/lib/BreadcrumbsMenu.d.ts +144 -0
  118. package/dist/es6/breadcrumbs/lib/BreadcrumbsMenu.d.ts.map +1 -1
  119. package/dist/es6/breadcrumbs/lib/BreadcrumbsOverflowButton.d.ts +12 -0
  120. package/dist/es6/breadcrumbs/lib/BreadcrumbsOverflowButton.d.ts.map +1 -1
  121. package/dist/es6/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts +153 -0
  122. package/dist/es6/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts.map +1 -1
  123. package/dist/es6/collection/index.d.ts +1 -0
  124. package/dist/es6/collection/index.d.ts.map +1 -1
  125. package/dist/es6/collection/index.js +1 -0
  126. package/dist/es6/collection/lib/ListBox.d.ts +114 -0
  127. package/dist/es6/collection/lib/ListBox.d.ts.map +1 -1
  128. package/dist/es6/collection/lib/useCursorListModel.d.ts +310 -0
  129. package/dist/es6/collection/lib/useCursorListModel.d.ts.map +1 -1
  130. package/dist/es6/collection/lib/useCursorListModel.js +10 -0
  131. package/dist/es6/collection/lib/useGridModel.d.ts +111 -0
  132. package/dist/es6/collection/lib/useGridModel.d.ts.map +1 -1
  133. package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts +6 -3
  134. package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
  135. package/dist/es6/collection/lib/useListItemAllowChildStrings.js +3 -3
  136. package/dist/es6/collection/lib/useListItemRegister.d.ts +3 -0
  137. package/dist/es6/collection/lib/useListItemRegister.d.ts.map +1 -1
  138. package/dist/es6/collection/lib/useListItemRovingFocus.d.ts +3 -1
  139. package/dist/es6/collection/lib/useListItemRovingFocus.d.ts.map +1 -1
  140. package/dist/es6/collection/lib/useListItemRovingFocus.js +15 -8
  141. package/dist/es6/collection/lib/useListItemSelect.d.ts +3 -0
  142. package/dist/es6/collection/lib/useListItemSelect.d.ts.map +1 -1
  143. package/dist/es6/collection/lib/useListLoader.d.ts +67 -0
  144. package/dist/es6/collection/lib/useListLoader.d.ts.map +1 -0
  145. package/dist/es6/collection/lib/useListLoader.js +204 -0
  146. package/dist/es6/collection/lib/useListModel.d.ts +111 -0
  147. package/dist/es6/collection/lib/useListModel.d.ts.map +1 -1
  148. package/dist/es6/collection/lib/useListResetCursorOnBlur.d.ts +3 -0
  149. package/dist/es6/collection/lib/useListResetCursorOnBlur.d.ts.map +1 -1
  150. package/dist/es6/collection/lib/useOverflowListItemMeasure.d.ts +3 -0
  151. package/dist/es6/collection/lib/useOverflowListItemMeasure.d.ts.map +1 -1
  152. package/dist/es6/collection/lib/useOverflowListMeasure.d.ts +3 -0
  153. package/dist/es6/collection/lib/useOverflowListMeasure.d.ts.map +1 -1
  154. package/dist/es6/collection/lib/useOverflowListModel.d.ts +147 -0
  155. package/dist/es6/collection/lib/useOverflowListModel.d.ts.map +1 -1
  156. package/dist/es6/collection/lib/useOverflowListTarget.d.ts +3 -0
  157. package/dist/es6/collection/lib/useOverflowListTarget.d.ts.map +1 -1
  158. package/dist/es6/collection/lib/useSelectionListModel.d.ts +111 -0
  159. package/dist/es6/collection/lib/useSelectionListModel.d.ts.map +1 -1
  160. package/dist/es6/menu/lib/Menu.d.ts +141 -0
  161. package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
  162. package/dist/es6/menu/lib/MenuCard.d.ts +6 -0
  163. package/dist/es6/menu/lib/MenuCard.d.ts.map +1 -1
  164. package/dist/es6/menu/lib/MenuContextTarget.d.ts +9 -0
  165. package/dist/es6/menu/lib/MenuContextTarget.d.ts.map +1 -1
  166. package/dist/es6/menu/lib/MenuItem.d.ts +6 -1
  167. package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
  168. package/dist/es6/menu/lib/MenuList.d.ts +6 -0
  169. package/dist/es6/menu/lib/MenuList.d.ts.map +1 -1
  170. package/dist/es6/menu/lib/MenuPopper.d.ts +3 -0
  171. package/dist/es6/menu/lib/MenuPopper.d.ts.map +1 -1
  172. package/dist/es6/menu/lib/MenuTarget.d.ts +15 -0
  173. package/dist/es6/menu/lib/MenuTarget.d.ts.map +1 -1
  174. package/dist/es6/menu/lib/useMenuModel.d.ts +129 -0
  175. package/dist/es6/menu/lib/useMenuModel.d.ts.map +1 -1
  176. package/dist/es6/tabs/lib/Tabs.d.ts +450 -0
  177. package/dist/es6/tabs/lib/Tabs.d.ts.map +1 -1
  178. package/dist/es6/tabs/lib/TabsItem.d.ts +12 -1
  179. package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
  180. package/dist/es6/tabs/lib/TabsList.d.ts +12 -0
  181. package/dist/es6/tabs/lib/TabsList.d.ts.map +1 -1
  182. package/dist/es6/tabs/lib/TabsMenuPopper.d.ts +3 -0
  183. package/dist/es6/tabs/lib/TabsMenuPopper.d.ts.map +1 -1
  184. package/dist/es6/tabs/lib/TabsOverflowButton.d.ts +12 -0
  185. package/dist/es6/tabs/lib/TabsOverflowButton.d.ts.map +1 -1
  186. package/dist/es6/tabs/lib/TabsPanel.d.ts +12 -0
  187. package/dist/es6/tabs/lib/TabsPanel.d.ts.map +1 -1
  188. package/dist/es6/tabs/lib/TabsPanels.d.ts +6 -0
  189. package/dist/es6/tabs/lib/TabsPanels.d.ts.map +1 -1
  190. package/dist/es6/tabs/lib/useTabsModel.d.ts +405 -0
  191. package/dist/es6/tabs/lib/useTabsModel.d.ts.map +1 -1
  192. package/package.json +3 -3
@@ -40,6 +40,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
40
40
  cursorId: string;
41
41
  columnCount: number;
42
42
  pageSizeRef: import("react").MutableRefObject<number>;
43
+ cursorIndexRef: {
44
+ readonly current: number;
45
+ };
43
46
  UNSTABLE_virtual: {
44
47
  virtualItems: import("./react-virtual").VirtualItem[];
45
48
  totalSize: number;
@@ -62,6 +65,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
62
65
  cursorId: string;
63
66
  columnCount: number;
64
67
  pageSizeRef: import("react").MutableRefObject<number>;
68
+ cursorIndexRef: {
69
+ readonly current: number;
70
+ };
65
71
  UNSTABLE_virtual: {
66
72
  virtualItems: import("./react-virtual").VirtualItem[];
67
73
  totalSize: number;
@@ -84,6 +90,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
84
90
  cursorId: string;
85
91
  columnCount: number;
86
92
  pageSizeRef: import("react").MutableRefObject<number>;
93
+ cursorIndexRef: {
94
+ readonly current: number;
95
+ };
87
96
  UNSTABLE_virtual: {
88
97
  virtualItems: import("./react-virtual").VirtualItem[];
89
98
  totalSize: number;
@@ -108,6 +117,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
108
117
  cursorId: string;
109
118
  columnCount: number;
110
119
  pageSizeRef: import("react").MutableRefObject<number>;
120
+ cursorIndexRef: {
121
+ readonly current: number;
122
+ };
111
123
  UNSTABLE_virtual: {
112
124
  virtualItems: import("./react-virtual").VirtualItem[];
113
125
  totalSize: number;
@@ -130,6 +142,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
130
142
  cursorId: string;
131
143
  columnCount: number;
132
144
  pageSizeRef: import("react").MutableRefObject<number>;
145
+ cursorIndexRef: {
146
+ readonly current: number;
147
+ };
133
148
  UNSTABLE_virtual: {
134
149
  virtualItems: import("./react-virtual").VirtualItem[];
135
150
  totalSize: number;
@@ -152,6 +167,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
152
167
  cursorId: string;
153
168
  columnCount: number;
154
169
  pageSizeRef: import("react").MutableRefObject<number>;
170
+ cursorIndexRef: {
171
+ readonly current: number;
172
+ };
155
173
  UNSTABLE_virtual: {
156
174
  virtualItems: import("./react-virtual").VirtualItem[];
157
175
  totalSize: number;
@@ -174,6 +192,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
174
192
  cursorId: string;
175
193
  columnCount: number;
176
194
  pageSizeRef: import("react").MutableRefObject<number>;
195
+ cursorIndexRef: {
196
+ readonly current: number;
197
+ };
177
198
  UNSTABLE_virtual: {
178
199
  virtualItems: import("./react-virtual").VirtualItem[];
179
200
  totalSize: number;
@@ -196,6 +217,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
196
217
  cursorId: string;
197
218
  columnCount: number;
198
219
  pageSizeRef: import("react").MutableRefObject<number>;
220
+ cursorIndexRef: {
221
+ readonly current: number;
222
+ };
199
223
  UNSTABLE_virtual: {
200
224
  virtualItems: import("./react-virtual").VirtualItem[];
201
225
  totalSize: number;
@@ -218,6 +242,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
218
242
  cursorId: string;
219
243
  columnCount: number;
220
244
  pageSizeRef: import("react").MutableRefObject<number>;
245
+ cursorIndexRef: {
246
+ readonly current: number;
247
+ };
221
248
  UNSTABLE_virtual: {
222
249
  virtualItems: import("./react-virtual").VirtualItem[];
223
250
  totalSize: number;
@@ -240,6 +267,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
240
267
  cursorId: string;
241
268
  columnCount: number;
242
269
  pageSizeRef: import("react").MutableRefObject<number>;
270
+ cursorIndexRef: {
271
+ readonly current: number;
272
+ };
243
273
  UNSTABLE_virtual: {
244
274
  virtualItems: import("./react-virtual").VirtualItem[];
245
275
  totalSize: number;
@@ -262,6 +292,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
262
292
  cursorId: string;
263
293
  columnCount: number;
264
294
  pageSizeRef: import("react").MutableRefObject<number>;
295
+ cursorIndexRef: {
296
+ readonly current: number;
297
+ };
265
298
  UNSTABLE_virtual: {
266
299
  virtualItems: import("./react-virtual").VirtualItem[];
267
300
  totalSize: number;
@@ -284,6 +317,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
284
317
  cursorId: string;
285
318
  columnCount: number;
286
319
  pageSizeRef: import("react").MutableRefObject<number>;
320
+ cursorIndexRef: {
321
+ readonly current: number;
322
+ };
287
323
  UNSTABLE_virtual: {
288
324
  virtualItems: import("./react-virtual").VirtualItem[];
289
325
  totalSize: number;
@@ -306,6 +342,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
306
342
  cursorId: string;
307
343
  columnCount: number;
308
344
  pageSizeRef: import("react").MutableRefObject<number>;
345
+ cursorIndexRef: {
346
+ readonly current: number;
347
+ };
309
348
  UNSTABLE_virtual: {
310
349
  virtualItems: import("./react-virtual").VirtualItem[];
311
350
  totalSize: number;
@@ -328,6 +367,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
328
367
  cursorId: string;
329
368
  columnCount: number;
330
369
  pageSizeRef: import("react").MutableRefObject<number>;
370
+ cursorIndexRef: {
371
+ readonly current: number;
372
+ };
331
373
  UNSTABLE_virtual: {
332
374
  virtualItems: import("./react-virtual").VirtualItem[];
333
375
  totalSize: number;
@@ -353,6 +395,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
353
395
  cursorId: string;
354
396
  columnCount: number;
355
397
  pageSizeRef: import("react").MutableRefObject<number>;
398
+ cursorIndexRef: {
399
+ readonly current: number;
400
+ };
356
401
  UNSTABLE_virtual: {
357
402
  virtualItems: import("./react-virtual").VirtualItem[];
358
403
  totalSize: number;
@@ -377,6 +422,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
377
422
  cursorId: string;
378
423
  columnCount: number;
379
424
  pageSizeRef: import("react").MutableRefObject<number>;
425
+ cursorIndexRef: {
426
+ readonly current: number;
427
+ };
380
428
  UNSTABLE_virtual: {
381
429
  virtualItems: import("./react-virtual").VirtualItem[];
382
430
  totalSize: number;
@@ -401,6 +449,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
401
449
  cursorId: string;
402
450
  columnCount: number;
403
451
  pageSizeRef: import("react").MutableRefObject<number>;
452
+ cursorIndexRef: {
453
+ readonly current: number;
454
+ };
404
455
  UNSTABLE_virtual: {
405
456
  virtualItems: import("./react-virtual").VirtualItem[];
406
457
  totalSize: number;
@@ -426,6 +477,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
426
477
  cursorId: string;
427
478
  columnCount: number;
428
479
  pageSizeRef: import("react").MutableRefObject<number>;
480
+ cursorIndexRef: {
481
+ readonly current: number;
482
+ };
429
483
  UNSTABLE_virtual: {
430
484
  virtualItems: import("./react-virtual").VirtualItem[];
431
485
  totalSize: number;
@@ -448,6 +502,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
448
502
  cursorId: string;
449
503
  columnCount: number;
450
504
  pageSizeRef: import("react").MutableRefObject<number>;
505
+ cursorIndexRef: {
506
+ readonly current: number;
507
+ };
451
508
  UNSTABLE_virtual: {
452
509
  virtualItems: import("./react-virtual").VirtualItem[];
453
510
  totalSize: number;
@@ -470,6 +527,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
470
527
  cursorId: string;
471
528
  columnCount: number;
472
529
  pageSizeRef: import("react").MutableRefObject<number>;
530
+ cursorIndexRef: {
531
+ readonly current: number;
532
+ };
473
533
  UNSTABLE_virtual: {
474
534
  virtualItems: import("./react-virtual").VirtualItem[];
475
535
  totalSize: number;
@@ -494,6 +554,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
494
554
  cursorId: string;
495
555
  columnCount: number;
496
556
  pageSizeRef: import("react").MutableRefObject<number>;
557
+ cursorIndexRef: {
558
+ readonly current: number;
559
+ };
497
560
  UNSTABLE_virtual: {
498
561
  virtualItems: import("./react-virtual").VirtualItem[];
499
562
  totalSize: number;
@@ -516,6 +579,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
516
579
  cursorId: string;
517
580
  columnCount: number;
518
581
  pageSizeRef: import("react").MutableRefObject<number>;
582
+ cursorIndexRef: {
583
+ readonly current: number;
584
+ };
519
585
  UNSTABLE_virtual: {
520
586
  virtualItems: import("./react-virtual").VirtualItem[];
521
587
  totalSize: number;
@@ -538,6 +604,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
538
604
  cursorId: string;
539
605
  columnCount: number;
540
606
  pageSizeRef: import("react").MutableRefObject<number>;
607
+ cursorIndexRef: {
608
+ readonly current: number;
609
+ };
541
610
  UNSTABLE_virtual: {
542
611
  virtualItems: import("./react-virtual").VirtualItem[];
543
612
  totalSize: number;
@@ -560,6 +629,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
560
629
  cursorId: string;
561
630
  columnCount: number;
562
631
  pageSizeRef: import("react").MutableRefObject<number>;
632
+ cursorIndexRef: {
633
+ readonly current: number;
634
+ };
563
635
  UNSTABLE_virtual: {
564
636
  virtualItems: import("./react-virtual").VirtualItem[];
565
637
  totalSize: number;
@@ -582,6 +654,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
582
654
  cursorId: string;
583
655
  columnCount: number;
584
656
  pageSizeRef: import("react").MutableRefObject<number>;
657
+ cursorIndexRef: {
658
+ readonly current: number;
659
+ };
585
660
  UNSTABLE_virtual: {
586
661
  virtualItems: import("./react-virtual").VirtualItem[];
587
662
  totalSize: number;
@@ -604,6 +679,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
604
679
  cursorId: string;
605
680
  columnCount: number;
606
681
  pageSizeRef: import("react").MutableRefObject<number>;
682
+ cursorIndexRef: {
683
+ readonly current: number;
684
+ };
607
685
  UNSTABLE_virtual: {
608
686
  virtualItems: import("./react-virtual").VirtualItem[];
609
687
  totalSize: number;
@@ -626,6 +704,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
626
704
  cursorId: string;
627
705
  columnCount: number;
628
706
  pageSizeRef: import("react").MutableRefObject<number>;
707
+ cursorIndexRef: {
708
+ readonly current: number;
709
+ };
629
710
  UNSTABLE_virtual: {
630
711
  virtualItems: import("./react-virtual").VirtualItem[];
631
712
  totalSize: number;
@@ -648,6 +729,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
648
729
  cursorId: string;
649
730
  columnCount: number;
650
731
  pageSizeRef: import("react").MutableRefObject<number>;
732
+ cursorIndexRef: {
733
+ readonly current: number;
734
+ };
651
735
  UNSTABLE_virtual: {
652
736
  virtualItems: import("./react-virtual").VirtualItem[];
653
737
  totalSize: number;
@@ -670,6 +754,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
670
754
  cursorId: string;
671
755
  columnCount: number;
672
756
  pageSizeRef: import("react").MutableRefObject<number>;
757
+ cursorIndexRef: {
758
+ readonly current: number;
759
+ };
673
760
  UNSTABLE_virtual: {
674
761
  virtualItems: import("./react-virtual").VirtualItem[];
675
762
  totalSize: number;
@@ -692,6 +779,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
692
779
  cursorId: string;
693
780
  columnCount: number;
694
781
  pageSizeRef: import("react").MutableRefObject<number>;
782
+ cursorIndexRef: {
783
+ readonly current: number;
784
+ };
695
785
  UNSTABLE_virtual: {
696
786
  virtualItems: import("./react-virtual").VirtualItem[];
697
787
  totalSize: number;
@@ -714,6 +804,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
714
804
  cursorId: string;
715
805
  columnCount: number;
716
806
  pageSizeRef: import("react").MutableRefObject<number>;
807
+ cursorIndexRef: {
808
+ readonly current: number;
809
+ };
717
810
  UNSTABLE_virtual: {
718
811
  virtualItems: import("./react-virtual").VirtualItem[];
719
812
  totalSize: number;
@@ -739,6 +832,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
739
832
  cursorId: string;
740
833
  columnCount: number;
741
834
  pageSizeRef: import("react").MutableRefObject<number>;
835
+ cursorIndexRef: {
836
+ readonly current: number;
837
+ };
742
838
  UNSTABLE_virtual: {
743
839
  virtualItems: import("./react-virtual").VirtualItem[];
744
840
  totalSize: number;
@@ -763,6 +859,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
763
859
  cursorId: string;
764
860
  columnCount: number;
765
861
  pageSizeRef: import("react").MutableRefObject<number>;
862
+ cursorIndexRef: {
863
+ readonly current: number;
864
+ };
766
865
  UNSTABLE_virtual: {
767
866
  virtualItems: import("./react-virtual").VirtualItem[];
768
867
  totalSize: number;
@@ -787,6 +886,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
787
886
  cursorId: string;
788
887
  columnCount: number;
789
888
  pageSizeRef: import("react").MutableRefObject<number>;
889
+ cursorIndexRef: {
890
+ readonly current: number;
891
+ };
790
892
  UNSTABLE_virtual: {
791
893
  virtualItems: import("./react-virtual").VirtualItem[];
792
894
  totalSize: number;
@@ -810,6 +912,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
810
912
  cursorId: string;
811
913
  columnCount: number;
812
914
  pageSizeRef: import("react").MutableRefObject<number>;
915
+ cursorIndexRef: {
916
+ readonly current: number;
917
+ };
813
918
  UNSTABLE_virtual: {
814
919
  virtualItems: import("./react-virtual").VirtualItem[];
815
920
  totalSize: number;
@@ -894,6 +999,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
894
999
  cursorId: string;
895
1000
  columnCount: number;
896
1001
  pageSizeRef: import("react").MutableRefObject<number>;
1002
+ cursorIndexRef: {
1003
+ readonly current: number;
1004
+ };
897
1005
  UNSTABLE_virtual: {
898
1006
  virtualItems: import("./react-virtual").VirtualItem[];
899
1007
  totalSize: number;
@@ -945,6 +1053,9 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
945
1053
  cursorId: string;
946
1054
  columnCount: number;
947
1055
  pageSizeRef: import("react").MutableRefObject<number>;
1056
+ cursorIndexRef: {
1057
+ readonly current: number;
1058
+ };
948
1059
  UNSTABLE_virtual: {
949
1060
  virtualItems: import("./react-virtual").VirtualItem[];
950
1061
  totalSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useGridModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useGridModel.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,eAAO,MAAM,YAAY;IAGrB;;;;;;;;;OASG;;;;;;;;;;;;;;;IAIH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAfH;;;;;;;;;OASG;;;;;;;;;;;;;;;IAIH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASL,CAAC"}
1
+ {"version":3,"file":"useGridModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useGridModel.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,eAAO,MAAM,YAAY;IAGrB;;;;;;;;;OASG;;;;;;;;;;;;;;;IAIH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAfH;;;;;;;;;OASG;;;;;;;;;;;;;;;IAIH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASL,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * This elemProps hook allows for children values to be considered identifiers if the children
3
- * are strings. This can be useful for autocomplete or select components that allow string values.
4
- * This hook must be defined _before_ {@link useListItemRegister} because it sets the `data-id`
2
+ * This elemProps hook allows for children values to be considered identifiers if the children are
3
+ * strings. This can be useful for autocomplete or select components that allow string values. This
4
+ * hook must be passed _after_ {@link useListItemRegister} because this hook sets the `data-id`
5
5
  * attribute if one hasn't been defined by the application.
6
6
  *
7
7
  * An example might look like:
@@ -29,6 +29,9 @@ export declare const useListItemAllowChildStrings: import("@workday/canvas-kit-r
29
29
  cursorId: string;
30
30
  columnCount: number;
31
31
  pageSizeRef: import("react").MutableRefObject<number>;
32
+ cursorIndexRef: {
33
+ readonly current: number;
34
+ };
32
35
  UNSTABLE_virtual: {
33
36
  virtualItems: import("./react-virtual").VirtualItem[];
34
37
  totalSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxC,CAAC"}
1
+ {"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxC,CAAC"}
@@ -4,9 +4,9 @@ exports.useListItemAllowChildStrings = void 0;
4
4
  const common_1 = require("@workday/canvas-kit-react/common");
5
5
  const collection_1 = require("@workday/canvas-kit-react/collection");
6
6
  /**
7
- * This elemProps hook allows for children values to be considered identifiers if the children
8
- * are strings. This can be useful for autocomplete or select components that allow string values.
9
- * This hook must be defined _before_ {@link useListItemRegister} because it sets the `data-id`
7
+ * This elemProps hook allows for children values to be considered identifiers if the children are
8
+ * strings. This can be useful for autocomplete or select components that allow string values. This
9
+ * hook must be passed _after_ {@link useListItemRegister} because this hook sets the `data-id`
10
10
  * attribute if one hasn't been defined by the application.
11
11
  *
12
12
  * An example might look like:
@@ -21,6 +21,9 @@ export declare const useListItemRegister: import("@workday/canvas-kit-react/comm
21
21
  cursorId: string;
22
22
  columnCount: number;
23
23
  pageSizeRef: React.MutableRefObject<number>;
24
+ cursorIndexRef: {
25
+ readonly current: number;
26
+ };
24
27
  UNSTABLE_virtual: {
25
28
  virtualItems: VirtualItem[];
26
29
  totalSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useListItemRegister.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRegister.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoE/B,CAAC"}
1
+ {"version":3,"file":"useListItemRegister.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRegister.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoE/B,CAAC"}
@@ -18,6 +18,9 @@ export declare const useListItemRovingFocus: import("@workday/canvas-kit-react/c
18
18
  cursorId: string;
19
19
  columnCount: number;
20
20
  pageSizeRef: React.MutableRefObject<number>;
21
+ cursorIndexRef: {
22
+ readonly current: number;
23
+ };
21
24
  UNSTABLE_virtual: {
22
25
  virtualItems: import("./react-virtual").VirtualItem[];
23
26
  totalSize: number;
@@ -66,6 +69,5 @@ export declare const useListItemRovingFocus: import("@workday/canvas-kit-react/c
66
69
  onClick(): void;
67
70
  'data-focus-id': string;
68
71
  tabIndex: number;
69
- ref: React.Ref<any> | undefined;
70
72
  }>;
71
73
  //# sourceMappingURL=useListItemRovingFocus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useListItemRovingFocus.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRovingFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqCZ,mBAAmB;;;;;EAmBzC,CAAC"}
1
+ {"version":3,"file":"useListItemRovingFocus.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRovingFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA2CZ,mBAAmB;;;;EAkBzC,CAAC"}
@@ -8,6 +8,12 @@ const react_1 = __importDefault(require("react"));
8
8
  const common_1 = require("@workday/canvas-kit-react/common");
9
9
  const useCursorListModel_1 = require("./useCursorListModel");
10
10
  const keyUtils_1 = require("./keyUtils");
11
+ // retry a function each frame so we don't rely on the timing mechanism of React's render cycle.
12
+ const retryEachFrame = (cb, iterations) => {
13
+ if (cb() === false && iterations > 1) {
14
+ requestAnimationFrame(() => retryEachFrame(cb, iterations - 1));
15
+ }
16
+ };
11
17
  /**
12
18
  * This elemProps hook is used for cursor navigation by using [Roving
13
19
  * Tabindex](https://w3c.github.io/aria-practices/#kbd_roving_tabindex). Only a single item in the
@@ -22,7 +28,7 @@ const keyUtils_1 = require("./keyUtils");
22
28
  * );
23
29
  ```
24
30
  */
25
- exports.useListItemRovingFocus = common_1.createElemPropsHook(useCursorListModel_1.useCursorListModel)((model, ref, elemProps = {}) => {
31
+ exports.useListItemRovingFocus = common_1.createElemPropsHook(useCursorListModel_1.useCursorListModel)((model, _ref, elemProps = {}) => {
26
32
  // Create a ref out of state. We don't want to watch state on unmount, so we use a ref to get the
27
33
  // current value at the time of unmounting. Otherwise, `state.items` would be a cached value of an
28
34
  // empty array
@@ -36,11 +42,13 @@ exports.useListItemRovingFocus = common_1.createElemPropsHook(useCursorListModel
36
42
  if (model.state.isVirtualized) {
37
43
  model.state.UNSTABLE_virtual.scrollToIndex(item.index);
38
44
  }
39
- requestAnimationFrame(() => {
40
- var _a;
41
- (_a = document
42
- .querySelector(`[data-focus-id="${`${model.state.id}-${item.id}`}"]`)) === null || _a === void 0 ? void 0 : _a.focus();
43
- });
45
+ // In React concurrent mode, there could be several render attempts before the element we're
46
+ // looking for could be available in the DOM
47
+ retryEachFrame(() => {
48
+ const element = document.querySelector(`[data-focus-id="${`${model.state.id}-${item.id}`}"]`);
49
+ element === null || element === void 0 ? void 0 : element.focus();
50
+ return !!element;
51
+ }, 5); // 5 should be enough, right?!
44
52
  keyDownRef.current = false;
45
53
  }
46
54
  // we only want to run this effect if the cursor changes and not any other time
@@ -68,7 +76,6 @@ exports.useListItemRovingFocus = common_1.createElemPropsHook(useCursorListModel
68
76
  ? 0 // cursor isn't known yet, be safe and mark this as focusable
69
77
  : !!elemProps['data-id'] && model.state.cursorId === elemProps['data-id']
70
78
  ? 0 // A name is known and cursor is here
71
- : -1,
72
- ref,
79
+ : -1, // A name is known an cursor is somewhere else
73
80
  };
74
81
  });
@@ -18,6 +18,9 @@ export declare const useListItemSelect: import("@workday/canvas-kit-react/common
18
18
  cursorId: string;
19
19
  columnCount: number;
20
20
  pageSizeRef: React.MutableRefObject<number>;
21
+ cursorIndexRef: {
22
+ readonly current: number;
23
+ };
21
24
  UNSTABLE_virtual: {
22
25
  virtualItems: import("./react-virtual").VirtualItem[];
23
26
  totalSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useListItemSelect.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAGF,gBAAgB,CAAC,WAAW,CAAC;EAWxD,CAAC"}
1
+ {"version":3,"file":"useListItemSelect.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAGF,gBAAgB,CAAC,WAAW,CAAC;EAWxD,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { useListModel } from './useListModel';
2
+ export interface LoadReturn<T> {
3
+ items: T[];
4
+ total?: number;
5
+ }
6
+ export interface LoadParams {
7
+ pageNumber: number;
8
+ pageSize: number;
9
+ filter: CollectionLoader['filter'];
10
+ sorter: CollectionLoader['sorter'];
11
+ }
12
+ export interface AsyncCollectionConfig<T> {
13
+ pageSize: number;
14
+ total: number;
15
+ load(params: LoadParams): LoadReturn<T> | Promise<LoadReturn<T>>;
16
+ }
17
+ export interface CollectionLoader {
18
+ filter: string | Record<string, string>;
19
+ updateFilter(value: string): void;
20
+ sorter: string | Record<string, string>;
21
+ updateSorter(value: string): void;
22
+ isLoading: boolean;
23
+ }
24
+ export declare function getPageNumber(index: number, pageSize: number): number;
25
+ /**
26
+ *
27
+ * @param start The start index of the virtual window
28
+ * @param end The end index of the virtual window
29
+ * @param pageSize Expected load page size
30
+ * @param items Sparse array of all loaded items
31
+ * @param overScan How many items ahead we want to look ahead to trigger loading. Unloaded items
32
+ * that are this many items outside the current start and end numbers will trigger a loading of
33
+ * a page
34
+ */
35
+ export declare function getPagesToLoad<T>(start: number, end: number, pageSize: number, items: T[], overScan?: number): number[];
36
+ /**
37
+ * Create a data loader and a model. The model should be passed to a collection component. The
38
+ * loader can be used to manipulate filters, sorters, and clear cache.
39
+ *
40
+ * A simple loader using [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
41
+ * could look like the following:
42
+ *
43
+ * ```ts
44
+ * const {model, loader} = useListLoader(
45
+ * {
46
+ * total: 1000,
47
+ * pageSize: 20,
48
+ * async load({pageNumber, pageSize}) {
49
+ * return fetch('/myUrl')
50
+ * .then(response => response.json())
51
+ * .then(response => {
52
+ * return {total: response.total, items: response.items};
53
+ * });
54
+ * },
55
+ * },
56
+ * useListModel
57
+ * );
58
+ * ```
59
+ *
60
+ * @param config Config that contains the loader config and the model config
61
+ * @param modelHook A model hook that describes which model should be returned.
62
+ */
63
+ export declare function useListLoader<T, M extends ((...args: any[]) => any) & Omit<typeof useListModel, 'TConfig' | 'Context'>>(config: AsyncCollectionConfig<T> & typeof useListModel.TConfig, modelHook: M): {
64
+ model: ReturnType<M>;
65
+ loader: CollectionLoader;
66
+ };
67
+ //# sourceMappingURL=useListLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useListLoader.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;CACpC;AACD,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;CAClE;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;CACpB;AA8CD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAM5D;AAMD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,CAAC,EAAE,EACV,QAAQ,SAAI,GACX,MAAM,EAAE,CAkBV;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAC3B,CAAC,EAED,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,YAAY,EAAE,SAAS,GAAG,SAAS,CAAC,EAEtF,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,OAAO,YAAY,CAAC,OAAO,EAC9D,SAAS,EAAE,CAAC,GACX;IAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAC,CA2JlD"}