@react-fabric/data 1.0.0-beta.9 → 1.0.2

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 (141) hide show
  1. package/{src/histogram/Histogram.module.css → css/_histogram.css} +16 -13
  2. package/css/styles.css +24 -0
  3. package/dist/cjs/checklist/CheckList.js +59 -33
  4. package/dist/cjs/histogram/Histogram.js +41 -26
  5. package/dist/cjs/hooks/useFilteredList.js +100 -17
  6. package/dist/cjs/hooks/usePagination.js +29 -8
  7. package/dist/cjs/hooks/useSelectableList.js +30 -5
  8. package/dist/cjs/i18n/{ar.json.js → ar/data.json.js} +8 -1
  9. package/dist/cjs/i18n/{en.json.js → en/data.json.js} +8 -1
  10. package/dist/cjs/i18n/index.js +4 -4
  11. package/dist/cjs/index.js +30 -0
  12. package/dist/cjs/json/JsonViewer.js +80 -43
  13. package/dist/cjs/pagination/Pagination.js +24 -15
  14. package/dist/cjs/table/AddColumn.js +5 -5
  15. package/dist/cjs/table/BodyCell.js +20 -13
  16. package/dist/cjs/table/BodyRow.js +41 -28
  17. package/dist/cjs/table/CheckboxCell.js +10 -9
  18. package/dist/cjs/table/ColumnFilters.js +100 -0
  19. package/dist/cjs/table/EmptyCell.js +4 -4
  20. package/dist/cjs/table/HeaderCell.js +79 -53
  21. package/dist/cjs/table/HtmlTable.js +84 -0
  22. package/dist/cjs/table/{Context.js → Provider.js} +8 -10
  23. package/dist/cjs/table/Table.js +99 -33
  24. package/dist/cjs/{tree/types.js → table/context.js} +9 -5
  25. package/dist/cjs/table/types.js +29 -0
  26. package/dist/cjs/table/useResizer.js +10 -10
  27. package/dist/cjs/table/useTableColumns.js +4 -4
  28. package/dist/cjs/table/useVirtualTable.js +129 -22
  29. package/dist/cjs/tree/TreeNode.js +66 -46
  30. package/dist/cjs/tree/TreePanel.js +60 -24
  31. package/dist/cjs/tree/useTree.js +212 -47
  32. package/dist/cjs/tree/utils.js +63 -34
  33. package/dist/cjs/utils/getColor.js +58 -0
  34. package/dist/cjs/virtual/Gallery.js +119 -61
  35. package/dist/cjs/virtual/List.js +116 -55
  36. package/dist/cjs/virtual/Scroller.js +16 -8
  37. package/dist/esm/checklist/CheckList.js +61 -35
  38. package/dist/esm/histogram/Histogram.js +43 -28
  39. package/dist/esm/hooks/useFilteredList.js +101 -18
  40. package/dist/esm/hooks/usePagination.js +29 -8
  41. package/dist/esm/hooks/useSelectableList.js +30 -5
  42. package/dist/esm/i18n/{ar.json.js → ar/data.json.js} +8 -2
  43. package/dist/esm/i18n/{en.json.js → en/data.json.js} +8 -2
  44. package/dist/esm/i18n/index.js +2 -2
  45. package/dist/esm/index.js +31 -0
  46. package/dist/esm/json/JsonViewer.js +82 -45
  47. package/dist/esm/pagination/Pagination.js +25 -16
  48. package/dist/esm/table/AddColumn.js +6 -6
  49. package/dist/esm/table/BodyCell.js +21 -14
  50. package/dist/esm/table/BodyRow.js +41 -28
  51. package/dist/esm/table/CheckboxCell.js +11 -10
  52. package/dist/esm/table/ColumnFilters.js +100 -0
  53. package/dist/esm/table/EmptyCell.js +4 -4
  54. package/dist/esm/table/HeaderCell.js +80 -54
  55. package/dist/esm/table/HtmlTable.js +84 -0
  56. package/dist/esm/table/{Context.js → Provider.js} +11 -12
  57. package/dist/esm/table/Table.js +100 -34
  58. package/dist/esm/{tree/types.js → table/context.js} +8 -4
  59. package/dist/esm/table/types.js +29 -0
  60. package/dist/esm/table/useResizer.js +10 -10
  61. package/dist/esm/table/useTableColumns.js +4 -4
  62. package/dist/esm/table/useVirtualTable.js +131 -24
  63. package/dist/esm/tree/TreeNode.js +69 -49
  64. package/dist/esm/tree/TreePanel.js +62 -26
  65. package/dist/esm/tree/useTree.js +215 -50
  66. package/dist/esm/tree/utils.js +64 -35
  67. package/dist/esm/utils/getColor.js +58 -0
  68. package/dist/esm/virtual/Gallery.js +121 -63
  69. package/dist/esm/virtual/List.js +118 -57
  70. package/dist/esm/virtual/Scroller.js +17 -9
  71. package/dist/types/checklist/CheckList.d.ts +25 -6
  72. package/dist/types/histogram/Histogram.d.ts +28 -6
  73. package/dist/types/hooks/useFilteredList.d.ts +62 -5
  74. package/dist/types/hooks/usePagination.d.ts +18 -2
  75. package/dist/types/hooks/useSelectableList.d.ts +24 -1
  76. package/dist/types/index.d.ts +27 -0
  77. package/dist/types/json/JsonViewer.d.ts +23 -3
  78. package/dist/types/pagination/Pagination.d.ts +8 -2
  79. package/dist/types/table/AddColumn.d.ts +2 -2
  80. package/dist/types/table/BodyCell.d.ts +2 -2
  81. package/dist/types/table/BodyRow.d.ts +9 -9
  82. package/dist/types/table/CheckboxCell.d.ts +3 -3
  83. package/dist/types/table/ColumnFilters.d.ts +12 -0
  84. package/dist/types/table/EmptyCell.d.ts +1 -1
  85. package/dist/types/table/HeaderCell.d.ts +1 -1
  86. package/dist/types/table/HtmlTable.d.ts +21 -0
  87. package/dist/types/table/Provider.d.ts +2 -0
  88. package/dist/types/table/Table.d.ts +10 -1
  89. package/dist/types/table/context.d.ts +7 -0
  90. package/dist/types/table/types.d.ts +52 -10
  91. package/dist/types/table/useResizer.d.ts +1 -1
  92. package/dist/types/table/useTableColumns.d.ts +1 -1
  93. package/dist/types/table/useVirtualTable.d.ts +31 -12
  94. package/dist/types/tree/TreeNode.d.ts +1 -1
  95. package/dist/types/tree/TreePanel.d.ts +36 -1
  96. package/dist/types/tree/types.d.ts +75 -28
  97. package/dist/types/tree/useTree.d.ts +8 -12
  98. package/dist/types/tree/utils.d.ts +15 -8
  99. package/dist/types/utils/getColor.d.ts +43 -0
  100. package/dist/types/virtual/Gallery.d.ts +37 -6
  101. package/dist/types/virtual/List.d.ts +38 -6
  102. package/dist/types/virtual/Scroller.d.ts +1 -1
  103. package/package.json +17 -19
  104. package/src/checklist/CheckList.tsx +68 -71
  105. package/src/histogram/Histogram.tsx +47 -48
  106. package/src/hooks/useFilteredList.tsx +111 -28
  107. package/src/hooks/usePagination.tsx +39 -39
  108. package/src/hooks/useSelectableList.ts +45 -33
  109. package/src/i18n/{ar.json → ar/data.json} +5 -0
  110. package/src/i18n/{en.json → en/data.json} +5 -0
  111. package/src/i18n/index.ts +2 -2
  112. package/src/index.ts +23 -17
  113. package/src/json/JsonViewer.tsx +89 -120
  114. package/src/pagination/Pagination.tsx +104 -105
  115. package/src/table/AddColumn.tsx +6 -15
  116. package/src/table/BodyCell.tsx +27 -36
  117. package/src/table/BodyRow.tsx +36 -59
  118. package/src/table/CheckboxCell.tsx +12 -15
  119. package/src/table/ColumnFilters.tsx +93 -0
  120. package/src/table/EmptyCell.tsx +5 -18
  121. package/src/table/HeaderCell.tsx +72 -53
  122. package/src/table/HtmlTable.tsx +106 -0
  123. package/src/table/{Context.tsx → Provider.tsx} +11 -28
  124. package/src/table/Table.tsx +98 -83
  125. package/src/table/context.ts +33 -0
  126. package/src/table/types.ts +53 -27
  127. package/src/table/useResizer.ts +5 -9
  128. package/src/table/useTableColumns.ts +4 -6
  129. package/src/table/useVirtualTable.ts +136 -37
  130. package/src/tree/TreeNode.tsx +91 -86
  131. package/src/tree/TreePanel.tsx +87 -51
  132. package/src/tree/types.ts +85 -46
  133. package/src/tree/useTree.ts +210 -65
  134. package/src/tree/utils.ts +81 -62
  135. package/src/utils/getColor.ts +55 -0
  136. package/src/virtual/Gallery.tsx +129 -120
  137. package/src/virtual/List.tsx +124 -91
  138. package/src/virtual/Scroller.tsx +25 -9
  139. package/dist/cjs/histogram/Histogram.module.css +0 -1
  140. package/dist/esm/histogram/Histogram.module.css +0 -1
  141. package/dist/types/table/Context.d.ts +0 -8
