@workday/canvas-kit-react 9.0.0-alpha.411-next.13 → 9.0.0-alpha.413-next.15
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.
- package/collection/lib/useBaseListModel.tsx +24 -12
- package/collection/lib/useCursorListModel.tsx +102 -78
- package/dialog/lib/Dialog.tsx +66 -0
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts +104 -0
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/ActionBarItem.d.ts +3 -0
- package/dist/commonjs/action-bar/lib/ActionBarItem.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/ActionBarList.d.ts +3 -0
- package/dist/commonjs/action-bar/lib/ActionBarList.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/ActionBarOverflowButton.d.ts +4 -0
- package/dist/commonjs/action-bar/lib/ActionBarOverflowButton.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts +55 -0
- package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs.d.ts +107 -0
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsCurrentItem.d.ts +4 -0
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsCurrentItem.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsItem.d.ts +3 -0
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsItem.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsList.d.ts +2 -0
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsList.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsMenu.d.ts +49 -0
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsMenu.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsOverflowButton.d.ts +4 -0
- package/dist/commonjs/breadcrumbs/lib/BreadcrumbsOverflowButton.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts +55 -0
- package/dist/commonjs/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/ListBox.d.ts +39 -0
- package/dist/commonjs/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useBaseListModel.d.ts +20 -10
- package/dist/commonjs/collection/lib/useBaseListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useBaseListModel.js +21 -10
- package/dist/commonjs/collection/lib/useCursorListModel.d.ts +171 -10
- package/dist/commonjs/collection/lib/useCursorListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useCursorListModel.js +97 -64
- package/dist/commonjs/collection/lib/useGridModel.d.ts +39 -0
- package/dist/commonjs/collection/lib/useGridModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemRegister.d.ts +1 -0
- package/dist/commonjs/collection/lib/useListItemRegister.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemRovingFocus.d.ts +1 -0
- package/dist/commonjs/collection/lib/useListItemRovingFocus.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemSelect.d.ts +1 -0
- package/dist/commonjs/collection/lib/useListItemSelect.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListModel.d.ts +39 -0
- package/dist/commonjs/collection/lib/useListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListResetCursorOnBlur.d.ts +1 -0
- package/dist/commonjs/collection/lib/useListResetCursorOnBlur.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useOverflowListItemMeasure.d.ts +1 -0
- package/dist/commonjs/collection/lib/useOverflowListItemMeasure.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useOverflowListMeasure.d.ts +1 -0
- package/dist/commonjs/collection/lib/useOverflowListMeasure.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useOverflowListModel.d.ts +51 -0
- package/dist/commonjs/collection/lib/useOverflowListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useOverflowListTarget.d.ts +1 -0
- package/dist/commonjs/collection/lib/useOverflowListTarget.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useSelectionListModel.d.ts +39 -0
- package/dist/commonjs/collection/lib/useSelectionListModel.d.ts.map +1 -1
- package/dist/commonjs/dialog/lib/Dialog.d.ts +65 -0
- package/dist/commonjs/dialog/lib/Dialog.d.ts.map +1 -1
- package/dist/commonjs/dialog/lib/Dialog.js +65 -0
- package/dist/commonjs/menu/lib/Menu.d.ts +48 -0
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuCard.d.ts +2 -0
- package/dist/commonjs/menu/lib/MenuCard.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuContextTarget.d.ts +3 -0
- package/dist/commonjs/menu/lib/MenuContextTarget.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.d.ts +2 -0
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuList.d.ts +2 -0
- package/dist/commonjs/menu/lib/MenuList.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuPopper.d.ts +1 -0
- package/dist/commonjs/menu/lib/MenuPopper.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuTarget.d.ts +5 -0
- package/dist/commonjs/menu/lib/MenuTarget.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/useMenuModel.d.ts +45 -0
- package/dist/commonjs/menu/lib/useMenuModel.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/Popup.d.ts +1 -81
- package/dist/commonjs/popup/lib/Popup.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/Popup.js +1 -1
- package/dist/commonjs/tabs/lib/Tabs.d.ts +158 -7
- package/dist/commonjs/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +4 -0
- package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsList.d.ts +4 -0
- package/dist/commonjs/tabs/lib/TabsList.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsMenuPopper.d.ts +1 -0
- package/dist/commonjs/tabs/lib/TabsMenuPopper.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsOverflowButton.d.ts +4 -0
- package/dist/commonjs/tabs/lib/TabsOverflowButton.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsPanel.d.ts +4 -0
- package/dist/commonjs/tabs/lib/TabsPanel.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/TabsPanels.d.ts +2 -0
- package/dist/commonjs/tabs/lib/TabsPanels.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/useTabsModel.d.ts +143 -12
- package/dist/commonjs/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBar.d.ts +104 -0
- package/dist/es6/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBarItem.d.ts +3 -0
- package/dist/es6/action-bar/lib/ActionBarItem.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBarList.d.ts +3 -0
- package/dist/es6/action-bar/lib/ActionBarList.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/ActionBarOverflowButton.d.ts +4 -0
- package/dist/es6/action-bar/lib/ActionBarOverflowButton.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/useActionBarModel.d.ts +55 -0
- package/dist/es6/action-bar/lib/useActionBarModel.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs.d.ts +107 -0
- package/dist/es6/breadcrumbs/lib/Breadcrumbs.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsCurrentItem.d.ts +4 -0
- package/dist/es6/breadcrumbs/lib/BreadcrumbsCurrentItem.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsItem.d.ts +3 -0
- package/dist/es6/breadcrumbs/lib/BreadcrumbsItem.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsList.d.ts +2 -0
- package/dist/es6/breadcrumbs/lib/BreadcrumbsList.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsMenu.d.ts +49 -0
- package/dist/es6/breadcrumbs/lib/BreadcrumbsMenu.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/BreadcrumbsOverflowButton.d.ts +4 -0
- package/dist/es6/breadcrumbs/lib/BreadcrumbsOverflowButton.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts +55 -0
- package/dist/es6/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/ListBox.d.ts +39 -0
- package/dist/es6/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/es6/collection/lib/useBaseListModel.d.ts +20 -10
- package/dist/es6/collection/lib/useBaseListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useBaseListModel.js +22 -11
- package/dist/es6/collection/lib/useCursorListModel.d.ts +171 -10
- package/dist/es6/collection/lib/useCursorListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useCursorListModel.js +97 -64
- package/dist/es6/collection/lib/useGridModel.d.ts +39 -0
- package/dist/es6/collection/lib/useGridModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemRegister.d.ts +1 -0
- package/dist/es6/collection/lib/useListItemRegister.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemRovingFocus.d.ts +1 -0
- package/dist/es6/collection/lib/useListItemRovingFocus.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemSelect.d.ts +1 -0
- package/dist/es6/collection/lib/useListItemSelect.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListModel.d.ts +39 -0
- package/dist/es6/collection/lib/useListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListResetCursorOnBlur.d.ts +1 -0
- package/dist/es6/collection/lib/useListResetCursorOnBlur.d.ts.map +1 -1
- package/dist/es6/collection/lib/useOverflowListItemMeasure.d.ts +1 -0
- package/dist/es6/collection/lib/useOverflowListItemMeasure.d.ts.map +1 -1
- package/dist/es6/collection/lib/useOverflowListMeasure.d.ts +1 -0
- package/dist/es6/collection/lib/useOverflowListMeasure.d.ts.map +1 -1
- package/dist/es6/collection/lib/useOverflowListModel.d.ts +51 -0
- package/dist/es6/collection/lib/useOverflowListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useOverflowListTarget.d.ts +1 -0
- package/dist/es6/collection/lib/useOverflowListTarget.d.ts.map +1 -1
- package/dist/es6/collection/lib/useSelectionListModel.d.ts +39 -0
- package/dist/es6/collection/lib/useSelectionListModel.d.ts.map +1 -1
- package/dist/es6/dialog/lib/Dialog.d.ts +65 -0
- package/dist/es6/dialog/lib/Dialog.d.ts.map +1 -1
- package/dist/es6/dialog/lib/Dialog.js +65 -0
- package/dist/es6/menu/lib/Menu.d.ts +48 -0
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuCard.d.ts +2 -0
- package/dist/es6/menu/lib/MenuCard.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuContextTarget.d.ts +3 -0
- package/dist/es6/menu/lib/MenuContextTarget.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.d.ts +2 -0
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuList.d.ts +2 -0
- package/dist/es6/menu/lib/MenuList.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuPopper.d.ts +1 -0
- package/dist/es6/menu/lib/MenuPopper.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuTarget.d.ts +5 -0
- package/dist/es6/menu/lib/MenuTarget.d.ts.map +1 -1
- package/dist/es6/menu/lib/useMenuModel.d.ts +45 -0
- package/dist/es6/menu/lib/useMenuModel.d.ts.map +1 -1
- package/dist/es6/popup/lib/Popup.d.ts +1 -81
- package/dist/es6/popup/lib/Popup.d.ts.map +1 -1
- package/dist/es6/popup/lib/Popup.js +1 -1
- package/dist/es6/tabs/lib/Tabs.d.ts +158 -7
- package/dist/es6/tabs/lib/Tabs.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsItem.d.ts +4 -0
- package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsList.d.ts +4 -0
- package/dist/es6/tabs/lib/TabsList.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsMenuPopper.d.ts +1 -0
- package/dist/es6/tabs/lib/TabsMenuPopper.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsOverflowButton.d.ts +4 -0
- package/dist/es6/tabs/lib/TabsOverflowButton.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsPanel.d.ts +4 -0
- package/dist/es6/tabs/lib/TabsPanel.d.ts.map +1 -1
- package/dist/es6/tabs/lib/TabsPanels.d.ts +2 -0
- package/dist/es6/tabs/lib/TabsPanels.d.ts.map +1 -1
- package/dist/es6/tabs/lib/useTabsModel.d.ts +143 -12
- package/dist/es6/tabs/lib/useTabsModel.d.ts.map +1 -1
- package/package.json +3 -3
- package/popup/lib/Popup.tsx +1 -1
|
@@ -29,80 +29,79 @@ exports.createNavigationManager = createNavigationManager;
|
|
|
29
29
|
/**
|
|
30
30
|
* Get the first item in a list regardless of column count
|
|
31
31
|
*/
|
|
32
|
-
const getFirst = (_, { state }) =>
|
|
32
|
+
const getFirst = (_, { state }) => 0;
|
|
33
33
|
exports.getFirst = getFirst;
|
|
34
34
|
/**
|
|
35
35
|
* Get the last item in a list regardless of column count
|
|
36
36
|
*/
|
|
37
|
-
const getLast = (_, { state }) => state.items
|
|
37
|
+
const getLast = (_, { state }) => state.items.length - 1;
|
|
38
38
|
exports.getLast = getLast;
|
|
39
39
|
/**
|
|
40
40
|
* Get the first item in a row. If column count is 0, it will return the results of `getFirst`
|
|
41
41
|
*/
|
|
42
|
-
const getFirstOfRow = (
|
|
42
|
+
const getFirstOfRow = (index, { state }) => {
|
|
43
43
|
if (state.columnCount) {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const offset = currentIndex % state.columnCount;
|
|
47
|
-
return state.items[currentIndex - offset];
|
|
44
|
+
const offset = index % state.columnCount;
|
|
45
|
+
return index - offset;
|
|
48
46
|
}
|
|
49
|
-
return exports.getFirst(
|
|
47
|
+
return exports.getFirst(index, { state });
|
|
50
48
|
};
|
|
51
49
|
exports.getFirstOfRow = getFirstOfRow;
|
|
52
50
|
/**
|
|
53
51
|
* get the last item in a row - if column count is 0, it will return the results of `getLast`
|
|
54
52
|
*/
|
|
55
|
-
const getLastOfRow = (
|
|
53
|
+
const getLastOfRow = (index, { state }) => {
|
|
56
54
|
if (state.columnCount) {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const offset = (currentIndex % state.columnCount) - state.columnCount + 1;
|
|
60
|
-
let nextIndex = currentIndex - offset;
|
|
55
|
+
const offset = (index % state.columnCount) - state.columnCount + 1;
|
|
56
|
+
let nextIndex = index - offset;
|
|
61
57
|
if (nextIndex >= state.items.length) {
|
|
62
58
|
nextIndex = state.items.length - 1;
|
|
63
59
|
}
|
|
64
|
-
return
|
|
60
|
+
return nextIndex;
|
|
65
61
|
}
|
|
66
|
-
return exports.getLast(
|
|
62
|
+
return exports.getLast(index, { state });
|
|
67
63
|
};
|
|
68
64
|
exports.getLastOfRow = getLastOfRow;
|
|
69
65
|
/**
|
|
70
66
|
* get the item in the previous page. This can be author defined. By default it will return the
|
|
71
67
|
* first item for a list, and the first item in the same column for a grid.
|
|
72
68
|
*/
|
|
73
|
-
const getPreviousPage = (
|
|
69
|
+
const getPreviousPage = (index, { state }) => {
|
|
74
70
|
if (state.columnCount) {
|
|
75
|
-
|
|
76
|
-
const currentIndex = item.index;
|
|
77
|
-
return state.items[currentIndex % state.columnCount];
|
|
71
|
+
return index % state.columnCount;
|
|
78
72
|
}
|
|
79
|
-
return exports.getFirst(
|
|
73
|
+
return exports.getFirst(index, { state });
|
|
80
74
|
};
|
|
81
75
|
exports.getPreviousPage = getPreviousPage;
|
|
82
76
|
/**
|
|
83
77
|
* get the item in the next page. This can be author defined. By default, it will return the last
|
|
84
78
|
* item for a list, and the last item in the same column for a grid.
|
|
85
79
|
*/
|
|
86
|
-
const getNextPage = (
|
|
80
|
+
const getNextPage = (index, { state }) => {
|
|
87
81
|
if (state.columnCount) {
|
|
88
|
-
const item = getItem(id, { state });
|
|
89
|
-
const currentIndex = item.index;
|
|
90
82
|
const lastRowIndex = state.items.length - state.columnCount;
|
|
91
|
-
return
|
|
83
|
+
return lastRowIndex + (index % state.columnCount);
|
|
92
84
|
}
|
|
93
|
-
return exports.getLast(
|
|
85
|
+
return exports.getLast(index, { state });
|
|
94
86
|
};
|
|
95
87
|
exports.getNextPage = getNextPage;
|
|
96
88
|
const getItem = (id, { state }) => {
|
|
97
|
-
const item = id ? state.items.find(item =>
|
|
89
|
+
const item = id ? state.items.find(item => item.id === id) : state.items[0]; // no id, return first item
|
|
98
90
|
common_1.assert(item, `Item not found: ${id}`);
|
|
99
91
|
return item;
|
|
100
92
|
};
|
|
101
|
-
const getWrappingOffsetItem = (offset) => (
|
|
93
|
+
const getWrappingOffsetItem = (offset) => (index, { state }, tries = state.items.length) => {
|
|
94
|
+
if (Number.isNaN(index)) {
|
|
95
|
+
// we have no valid index. If the offset is positive, we'll return the first item
|
|
96
|
+
if (offset === 1) {
|
|
97
|
+
return exports.getFirst(index, { state });
|
|
98
|
+
}
|
|
99
|
+
if (offset === -1) {
|
|
100
|
+
return exports.getLast(index, { state });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
102
103
|
const items = state.items;
|
|
103
|
-
|
|
104
|
-
const currentIndex = item.index;
|
|
105
|
-
let nextIndex = currentIndex + offset;
|
|
104
|
+
let nextIndex = index + offset;
|
|
106
105
|
// calculate idealLength as in if the grid was a perfect rectangle
|
|
107
106
|
const rows = Math.ceil(items.length / state.columnCount);
|
|
108
107
|
const idealLength = rows * state.columnCount;
|
|
@@ -136,26 +135,24 @@ const getWrappingOffsetItem = (offset) => (id, { state }, tries = state.items.le
|
|
|
136
135
|
nextIndex = nextIndex - idealLength;
|
|
137
136
|
}
|
|
138
137
|
}
|
|
139
|
-
if (state.nonInteractiveIds.includes(
|
|
138
|
+
if (state.nonInteractiveIds.includes(items[nextIndex].id) && tries > 0) {
|
|
140
139
|
// The next item is disabled, try again, but only if we haven't already tried everything.
|
|
141
140
|
// Avoid an infinite loop with `tries`
|
|
142
|
-
return exports.getWrappingOffsetItem(offset)(
|
|
141
|
+
return exports.getWrappingOffsetItem(offset)(nextIndex, { state }, tries - 1);
|
|
143
142
|
}
|
|
144
|
-
return
|
|
143
|
+
return nextIndex;
|
|
145
144
|
};
|
|
146
145
|
exports.getWrappingOffsetItem = getWrappingOffsetItem;
|
|
147
|
-
const getOffsetItem = (offset) => (
|
|
146
|
+
const getOffsetItem = (offset) => (index, { state }, tries = state.items.length) => {
|
|
148
147
|
const { items, columnCount } = state;
|
|
149
|
-
|
|
150
|
-
const currentIndex = item.index;
|
|
151
|
-
let nextIndex = currentIndex + offset;
|
|
148
|
+
let nextIndex = index + offset;
|
|
152
149
|
if (Math.abs(offset) < columnCount) {
|
|
153
150
|
// if we're here, the columnCount is non-zero and the absolute value of offset is less than the
|
|
154
151
|
// column count. We don't want to wrap, so we'll bound within the row
|
|
155
|
-
const currentIndexInRow =
|
|
156
|
-
const nextIndexInRow = nextIndex -
|
|
152
|
+
const currentIndexInRow = index % columnCount;
|
|
153
|
+
const nextIndexInRow = nextIndex - index + currentIndexInRow;
|
|
157
154
|
if (nextIndexInRow >= columnCount || nextIndexInRow < 0) {
|
|
158
|
-
nextIndex =
|
|
155
|
+
nextIndex = index;
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
158
|
else if (columnCount) {
|
|
@@ -163,11 +160,11 @@ const getOffsetItem = (offset) => (id, { state }, tries = state.items.length) =>
|
|
|
163
160
|
// bound to row values
|
|
164
161
|
const nextRow = Math.floor(nextIndex / columnCount);
|
|
165
162
|
if (nextRow < 0 || nextRow >= columnCount) {
|
|
166
|
-
nextIndex =
|
|
163
|
+
nextIndex = index;
|
|
167
164
|
}
|
|
168
165
|
// make sure we don't go out of bounds if the grid isn't a perfect rectangle
|
|
169
166
|
if (nextIndex > items.length - 1) {
|
|
170
|
-
nextIndex =
|
|
167
|
+
nextIndex = index;
|
|
171
168
|
}
|
|
172
169
|
}
|
|
173
170
|
// make sure we're always in bounds
|
|
@@ -177,12 +174,12 @@ const getOffsetItem = (offset) => (id, { state }, tries = state.items.length) =>
|
|
|
177
174
|
else if (nextIndex >= items.length) {
|
|
178
175
|
nextIndex = items.length - 1;
|
|
179
176
|
}
|
|
180
|
-
if (state.nonInteractiveIds.includes(
|
|
177
|
+
if (state.nonInteractiveIds.includes(items[nextIndex].id) && tries > 0) {
|
|
181
178
|
// The next item is disabled, try again, but only if we haven't already tried everything.
|
|
182
179
|
// Avoid an infinite loop with `tries`
|
|
183
|
-
return exports.getOffsetItem(offset)(
|
|
180
|
+
return exports.getOffsetItem(offset)(nextIndex, { state }, tries - 1);
|
|
184
181
|
}
|
|
185
|
-
return
|
|
182
|
+
return nextIndex;
|
|
186
183
|
};
|
|
187
184
|
exports.getOffsetItem = getOffsetItem;
|
|
188
185
|
/**
|
|
@@ -195,9 +192,9 @@ exports.wrappingNavigationManager = exports.createNavigationManager({
|
|
|
195
192
|
getLast: exports.getLast,
|
|
196
193
|
getItem,
|
|
197
194
|
getNext: exports.getWrappingOffsetItem(1),
|
|
198
|
-
getNextRow: (
|
|
195
|
+
getNextRow: (index, { state }) => exports.getWrappingOffsetItem(state.columnCount)(index, { state }),
|
|
199
196
|
getPrevious: exports.getWrappingOffsetItem(-1),
|
|
200
|
-
getPreviousRow: (
|
|
197
|
+
getPreviousRow: (index, { state }) => exports.getWrappingOffsetItem(-state.columnCount)(index, { state }),
|
|
201
198
|
getPreviousPage: exports.getPreviousPage,
|
|
202
199
|
getNextPage: exports.getNextPage,
|
|
203
200
|
getFirstOfRow: exports.getFirstOfRow,
|
|
@@ -212,9 +209,9 @@ exports.navigationManager = exports.createNavigationManager({
|
|
|
212
209
|
getLast: exports.getLast,
|
|
213
210
|
getItem,
|
|
214
211
|
getNext: exports.getOffsetItem(1),
|
|
215
|
-
getNextRow: (
|
|
212
|
+
getNextRow: (index, { state }) => exports.getOffsetItem(state.columnCount)(index, { state }),
|
|
216
213
|
getPrevious: exports.getOffsetItem(-1),
|
|
217
|
-
getPreviousRow: (
|
|
214
|
+
getPreviousRow: (index, { state }) => exports.getOffsetItem(-state.columnCount)(index, { state }),
|
|
218
215
|
getPreviousPage: exports.getPreviousPage,
|
|
219
216
|
getNextPage: exports.getNextPage,
|
|
220
217
|
getFirstOfRow: exports.getFirstOfRow,
|
|
@@ -250,15 +247,35 @@ exports.useCursorListModel = common_1.createModelHook({
|
|
|
250
247
|
* well as left/right keys to give a more consistent experience to all users.
|
|
251
248
|
*/
|
|
252
249
|
navigation: exports.wrappingNavigationManager,
|
|
250
|
+
/**
|
|
251
|
+
* Controls how much a pageUp/pageDown navigation request will jump. If not provided, the size
|
|
252
|
+
* of the list and number of items rendered will determine this value.
|
|
253
|
+
*/
|
|
254
|
+
pageSize: 0,
|
|
253
255
|
},
|
|
254
256
|
requiredConfig: useBaseListModel_1.useBaseListModel.requiredConfig,
|
|
257
|
+
contextOverride: useBaseListModel_1.useBaseListModel.Context,
|
|
255
258
|
})(config => {
|
|
256
|
-
var _a;
|
|
259
|
+
var _a, _b;
|
|
257
260
|
const [cursorId, setCursorId] = react_1.default.useState(config.initialCursorId);
|
|
261
|
+
const pageSizeRef = react_1.default.useRef(config.pageSize);
|
|
258
262
|
const columnCount = config.columnCount || 0;
|
|
259
263
|
const list = useBaseListModel_1.useBaseListModel(config);
|
|
260
|
-
const initialCurrentRef = react_1.default.useRef(config.initialCursorId || (((_a = config.items) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
264
|
+
const initialCurrentRef = react_1.default.useRef(config.initialCursorId || (((_a = config.items) === null || _a === void 0 ? void 0 : _a.length) ? list.state.items[0].id : ''));
|
|
261
265
|
const navigation = config.navigation;
|
|
266
|
+
const cursorIndexRef = react_1.default.useRef(-1);
|
|
267
|
+
const setCursor = (index) => {
|
|
268
|
+
var _a;
|
|
269
|
+
const id = ((_a = state.items[index]) === null || _a === void 0 ? void 0 : _a.id) || '';
|
|
270
|
+
setCursorId(id);
|
|
271
|
+
};
|
|
272
|
+
// Keep the cursorIndex up to date with the cursor ID
|
|
273
|
+
if (cursorId && ((_b = list.state.items[cursorIndexRef.current]) === null || _b === void 0 ? void 0 : _b.id) !== cursorId) {
|
|
274
|
+
cursorIndexRef.current = list.state.items.findIndex(item => item.id === cursorId);
|
|
275
|
+
}
|
|
276
|
+
else if (!cursorId) {
|
|
277
|
+
cursorIndexRef.current = -1;
|
|
278
|
+
}
|
|
262
279
|
const state = {
|
|
263
280
|
...list.state,
|
|
264
281
|
/** The id of the list item the cursor is pointing to */
|
|
@@ -269,6 +286,11 @@ exports.useCursorListModel = common_1.createModelHook({
|
|
|
269
286
|
* @private Use useGridModel instead to make a grid instead of a list
|
|
270
287
|
*/
|
|
271
288
|
columnCount,
|
|
289
|
+
/**
|
|
290
|
+
* A React.Ref of the current page size. Either provided as config, or determined at runtime
|
|
291
|
+
* based on the size of the list container and the number of items fitting within the container.
|
|
292
|
+
*/
|
|
293
|
+
pageSizeRef,
|
|
272
294
|
};
|
|
273
295
|
const events = {
|
|
274
296
|
...list.events,
|
|
@@ -286,7 +308,8 @@ exports.useCursorListModel = common_1.createModelHook({
|
|
|
286
308
|
},
|
|
287
309
|
/** Directly sets the cursor to the list item by its identifier. */
|
|
288
310
|
goTo(data) {
|
|
289
|
-
|
|
311
|
+
const index = state.items.findIndex(item => item.id === data.id);
|
|
312
|
+
setCursor(index);
|
|
290
313
|
},
|
|
291
314
|
/**
|
|
292
315
|
* Set the cursor to the "next" item in the list. This event delegates to the `getNext` method of
|
|
@@ -295,14 +318,16 @@ exports.useCursorListModel = common_1.createModelHook({
|
|
|
295
318
|
* item in a row.
|
|
296
319
|
*/
|
|
297
320
|
goToNext() {
|
|
298
|
-
|
|
321
|
+
const index = navigation.getNext(cursorIndexRef.current, { state });
|
|
322
|
+
setCursor(index);
|
|
299
323
|
},
|
|
300
324
|
/**
|
|
301
325
|
* Set the cursor to the "previous" item in the list. If the beginning of the list is detected,
|
|
302
326
|
* it will wrap to the last item
|
|
303
327
|
*/
|
|
304
328
|
goToPrevious() {
|
|
305
|
-
|
|
329
|
+
const index = navigation.getPrevious(cursorIndexRef.current, { state });
|
|
330
|
+
setCursor(index);
|
|
306
331
|
},
|
|
307
332
|
/**
|
|
308
333
|
* Previous item perpendicular to the orientation of a list, or the previous row in a grid. For
|
|
@@ -311,9 +336,10 @@ exports.useCursorListModel = common_1.createModelHook({
|
|
|
311
336
|
* this would be the previous row (current position - column count).
|
|
312
337
|
*/
|
|
313
338
|
goToPreviousRow() {
|
|
314
|
-
|
|
339
|
+
const index = navigation.getPreviousRow(cursorIndexRef.current, {
|
|
315
340
|
state,
|
|
316
|
-
})
|
|
341
|
+
});
|
|
342
|
+
setCursor(index);
|
|
317
343
|
},
|
|
318
344
|
/**
|
|
319
345
|
* Next item perpendicular to the orientation of a list, or the next row in a grid. For example,
|
|
@@ -322,29 +348,36 @@ exports.useCursorListModel = common_1.createModelHook({
|
|
|
322
348
|
* next row (current position + column count).
|
|
323
349
|
*/
|
|
324
350
|
goToNextRow() {
|
|
325
|
-
|
|
351
|
+
const index = navigation.getNextRow(cursorIndexRef.current, { state });
|
|
352
|
+
setCursor(index);
|
|
326
353
|
},
|
|
327
354
|
/** Set the cursor to the first item in the list */
|
|
328
355
|
goToFirst() {
|
|
329
|
-
|
|
356
|
+
const index = navigation.getFirst(cursorIndexRef.current, { state });
|
|
357
|
+
setCursor(index);
|
|
330
358
|
},
|
|
331
359
|
/** Set the cursor to the last item in the list */
|
|
332
360
|
goToLast() {
|
|
333
|
-
|
|
361
|
+
const index = navigation.getLast(cursorIndexRef.current, { state });
|
|
362
|
+
setCursor(index);
|
|
334
363
|
},
|
|
335
364
|
goToFirstOfRow() {
|
|
336
|
-
|
|
365
|
+
const index = navigation.getFirstOfRow(cursorIndexRef.current, { state });
|
|
366
|
+
setCursor(index);
|
|
337
367
|
},
|
|
338
368
|
goToLastOfRow() {
|
|
339
|
-
|
|
369
|
+
const index = navigation.getLastOfRow(cursorIndexRef.current, { state });
|
|
370
|
+
setCursor(index);
|
|
340
371
|
},
|
|
341
372
|
goToNextPage() {
|
|
342
|
-
|
|
373
|
+
const index = navigation.getNextPage(cursorIndexRef.current, { state });
|
|
374
|
+
setCursor(index);
|
|
343
375
|
},
|
|
344
376
|
goToPreviousPage() {
|
|
345
|
-
|
|
377
|
+
const index = navigation.getPreviousPage(cursorIndexRef.current, {
|
|
346
378
|
state,
|
|
347
|
-
})
|
|
379
|
+
});
|
|
380
|
+
setCursor(index);
|
|
348
381
|
},
|
|
349
382
|
};
|
|
350
383
|
return { ...list, state, events, navigation };
|
|
@@ -18,6 +18,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
18
18
|
initialUnselectedIds: string[];
|
|
19
19
|
selection: import("./useSelectionListModel").SelectionManager;
|
|
20
20
|
initialCursorId: string;
|
|
21
|
+
pageSize: number;
|
|
21
22
|
id: string;
|
|
22
23
|
getId: (item: any) => string;
|
|
23
24
|
getTextValue: (item: any) => string;
|
|
@@ -38,6 +39,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
38
39
|
unselectedIds: string[];
|
|
39
40
|
cursorId: string;
|
|
40
41
|
columnCount: number;
|
|
42
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
41
43
|
UNSTABLE_virtual: {
|
|
42
44
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
43
45
|
totalSize: number;
|
|
@@ -59,6 +61,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
59
61
|
unselectedIds: string[];
|
|
60
62
|
cursorId: string;
|
|
61
63
|
columnCount: number;
|
|
64
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
62
65
|
UNSTABLE_virtual: {
|
|
63
66
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
64
67
|
totalSize: number;
|
|
@@ -80,6 +83,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
80
83
|
unselectedIds: string[];
|
|
81
84
|
cursorId: string;
|
|
82
85
|
columnCount: number;
|
|
86
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
83
87
|
UNSTABLE_virtual: {
|
|
84
88
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
85
89
|
totalSize: number;
|
|
@@ -104,6 +108,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
104
108
|
unselectedIds: string[];
|
|
105
109
|
cursorId: string;
|
|
106
110
|
columnCount: number;
|
|
111
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
107
112
|
UNSTABLE_virtual: {
|
|
108
113
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
109
114
|
totalSize: number;
|
|
@@ -127,6 +132,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
127
132
|
unselectedIds: string[];
|
|
128
133
|
cursorId: string;
|
|
129
134
|
columnCount: number;
|
|
135
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
130
136
|
UNSTABLE_virtual: {
|
|
131
137
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
132
138
|
totalSize: number;
|
|
@@ -148,6 +154,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
148
154
|
unselectedIds: string[];
|
|
149
155
|
cursorId: string;
|
|
150
156
|
columnCount: number;
|
|
157
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
151
158
|
UNSTABLE_virtual: {
|
|
152
159
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
153
160
|
totalSize: number;
|
|
@@ -169,6 +176,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
169
176
|
unselectedIds: string[];
|
|
170
177
|
cursorId: string;
|
|
171
178
|
columnCount: number;
|
|
179
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
172
180
|
UNSTABLE_virtual: {
|
|
173
181
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
174
182
|
totalSize: number;
|
|
@@ -190,6 +198,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
190
198
|
unselectedIds: string[];
|
|
191
199
|
cursorId: string;
|
|
192
200
|
columnCount: number;
|
|
201
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
193
202
|
UNSTABLE_virtual: {
|
|
194
203
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
195
204
|
totalSize: number;
|
|
@@ -211,6 +220,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
211
220
|
unselectedIds: string[];
|
|
212
221
|
cursorId: string;
|
|
213
222
|
columnCount: number;
|
|
223
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
214
224
|
UNSTABLE_virtual: {
|
|
215
225
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
216
226
|
totalSize: number;
|
|
@@ -232,6 +242,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
232
242
|
unselectedIds: string[];
|
|
233
243
|
cursorId: string;
|
|
234
244
|
columnCount: number;
|
|
245
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
235
246
|
UNSTABLE_virtual: {
|
|
236
247
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
237
248
|
totalSize: number;
|
|
@@ -253,6 +264,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
253
264
|
unselectedIds: string[];
|
|
254
265
|
cursorId: string;
|
|
255
266
|
columnCount: number;
|
|
267
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
256
268
|
UNSTABLE_virtual: {
|
|
257
269
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
258
270
|
totalSize: number;
|
|
@@ -274,6 +286,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
274
286
|
unselectedIds: string[];
|
|
275
287
|
cursorId: string;
|
|
276
288
|
columnCount: number;
|
|
289
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
277
290
|
UNSTABLE_virtual: {
|
|
278
291
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
279
292
|
totalSize: number;
|
|
@@ -295,6 +308,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
295
308
|
unselectedIds: string[];
|
|
296
309
|
cursorId: string;
|
|
297
310
|
columnCount: number;
|
|
311
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
298
312
|
UNSTABLE_virtual: {
|
|
299
313
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
300
314
|
totalSize: number;
|
|
@@ -316,6 +330,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
316
330
|
unselectedIds: string[];
|
|
317
331
|
cursorId: string;
|
|
318
332
|
columnCount: number;
|
|
333
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
319
334
|
UNSTABLE_virtual: {
|
|
320
335
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
321
336
|
totalSize: number;
|
|
@@ -337,6 +352,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
337
352
|
unselectedIds: string[];
|
|
338
353
|
cursorId: string;
|
|
339
354
|
columnCount: number;
|
|
355
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
340
356
|
UNSTABLE_virtual: {
|
|
341
357
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
342
358
|
totalSize: number;
|
|
@@ -360,6 +376,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
360
376
|
unselectedIds: string[];
|
|
361
377
|
cursorId: string;
|
|
362
378
|
columnCount: number;
|
|
379
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
363
380
|
UNSTABLE_virtual: {
|
|
364
381
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
365
382
|
totalSize: number;
|
|
@@ -383,6 +400,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
383
400
|
unselectedIds: string[];
|
|
384
401
|
cursorId: string;
|
|
385
402
|
columnCount: number;
|
|
403
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
386
404
|
UNSTABLE_virtual: {
|
|
387
405
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
388
406
|
totalSize: number;
|
|
@@ -407,6 +425,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
407
425
|
unselectedIds: string[];
|
|
408
426
|
cursorId: string;
|
|
409
427
|
columnCount: number;
|
|
428
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
410
429
|
UNSTABLE_virtual: {
|
|
411
430
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
412
431
|
totalSize: number;
|
|
@@ -428,6 +447,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
428
447
|
unselectedIds: string[];
|
|
429
448
|
cursorId: string;
|
|
430
449
|
columnCount: number;
|
|
450
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
431
451
|
UNSTABLE_virtual: {
|
|
432
452
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
433
453
|
totalSize: number;
|
|
@@ -449,6 +469,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
449
469
|
unselectedIds: string[];
|
|
450
470
|
cursorId: string;
|
|
451
471
|
columnCount: number;
|
|
472
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
452
473
|
UNSTABLE_virtual: {
|
|
453
474
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
454
475
|
totalSize: number;
|
|
@@ -473,6 +494,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
473
494
|
unselectedIds: string[];
|
|
474
495
|
cursorId: string;
|
|
475
496
|
columnCount: number;
|
|
497
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
476
498
|
UNSTABLE_virtual: {
|
|
477
499
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
478
500
|
totalSize: number;
|
|
@@ -496,6 +518,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
496
518
|
unselectedIds: string[];
|
|
497
519
|
cursorId: string;
|
|
498
520
|
columnCount: number;
|
|
521
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
499
522
|
UNSTABLE_virtual: {
|
|
500
523
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
501
524
|
totalSize: number;
|
|
@@ -517,6 +540,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
517
540
|
unselectedIds: string[];
|
|
518
541
|
cursorId: string;
|
|
519
542
|
columnCount: number;
|
|
543
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
520
544
|
UNSTABLE_virtual: {
|
|
521
545
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
522
546
|
totalSize: number;
|
|
@@ -538,6 +562,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
538
562
|
unselectedIds: string[];
|
|
539
563
|
cursorId: string;
|
|
540
564
|
columnCount: number;
|
|
565
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
541
566
|
UNSTABLE_virtual: {
|
|
542
567
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
543
568
|
totalSize: number;
|
|
@@ -559,6 +584,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
559
584
|
unselectedIds: string[];
|
|
560
585
|
cursorId: string;
|
|
561
586
|
columnCount: number;
|
|
587
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
562
588
|
UNSTABLE_virtual: {
|
|
563
589
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
564
590
|
totalSize: number;
|
|
@@ -580,6 +606,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
580
606
|
unselectedIds: string[];
|
|
581
607
|
cursorId: string;
|
|
582
608
|
columnCount: number;
|
|
609
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
583
610
|
UNSTABLE_virtual: {
|
|
584
611
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
585
612
|
totalSize: number;
|
|
@@ -601,6 +628,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
601
628
|
unselectedIds: string[];
|
|
602
629
|
cursorId: string;
|
|
603
630
|
columnCount: number;
|
|
631
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
604
632
|
UNSTABLE_virtual: {
|
|
605
633
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
606
634
|
totalSize: number;
|
|
@@ -622,6 +650,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
622
650
|
unselectedIds: string[];
|
|
623
651
|
cursorId: string;
|
|
624
652
|
columnCount: number;
|
|
653
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
625
654
|
UNSTABLE_virtual: {
|
|
626
655
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
627
656
|
totalSize: number;
|
|
@@ -643,6 +672,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
643
672
|
unselectedIds: string[];
|
|
644
673
|
cursorId: string;
|
|
645
674
|
columnCount: number;
|
|
675
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
646
676
|
UNSTABLE_virtual: {
|
|
647
677
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
648
678
|
totalSize: number;
|
|
@@ -664,6 +694,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
664
694
|
unselectedIds: string[];
|
|
665
695
|
cursorId: string;
|
|
666
696
|
columnCount: number;
|
|
697
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
667
698
|
UNSTABLE_virtual: {
|
|
668
699
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
669
700
|
totalSize: number;
|
|
@@ -685,6 +716,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
685
716
|
unselectedIds: string[];
|
|
686
717
|
cursorId: string;
|
|
687
718
|
columnCount: number;
|
|
719
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
688
720
|
UNSTABLE_virtual: {
|
|
689
721
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
690
722
|
totalSize: number;
|
|
@@ -706,6 +738,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
706
738
|
unselectedIds: string[];
|
|
707
739
|
cursorId: string;
|
|
708
740
|
columnCount: number;
|
|
741
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
709
742
|
UNSTABLE_virtual: {
|
|
710
743
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
711
744
|
totalSize: number;
|
|
@@ -729,6 +762,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
729
762
|
unselectedIds: string[];
|
|
730
763
|
cursorId: string;
|
|
731
764
|
columnCount: number;
|
|
765
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
732
766
|
UNSTABLE_virtual: {
|
|
733
767
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
734
768
|
totalSize: number;
|
|
@@ -752,6 +786,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
752
786
|
unselectedIds: string[];
|
|
753
787
|
cursorId: string;
|
|
754
788
|
columnCount: number;
|
|
789
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
755
790
|
UNSTABLE_virtual: {
|
|
756
791
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
757
792
|
totalSize: number;
|
|
@@ -774,6 +809,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
774
809
|
unselectedIds: string[];
|
|
775
810
|
cursorId: string;
|
|
776
811
|
columnCount: number;
|
|
812
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
777
813
|
UNSTABLE_virtual: {
|
|
778
814
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
779
815
|
totalSize: number;
|
|
@@ -839,6 +875,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
839
875
|
initialUnselectedIds: string[];
|
|
840
876
|
selection: import("./useSelectionListModel").SelectionManager;
|
|
841
877
|
initialCursorId: string;
|
|
878
|
+
pageSize: number;
|
|
842
879
|
id: string;
|
|
843
880
|
getId: (item: any) => string;
|
|
844
881
|
getTextValue: (item: any) => string;
|
|
@@ -856,6 +893,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
856
893
|
unselectedIds: string[];
|
|
857
894
|
cursorId: string;
|
|
858
895
|
columnCount: number;
|
|
896
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
859
897
|
UNSTABLE_virtual: {
|
|
860
898
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
861
899
|
totalSize: number;
|
|
@@ -906,6 +944,7 @@ export declare const useGridModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
|
906
944
|
unselectedIds: string[];
|
|
907
945
|
cursorId: string;
|
|
908
946
|
columnCount: number;
|
|
947
|
+
pageSizeRef: import("react").MutableRefObject<number>;
|
|
909
948
|
UNSTABLE_virtual: {
|
|
910
949
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
911
950
|
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
|
|
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"}
|
|
@@ -20,6 +20,7 @@ export declare const useListItemRegister: import("@workday/canvas-kit-react/comm
|
|
|
20
20
|
unselectedIds: string[];
|
|
21
21
|
cursorId: string;
|
|
22
22
|
columnCount: number;
|
|
23
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
23
24
|
UNSTABLE_virtual: {
|
|
24
25
|
virtualItems: VirtualItem[];
|
|
25
26
|
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;AAS3C,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"useListItemRegister.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRegister.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAS3C,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmE/B,CAAC"}
|
|
@@ -17,6 +17,7 @@ export declare const useListItemRovingFocus: import("@workday/canvas-kit-react/c
|
|
|
17
17
|
state: {
|
|
18
18
|
cursorId: string;
|
|
19
19
|
columnCount: number;
|
|
20
|
+
pageSizeRef: React.MutableRefObject<number>;
|
|
20
21
|
UNSTABLE_virtual: {
|
|
21
22
|
virtualItems: import("./react-virtual").VirtualItem[];
|
|
22
23
|
totalSize: number;
|