@@ -6,23 +6,27 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
6
6
  var core = require('@react-fabric/core');
7
7
  var utilities = require('@react-fabric/utilities');
8
8
  var reactVirtual = require('@tanstack/react-virtual');
9
- var classNames = require('classnames');
10
- var memoizeOne = require('memoize-one');
9
+ var memoize = require('memoize-one');
11
10
  var react = require('react');
12
11
  var Scroller = require('./Scroller.js');
13
12
  var jsxRuntime = require('react/jsx-runtime');
14
13
 
15
- var _excluded = ["items", "children", "columns", "padding", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "galleryRef"];
14
+ var _excluded = ["items", "children", "columns", "fullWidth", "maxWidth", "minWidth", "total", "padding", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "galleryRef"];
16
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
- var createItemList = memoizeOne(function (items) {
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
+ var createItemList = memoize(function (items) {
19
18
  return items;
20
19
  });
21
- var _VirtualGallery = function _VirtualGallery(_ref) {
20
+ var VirtualGalleryComponent = function VirtualGalleryComponent(_ref) {
22
21
  var _virtualItems$3;
23
22
  var items = _ref.items,
24
23
  children = _ref.children,
25
24
  columns = _ref.columns,
25
+ fullWidth = _ref.fullWidth,
26
+ maxWidth = _ref.maxWidth,
27
+ minWidth = _ref.minWidth,
28
+ _ref$total = _ref.total,
29
+ total = _ref$total === void 0 ? 0 : _ref$total,
26
30
  _ref$padding = _ref.padding,
27
31
  padding = _ref$padding === void 0 ? "md" : _ref$padding,
28
32
  _ref$defaultHeight = _ref.defaultHeight,
@@ -38,13 +42,13 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
38
42
  aria = _objectWithoutProperties(_ref, _excluded);
39
43
  var count = react.useDeferredValue(items.length);
40
44
  var extraSize = react.useMemo(function () {
41
- return onLoadMore ? 64 : 0;
45
+ return onLoadMore ? 8 : 0;
42
46
  }, [onLoadMore]);
43
- var itemList = createItemList(items.map(function (item, idx) {
47
+ var itemList = createItemList(items.map(function (item, index) {
44
48
  return {
45
- index: idx,
46
- data: item,
47
- isLast: idx + 1 === items.length
49
+ index: index,
50
+ item: item,
51
+ isLast: index + 1 === items.length
48
52
  };
49
53
  }));
50
54
  var scrollerRef = react.useRef(null);
@@ -61,8 +65,9 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
61
65
  if (scrollerRef.current) {
62
66
  var el = scrollerRef.current;
63
67
  var handler = function handler() {
64
- var _el$offsetWidth;
65
- setColumnCount(columns !== null && columns !== void 0 ? columns : Math.max(1, Math.floor((((_el$offsetWidth = el === null || el === void 0 ? void 0 : el.offsetWidth) !== null && _el$offsetWidth !== void 0 ? _el$offsetWidth : 800) - 32) / width)));
68
+ var _getComputedStyle$pad, _el$firstElementChild, _el$offsetWidth;
69
+ var pad = parseInt((_getComputedStyle$pad = getComputedStyle((_el$firstElementChild = el.firstElementChild) === null || _el$firstElementChild === void 0 ? void 0 : _el$firstElementChild.firstElementChild).padding) !== null && _getComputedStyle$pad !== void 0 ? _getComputedStyle$pad : 8);
70
+ setColumnCount(columns !== null && columns !== void 0 ? columns : Math.max(1, Math.floor((((_el$offsetWidth = el === null || el === void 0 ? void 0 : el.offsetWidth) !== null && _el$offsetWidth !== void 0 ? _el$offsetWidth : 800) - 32 - (isNaN(pad) ? 8 : pad) * 2) / width)));
66
71
  };
67
72
  var ob = new ResizeObserver(handler);
68
73
  handler();
@@ -80,14 +85,15 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
80
85
  },
81
86
  estimateSize: function estimateSize() {
82
87
  return height;
83
- }
88
+ },
89
+ overscan: 0
84
90
  });
85
91
  var virtualItems = virtualizer.getVirtualItems();
86
- var currentIndex = react.useRef(0);
92
+ var currentIndexRef = react.useRef(0);
87
93
  react.useEffect(function () {
88
- var _virtualItems$1$index, _virtualItems$;
89
- currentIndex.current = (_virtualItems$1$index = (_virtualItems$ = virtualItems[1]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.index) !== null && _virtualItems$1$index !== void 0 ? _virtualItems$1$index : 0;
90
- if (scrollerRef.current && virtualItems[0] && scrollerRef.current.scrollTop < virtualItems[0].size) currentIndex.current = 0;
94
+ var _virtualItems$0$index, _virtualItems$;
95
+ currentIndexRef.current = (_virtualItems$0$index = (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.index) !== null && _virtualItems$0$index !== void 0 ? _virtualItems$0$index : 0;
96
+ if (scrollerRef.current && virtualItems[0] && scrollerRef.current.scrollTop < virtualItems[0].size) currentIndexRef.current = 0;
91
97
  }, [virtualItems]);
92
98
  var calculateActiveScroll = react.useCallback(function () {
93
99
  var _scrollerRef$current;
@@ -102,85 +108,105 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
102
108
  if (scrollTop === 0) return 1;
103
109
  if (scrollTop >= scrollHeight - offsetHeight - extraSize * 2) return 2;
104
110
  return 3;
111
+ // eslint-disable-next-line @eslint-react/exhaustive-deps
105
112
  }, []);
106
113
  var _useState3 = react.useState(0),
107
114
  _useState4 = _slicedToArray(_useState3, 2),
108
115
  scrollActive = _useState4[0],
109
116
  setScrollActive = _useState4[1];
110
117
  var fireScrollEvent = core.useDebounce(function (idx) {
111
- return onScroll === null || onScroll === void 0 ? void 0 : onScroll(currentIndex.current * idx);
118
+ return onScroll === null || onScroll === void 0 ? void 0 : onScroll(currentIndexRef.current * idx);
112
119
  }, [onScroll]);
113
120
  var handleScroll = react.useCallback(function () {
114
121
  setScrollActive(calculateActiveScroll());
115
122
  fireScrollEvent(columnCount);
123
+ // eslint-disable-next-line @eslint-react/exhaustive-deps
116
124
  }, [columnCount, onLoadMore]);
117
125
  react.useEffect(function () {
126
+ // eslint-disable-next-line @eslint-react/set-state-in-effect
118
127
  setScrollActive(calculateActiveScroll());
119
128
  }, [count, calculateActiveScroll]);
120
129
  react.useEffect(function () {
121
- var db = utilities.debounce(function () {
122
- var lastItem = virtualItems === null || virtualItems === void 0 ? void 0 : virtualItems.slice(-1).pop();
123
- if (lastItem && !loading && lastItem.index * columnCount + columnCount >= count - 1) onLoadMore === null || onLoadMore === void 0 || onLoadMore();
124
- });
125
- db();
126
- return function () {
127
- return db.cancel();
128
- };
129
- }, [onLoadMore, loading, itemList, virtualItems, count, columnCount]);
130
- react.useEffect(function () {
131
- var _virtualItems$2;
132
- var firstItem = (_virtualItems$2 = virtualItems[0]) === null || _virtualItems$2 === void 0 ? void 0 : _virtualItems$2.index;
133
- if (onLoadMore && firstItem !== undefined && items[firstItem * columnCount] === null) {
130
+ if (onLoadMore) {
131
+ var _virtualItems$2, _virtualItems$slice$p;
132
+ var firstItem = (_virtualItems$2 = virtualItems[0]) === null || _virtualItems$2 === void 0 ? void 0 : _virtualItems$2.index;
133
+ var lastItem = virtualItems === null || virtualItems === void 0 || (_virtualItems$slice$p = virtualItems.slice(-1).pop()) === null || _virtualItems$slice$p === void 0 ? void 0 : _virtualItems$slice$p.index;
134
+ var firstIndex = firstItem * columnCount;
135
+ var lastIndex = (lastItem !== null && lastItem !== void 0 ? lastItem : 0) * columnCount + columnCount;
136
+ var canLoadPrevPage = firstItem !== undefined && items[firstIndex] === null;
137
+ var canLoadNextPage = lastItem !== undefined && lastIndex >= count - 1 && count < total;
134
138
  var db = utilities.debounce(onLoadMore);
135
- db(firstItem * columnCount);
139
+ if (canLoadPrevPage) {
140
+ db(firstIndex);
141
+ } else if (!loading && canLoadNextPage) {
142
+ db(lastIndex + 1);
143
+ }
136
144
  return function () {
137
145
  return db.cancel();
138
146
  };
139
147
  }
140
- }, [onLoadMore, items, columnCount, virtualItems, count]);
148
+ // eslint-disable-next-line @eslint-react/exhaustive-deps
149
+ }, [onLoadMore, virtualItems]);
150
+ var isRenderedRef = react.useRef(false);
141
151
  react.useLayoutEffect(function () {
142
- setTimeout(function () {
143
- initialScroll && virtualizer.scrollToIndex(Math.floor(initialScroll / columnCount), {
144
- align: "start"
145
- });
146
- }, 100);
147
- }, [columnCount]);
152
+ if (!isRenderedRef.current && itemList.length > 0) {
153
+ isRenderedRef.current = true;
154
+ if (initialScroll) {
155
+ var tmr = setTimeout(function () {
156
+ virtualizer.scrollToIndex(Math.floor(initialScroll / columnCount), {
157
+ align: "start"
158
+ });
159
+ }, 200);
160
+ return function () {
161
+ clearTimeout(tmr);
162
+ };
163
+ }
164
+ }
165
+ // eslint-disable-next-line @eslint-react/exhaustive-deps
166
+ }, [columnCount, initialScroll, itemList]);
148
167
  react.useImperativeHandle(galleryRef, function () {
149
168
  return {
150
169
  scrollToItem: function scrollToItem(index) {
151
170
  virtualizer.scrollToIndex(Math.floor(index / columnCount), {
152
- align: "start"
171
+ align: "auto"
153
172
  });
154
173
  },
155
174
  hilight: function hilight(index) {
156
175
  var _scrollerRef$current2;
157
- (_scrollerRef$current2 = scrollerRef.current) === null || _scrollerRef$current2 === void 0 || (_scrollerRef$current2 = _scrollerRef$current2.querySelector(".hilight")) === null || _scrollerRef$current2 === void 0 || _scrollerRef$current2.classList.remove("hilight", "ring-1");
158
- virtualizer.scrollToIndex(Math.floor(index / columnCount), {
159
- align: "start"
176
+ var el = (_scrollerRef$current2 = scrollerRef.current) === null || _scrollerRef$current2 === void 0 ? void 0 : _scrollerRef$current2.querySelector("[data-selected='true']");
177
+ if (el) el.dataset.selected = "false";
178
+ virtualizer.scrollToIndex(Math.floor(index), {
179
+ align: "auto"
160
180
  });
161
181
  setTimeout(function () {
162
182
  var _scrollerRef$current3;
163
- (_scrollerRef$current3 = scrollerRef.current) === null || _scrollerRef$current3 === void 0 || (_scrollerRef$current3 = _scrollerRef$current3.querySelector("[data-index=\"".concat(index, "\"]"))) === null || _scrollerRef$current3 === void 0 || _scrollerRef$current3.classList.add("hilight", "ring-1");
183
+ var el = (_scrollerRef$current3 = scrollerRef.current) === null || _scrollerRef$current3 === void 0 ? void 0 : _scrollerRef$current3.querySelector("[data-index=\"".concat(index, "\"]"));
184
+ if (el) el.dataset.selected = "true";
164
185
  }, 100);
165
186
  },
166
187
  unhilight: function unhilight() {
167
188
  var _scrollerRef$current4;
168
- (_scrollerRef$current4 = scrollerRef.current) === null || _scrollerRef$current4 === void 0 || (_scrollerRef$current4 = _scrollerRef$current4.querySelector(".hilight")) === null || _scrollerRef$current4 === void 0 || _scrollerRef$current4.classList.remove("hilight", "ring-1");
189
+ var el = (_scrollerRef$current4 = scrollerRef.current) === null || _scrollerRef$current4 === void 0 ? void 0 : _scrollerRef$current4.querySelector("[data-selected='true']");
190
+ if (el) el.dataset.selected = "false";
169
191
  }
170
192
  };
171
193
  }, [virtualizer, columnCount]);
172
194
  return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({
173
195
  ref: scrollerRef,
174
196
  onScroll: handleScroll,
175
- className: classNames("area-content bg-base overflow-auto contain-strict")
197
+ className: utilities.cn("area-content bg-default overflow-auto")
176
198
  }, aria), {}, {
177
199
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
178
- className: classNames("inline-flex flex-nowrap gap-2 justify-center min-h-full min-w-full"),
200
+ className: utilities.cn("flex flex-nowrap justify-center gap-2 min-h-full"),
179
201
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
180
- className: classNames("box-content", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
202
+ className: utilities.cn("box-content", fullWidth && "flex-1", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
203
+ style: {
204
+ minWidth: minWidth,
205
+ maxWidth: maxWidth
206
+ },
181
207
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
182
208
  style: {
183
- height: virtualizer.getTotalSize()
209
+ height: virtualizer.getTotalSize() + extraSize
184
210
  },
185
211
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
186
212
  style: {
@@ -188,27 +214,32 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
188
214
  }
189
215
  }), virtualItems.map(function (_ref3) {
190
216
  var key = _ref3.key,
191
- index = _ref3.index,
192
- measureElement = _ref3.measureElement;
217
+ index = _ref3.index;
193
218
  return /*#__PURE__*/jsxRuntime.jsx("div", {
194
219
  className: "flex",
195
220
  "data-index": index,
196
- ref: measureElement,
221
+ ref: virtualizer.measureElement,
197
222
  children: columnMap.map(function (col) {
223
+ var _itemList, _itemList2;
198
224
  return /*#__PURE__*/jsxRuntime.jsx("div", {
199
225
  "data-index": index * columnCount + col,
200
- className: classNames("grid rounded-capped"),
201
- children: itemList[index * columnCount + col] && children(itemList[index * columnCount + col])
226
+ className: utilities.cn("grid rounded-capped"),
227
+ style: {
228
+ minWidth: width,
229
+ minHeight: height
230
+ },
231
+ children: (_itemList = itemList[index * columnCount + col]) !== null && _itemList !== void 0 && _itemList.item ? children(itemList[index * columnCount + col]) : ((_itemList2 = itemList[index * columnCount + col]) === null || _itemList2 === void 0 ? void 0 : _itemList2.item) === null && /*#__PURE__*/jsxRuntime.jsx(core.Skeleton, {
232
+ className: "p-2"
233
+ })
202
234
  }, "".concat(key, ":").concat(col));
203
235
  })
204
236
  }, key);
205
- }), onLoadMore && /*#__PURE__*/jsxRuntime.jsx("div", {
206
- className: "h-16",
207
- children: loading && /*#__PURE__*/jsxRuntime.jsx(core.Skeleton, {})
237
+ }), loading && /*#__PURE__*/jsxRuntime.jsx("div", {
238
+ children: /*#__PURE__*/jsxRuntime.jsx(core.Skeleton, {})
208
239
  })]
209
240
  })
210
241
  }), !hideScroller && /*#__PURE__*/jsxRuntime.jsx("div", {
211
- className: classNames("self-end sticky bottom-2"),
242
+ className: utilities.cn("self-end sticky bottom-2"),
212
243
  children: /*#__PURE__*/jsxRuntime.jsx(Scroller.Scroller, {
213
244
  vertical: true,
214
245
  scrollActive: scrollActive,
@@ -229,8 +260,35 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
229
260
  })
230
261
  }));
231
262
  };
232
- _VirtualGallery.displayName = "VirtualGallery";
233
263
  var GenericMemo = react.memo;
234
- var VirtualGallery = GenericMemo(_VirtualGallery);
264
+
265
+ /**
266
+ * VirtualGallery component provides a virtualized gallery view for displaying a large list of items efficiently.
267
+ * It supports features like fixed columns, loading states, and customizable item rendering.
268
+ * The component uses virtualization to render only the visible items, improving performance for large datasets.
269
+ * It also provides a scroller for easy navigation through the items.
270
+ *
271
+ * @example
272
+ * ```jsx
273
+ * <VirtualGallery
274
+ * items={items}
275
+ * columns={3}
276
+ * defaultHeight={100}
277
+ * defaultWidth={100}
278
+ * fullWidth={true}
279
+ * onLoadMore={(lastIndex) => console.log("Load more items from index:", lastIndex)}
280
+ * onScroll={(top) => console.log("Scrolled to top:", top)}
281
+ * >
282
+ * {({ item, index, isLast }) => (
283
+ * <div className="gallery-item" key={item.id}>
284
+ * <img src={item.image} alt={item.label} />
285
+ * <p>{item.label}</p>
286
+ * </div>
287
+ * )}
288
+ * </VirtualGallery>
289
+ * ```
290
+ * @see {@link https://tanstack.com/docs/react-virtual/latest/overview}
291
+ */
292
+ var VirtualGallery = GenericMemo(VirtualGalleryComponent);
235
293
 
236
294
  exports.VirtualGallery = VirtualGallery;
@@ -6,23 +6,26 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
6
6
  var core = require('@react-fabric/core');
7
7
  var utilities = require('@react-fabric/utilities');
8
8
  var reactVirtual = require('@tanstack/react-virtual');
9
- var classNames = require('classnames');
10
- var memoizeOne = require('memoize-one');
9
+ var memoize = require('memoize-one');
11
10
  var react = require('react');
12
11
  var Scroller = require('./Scroller.js');
13
12
  var jsxRuntime = require('react/jsx-runtime');
14
13
 
15
- var _excluded = ["items", "children", "fullWidth", "padding", "orientation", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "listRef"];
14
+ var _excluded = ["items", "total", "children", "fullWidth", "maxWidth", "minWidth", "padding", "orientation", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "listRef"];
16
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
- var createItemList = memoizeOne(function (items) {
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
+ var createItemList = memoize(function (items) {
19
18
  return items;
20
19
  });
21
- var _VirtualList = function _VirtualList(_ref) {
20
+ var VirtualListComponent = function VirtualListComponent(_ref) {
22
21
  var _virtualItems$3, _virtualItems$4;
23
22
  var items = _ref.items,
23
+ _ref$total = _ref.total,
24
+ total = _ref$total === void 0 ? 0 : _ref$total,
24
25
  children = _ref.children,
25
26
  fullWidth = _ref.fullWidth,
27
+ maxWidth = _ref.maxWidth,
28
+ minWidth = _ref.minWidth,
26
29
  _ref$padding = _ref.padding,
27
30
  padding = _ref$padding === void 0 ? "md" : _ref$padding,
28
31
  _ref$orientation = _ref.orientation,
@@ -40,18 +43,19 @@ var _VirtualList = function _VirtualList(_ref) {
40
43
  aria = _objectWithoutProperties(_ref, _excluded);
41
44
  var count = react.useDeferredValue(items.length);
42
45
  var extraSize = react.useMemo(function () {
43
- return onLoadMore ? 64 : 0;
46
+ return onLoadMore ? 8 : 0;
44
47
  }, [onLoadMore]);
45
- var itemList = createItemList(items.map(function (item, idx) {
48
+ var itemList = createItemList(items.map(function (item, index) {
46
49
  return {
47
- index: idx,
48
- data: item,
49
- isLast: idx + 1 === items.length
50
+ index: index,
51
+ item: item,
52
+ isLast: index + 1 === items.length
50
53
  };
51
54
  }));
52
55
  var scrollerRef = react.useRef(null);
53
56
  var virtualizer = reactVirtual.useVirtualizer({
54
57
  count: count,
58
+ overscan: 0,
55
59
  horizontal: orientation === "horizontal",
56
60
  getScrollElement: function getScrollElement() {
57
61
  return scrollerRef.current;
@@ -61,11 +65,11 @@ var _VirtualList = function _VirtualList(_ref) {
61
65
  }
62
66
  });
63
67
  var virtualItems = virtualizer.getVirtualItems();
64
- var currentIndex = react.useRef(0);
68
+ var currentIndexRef = react.useRef(0);
65
69
  react.useEffect(function () {
66
- var _virtualItems$1$index, _virtualItems$;
67
- currentIndex.current = (_virtualItems$1$index = (_virtualItems$ = virtualItems[1]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.index) !== null && _virtualItems$1$index !== void 0 ? _virtualItems$1$index : 0;
68
- if (scrollerRef.current && virtualItems[0] && scrollerRef.current.scrollTop < virtualItems[0].size) currentIndex.current = 0;
70
+ var _virtualItems$0$index, _virtualItems$;
71
+ currentIndexRef.current = (_virtualItems$0$index = (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.index) !== null && _virtualItems$0$index !== void 0 ? _virtualItems$0$index : 0;
72
+ if (scrollerRef.current && virtualItems[0] && scrollerRef.current.scrollTop < virtualItems[0].size) currentIndexRef.current = 0;
69
73
  }, [virtualItems]);
70
74
  var calculateActiveScroll = react.useCallback(function () {
71
75
  var _scrollerRef$current;
@@ -93,87 +97,105 @@ var _VirtualList = function _VirtualList(_ref) {
93
97
  if (Math.abs(scrollLeft) >= scrollWidth - offsetWidth - extraSize * 2) return 2;
94
98
  }
95
99
  return 3;
100
+ // eslint-disable-next-line @eslint-react/exhaustive-deps
96
101
  }, [orientation]);
97
102
  var _useState = react.useState(0),
98
103
  _useState2 = _slicedToArray(_useState, 2),
99
104
  scrollActive = _useState2[0],
100
105
  setScrollActive = _useState2[1];
101
106
  var fireScrollEvent = core.useDebounce(function () {
102
- return onScroll === null || onScroll === void 0 ? void 0 : onScroll(currentIndex.current);
107
+ return onScroll === null || onScroll === void 0 ? void 0 : onScroll(currentIndexRef.current);
103
108
  }, [onScroll]);
104
109
  var handleScroll = react.useCallback(function () {
105
110
  setScrollActive(calculateActiveScroll());
106
111
  fireScrollEvent();
112
+ // eslint-disable-next-line @eslint-react/exhaustive-deps
107
113
  }, [orientation, onLoadMore]);
108
114
  react.useEffect(function () {
115
+ // eslint-disable-next-line @eslint-react/set-state-in-effect
109
116
  setScrollActive(calculateActiveScroll());
110
117
  }, [itemList, calculateActiveScroll]);
111
118
  react.useEffect(function () {
112
- var db = utilities.debounce(function () {
113
- var lastItem = virtualItems === null || virtualItems === void 0 ? void 0 : virtualItems.slice(-1).pop();
114
- if (lastItem && !loading && lastItem.index === count - 1) onLoadMore === null || onLoadMore === void 0 || onLoadMore();
115
- });
116
- db();
117
- return function () {
118
- return db.cancel();
119
- };
120
- }, [onLoadMore, loading, itemList, virtualItems, count]);
121
- react.useEffect(function () {
122
- var _virtualItems$2;
123
- var firstItem = (_virtualItems$2 = virtualItems[0]) === null || _virtualItems$2 === void 0 ? void 0 : _virtualItems$2.index;
124
- if (onLoadMore && firstItem !== undefined && items[firstItem] === null) {
119
+ if (onLoadMore) {
120
+ var _virtualItems$2, _virtualItems$slice$p;
121
+ var firstItem = (_virtualItems$2 = virtualItems[0]) === null || _virtualItems$2 === void 0 ? void 0 : _virtualItems$2.index;
122
+ var lastItem = virtualItems === null || virtualItems === void 0 || (_virtualItems$slice$p = virtualItems.slice(-1).pop()) === null || _virtualItems$slice$p === void 0 ? void 0 : _virtualItems$slice$p.index;
123
+ var canLoadPrevPage = firstItem !== undefined && items[firstItem] === null;
124
+ var canLoadNextPage = lastItem !== undefined && lastItem === count - 1 && count < total;
125
125
  var db = utilities.debounce(onLoadMore);
126
- db(firstItem);
126
+ if (canLoadPrevPage) {
127
+ db(firstItem);
128
+ } else if (!loading && canLoadNextPage) {
129
+ db(lastItem + 1);
130
+ }
127
131
  return function () {
128
132
  return db.cancel();
129
133
  };
130
134
  }
131
- }, [onLoadMore, items, virtualItems, count]);
135
+ // eslint-disable-next-line @eslint-react/exhaustive-deps
136
+ }, [onLoadMore, virtualItems]);
137
+ var isRenderedRef = react.useRef(false);
132
138
  react.useLayoutEffect(function () {
133
- setTimeout(function () {
134
- initialScroll && virtualizer.scrollToIndex(initialScroll, {
135
- align: "start"
136
- });
137
- }, 100);
138
- }, []);
139
+ if (!isRenderedRef.current && itemList.length > 0) {
140
+ isRenderedRef.current = true;
141
+ if (initialScroll) {
142
+ var tmr = setTimeout(function () {
143
+ virtualizer.scrollToIndex(Math.floor(initialScroll), {
144
+ align: "start"
145
+ });
146
+ }, 200);
147
+ return function () {
148
+ clearTimeout(tmr);
149
+ };
150
+ }
151
+ }
152
+ // eslint-disable-next-line @eslint-react/exhaustive-deps
153
+ }, [itemList, initialScroll]);
139
154
  react.useImperativeHandle(listRef, function () {
140
155
  return {
141
156
  scrollToItem: function scrollToItem(index) {
142
157
  virtualizer.scrollToIndex(index, {
143
- align: "start"
158
+ align: "auto"
144
159
  });
145
160
  },
146
161
  hilight: function hilight(index) {
147
162
  var _scrollerRef$current2;
148
- (_scrollerRef$current2 = scrollerRef.current) === null || _scrollerRef$current2 === void 0 || (_scrollerRef$current2 = _scrollerRef$current2.querySelector(".hilight")) === null || _scrollerRef$current2 === void 0 || _scrollerRef$current2.classList.remove("hilight", "ring-1");
163
+ var el = (_scrollerRef$current2 = scrollerRef.current) === null || _scrollerRef$current2 === void 0 ? void 0 : _scrollerRef$current2.querySelector("[data-selected='true']");
164
+ if (el) el.dataset.selected = "false";
149
165
  virtualizer.scrollToIndex(Math.floor(index), {
150
- align: "start"
166
+ align: "auto"
151
167
  });
152
168
  setTimeout(function () {
153
169
  var _scrollerRef$current3;
154
- (_scrollerRef$current3 = scrollerRef.current) === null || _scrollerRef$current3 === void 0 || (_scrollerRef$current3 = _scrollerRef$current3.querySelector("[data-index=\"".concat(index, "\"]"))) === null || _scrollerRef$current3 === void 0 || _scrollerRef$current3.classList.add("hilight", "ring-1");
170
+ var el = (_scrollerRef$current3 = scrollerRef.current) === null || _scrollerRef$current3 === void 0 ? void 0 : _scrollerRef$current3.querySelector("[data-index=\"".concat(index, "\"]"));
171
+ if (el) el.dataset.selected = "true";
155
172
  }, 100);
156
173
  },
157
174
  unhilight: function unhilight() {
158
175
  var _scrollerRef$current4;
159
- (_scrollerRef$current4 = scrollerRef.current) === null || _scrollerRef$current4 === void 0 || (_scrollerRef$current4 = _scrollerRef$current4.querySelector(".hilight")) === null || _scrollerRef$current4 === void 0 || _scrollerRef$current4.classList.remove("hilight", "ring-1");
176
+ var el = (_scrollerRef$current4 = scrollerRef.current) === null || _scrollerRef$current4 === void 0 ? void 0 : _scrollerRef$current4.querySelector("[data-selected='true']");
177
+ if (el) el.dataset.selected = "false";
160
178
  }
161
179
  };
162
180
  }, [virtualizer]);
163
181
  return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({
164
182
  ref: scrollerRef,
165
183
  onScroll: handleScroll,
166
- className: classNames("area-content bg-base overflow-auto contain-strict")
184
+ className: utilities.cn("area-content bg-default overflow-auto")
167
185
  }, aria), {}, {
168
186
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
169
- className: classNames("inline-flex flex-nowrap gap-2 justify-center min-h-full min-w-full", orientation === "horizontal" && "flex-col"),
187
+ className: utilities.cn("flex flex-nowrap gap-2 justify-center min-h-full min-w-full", orientation === "horizontal" && "flex-col"),
170
188
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
171
- className: classNames("box-content inline-flex flex-nowrap", orientation === "vertical" && "flex-col", orientation === "horizontal" && "flex-row", fullWidth && "flex-1", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
189
+ className: utilities.cn("box-content inline-flex flex-nowrap", orientation === "vertical" && "flex-col", orientation === "horizontal" && "flex-row", fullWidth && "flex-1", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
190
+ style: {
191
+ minWidth: minWidth,
192
+ maxWidth: maxWidth
193
+ },
172
194
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
173
195
  style: orientation === "vertical" ? {
174
- height: virtualizer.getTotalSize()
196
+ height: virtualizer.getTotalSize() + extraSize
175
197
  } : {
176
- width: virtualizer.getTotalSize()
198
+ width: virtualizer.getTotalSize() + extraSize
177
199
  },
178
200
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
179
201
  style: orientation === "vertical" ? {
@@ -183,21 +205,28 @@ var _VirtualList = function _VirtualList(_ref) {
183
205
  display: "inline-block"
184
206
  }
185
207
  }), virtualItems.map(function (_ref3) {
208
+ var _itemList$index, _itemList$index2;
186
209
  var key = _ref3.key,
187
210
  index = _ref3.index;
188
211
  return /*#__PURE__*/jsxRuntime.jsx("div", {
189
212
  "data-index": index,
190
213
  ref: virtualizer.measureElement,
191
- className: classNames("rounded-capped", orientation === "horizontal" ? "inline-grid" : "grid"),
192
- children: children(itemList[index])
214
+ className: utilities.cn("rounded-capped", orientation === "horizontal" ? "inline-grid" : "grid"),
215
+ style: {
216
+ minWidth: width,
217
+ minHeight: height
218
+ },
219
+ children: (_itemList$index = itemList[index]) !== null && _itemList$index !== void 0 && _itemList$index.item ? children(itemList[index]) : ((_itemList$index2 = itemList[index]) === null || _itemList$index2 === void 0 ? void 0 : _itemList$index2.item) === null && /*#__PURE__*/jsxRuntime.jsx(core.Skeleton, {
220
+ className: "p-2"
221
+ })
193
222
  }, key);
194
223
  })]
195
- }), onLoadMore && /*#__PURE__*/jsxRuntime.jsx("div", {
196
- className: orientation === "horizontal" ? "min-w-16" : "h-16",
197
- children: loading && /*#__PURE__*/jsxRuntime.jsx(core.Skeleton, {})
224
+ }), loading && /*#__PURE__*/jsxRuntime.jsx("div", {
225
+ className: orientation === "horizontal" ? "min-w-16" : "",
226
+ children: /*#__PURE__*/jsxRuntime.jsx(core.Skeleton, {})
198
227
  })]
199
228
  }), !hideScroller && /*#__PURE__*/jsxRuntime.jsx("div", {
200
- className: classNames(orientation === "vertical" && "self-end sticky bottom-2", orientation === "horizontal" && "self-end sticky end-2"),
229
+ className: utilities.cn(orientation === "vertical" && "self-end sticky bottom-2", orientation === "horizontal" && "self-end sticky inset-e-2"),
201
230
  children: /*#__PURE__*/jsxRuntime.jsx(Scroller.Scroller, {
202
231
  vertical: orientation === "vertical",
203
232
  scrollActive: scrollActive,
@@ -218,8 +247,40 @@ var _VirtualList = function _VirtualList(_ref) {
218
247
  })
219
248
  }));
220
249
  };
221
- _VirtualList.displayName = "VirtualList";
222
250
  var GenericMemo = react.memo;
223
- var VirtualList = GenericMemo(_VirtualList);
251
+
252
+ /**
253
+ * VirtualList component for rendering large lists efficiently using virtualization.
254
+ * It supports horizontal and vertical orientations, custom item heights and widths,
255
+ * and provides a scroller for navigating through the list.
256
+ * It also supports loading more items on scroll and provides a way to hilight items.
257
+ * It can be used with a ref to control scrolling and hilighting of items.
258
+ *
259
+ * @example
260
+ * ```jsx
261
+ * <VirtualList
262
+ * items={items}
263
+ * children={({ item, index, isLast }) => (
264
+ * <div key={index} className="item">
265
+ * {item.label}
266
+ * </div>
267
+ * )}
268
+ * fullWidth={true}
269
+ * orientation="vertical"
270
+ * defaultHeight={50}
271
+ * onLoadMore={(lastIndex) => console.log("Load more items from index:", lastIndex)}
272
+ * onScroll={(top) => console.log("Scrolled to top:", top)}
273
+ * listRef={virtualListRef}
274
+ * >
275
+ * {({ item, index, isLast }) => (
276
+ * <div className="gallery-item" key={item.id}>
277
+ * <img src={item.image} alt={item.label} />
278
+ * <p>{item.label}</p>
279
+ * </div>
280
+ * )}
281
+ * </VirtualList>
282
+ * ```
283
+ */
284
+ var VirtualList = GenericMemo(VirtualListComponent);
224
285
 
225
286
  exports.VirtualList = VirtualList;
@@ -39,35 +39,43 @@ var Scroller = function Scroller(_ref) {
39
39
  variant: "link",
40
40
  className: "outline",
41
41
  children: [/*#__PURE__*/jsxRuntime.jsx(core.Button, {
42
- rtlFlip: true,
43
42
  size: "sm",
44
43
  variant: "link",
45
44
  "aria-label": "scroll to top",
46
- icon: vertical ? core.CoreIcons.chevronsUp : core.CoreIcons.chevronsLeft,
45
+ icon: {
46
+ icon: vertical ? "icon-[mdi--chevron-double-up]" : "icon-[mdi--chevron-double-left]",
47
+ rtlFlip: true
48
+ },
47
49
  disabled: (scrollActive & 2) === 0,
48
50
  onClick: onStart
49
51
  }), /*#__PURE__*/jsxRuntime.jsx(core.Button, {
50
- rtlFlip: true,
51
52
  size: "sm",
52
53
  variant: "link",
53
54
  "aria-label": "scroll up",
54
- icon: vertical ? core.CoreIcons.chevronUp : core.CoreIcons.chevronLeft,
55
+ icon: {
56
+ icon: vertical ? "icon-[mdi--chevron-up]" : "icon-[mdi--chevron-left]",
57
+ rtlFlip: true
58
+ },
55
59
  disabled: (scrollActive & 2) === 0,
56
60
  onClick: onPrevious
57
61
  }), /*#__PURE__*/jsxRuntime.jsx(core.Button, {
58
- rtlFlip: true,
59
62
  size: "sm",
60
63
  variant: "link",
61
64
  "aria-label": "scroll down",
62
- icon: vertical ? core.CoreIcons.chevronDown : core.CoreIcons.chevronRight,
65
+ icon: {
66
+ icon: vertical ? "icon-[mdi--chevron-down]" : "icon-[mdi--chevron-right]",
67
+ rtlFlip: true
68
+ },
63
69
  disabled: scrollActive % 2 === 0,
64
70
  onClick: onNext
65
71
  }), /*#__PURE__*/jsxRuntime.jsx(core.Button, {
66
- rtlFlip: true,
67
72
  size: "sm",
68
73
  variant: "link",
69
74
  "aria-label": "scroll to bottom",
70
- icon: vertical ? core.CoreIcons.chevronsDown : core.CoreIcons.chevronsRight,
75
+ icon: {
76
+ icon: vertical ? "icon-[mdi--chevron-double-down]" : "icon-[mdi--chevron-double-right]",
77
+ rtlFlip: true
78
+ },
71
79
  disabled: scrollActive % 2 === 0,
72
80
  onClick: onEnd
73
81
  })]