@protobase/ui 0.55.0 → 0.55.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/displays/virtual-cards.js +1 -1
- package/dist/data-grid/use-virtual-rows.js +5 -2
- package/dist/package.js +1 -1
- package/dist/shell/assets/{app-tBBnYXLP.js → app-DxuzNqzR.js} +5 -5
- package/dist/shell/assets/{index-DvCa5s54.js → index-DprdVbQM.js} +2 -2
- package/dist/shell/assets/{records-map-BWSeQRmm.js → records-map-DhDIjikh.js} +2 -2
- package/dist/shell/assets/{shared-protobase-ui-Br4XDldp.js → shared-protobase-ui-uXIvgyTZ.js} +2 -2
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/app-DxuzNqzR.js.map +1 -0
- package/dist/shell-source-maps/assets/{index-DvCa5s54.js.map → index-DprdVbQM.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-BWSeQRmm.js.map → records-map-DhDIjikh.js.map} +1 -1
- package/dist/shell-source-maps/assets/{shared-protobase-ui-Br4XDldp.js.map → shared-protobase-ui-uXIvgyTZ.js.map} +1 -1
- package/package.json +4 -4
- package/dist/shell-source-maps/assets/app-tBBnYXLP.js.map +0 -1
|
@@ -46,7 +46,7 @@ const VirtualCards = ({ source, label, initialIndex, onScrollIndex, minHeight, c
|
|
|
46
46
|
if (changed) scroll.scrollTo(scroll.top);
|
|
47
47
|
anchor.current = {
|
|
48
48
|
layout,
|
|
49
|
-
top: scroll.top
|
|
49
|
+
top: scroll.started() ? scroll.top : 0
|
|
50
50
|
};
|
|
51
51
|
});
|
|
52
52
|
const range = recordRange(scroll.first, scroll.last, columns, total);
|
|
@@ -18,7 +18,8 @@ const viewRows = (view, total, rowHeight) => {
|
|
|
18
18
|
* scrolling ancestor, or the page. Only the rows in view, and `overscan` more on each side, are drawn: `ref` goes on the
|
|
19
19
|
* list's element, `geometry.contentHeight` tall, and each drawn row sits at `offset` from its top. Nothing listens for
|
|
20
20
|
* wheel or touch: the list follows the scroll position, and draws again only when other rows come into view.
|
|
21
|
-
* `first` and `last` are the indexes of the drawn rows, overscan included
|
|
21
|
+
* `first` and `last` are the indexes of the drawn rows, overscan included; `started` says whether the list has started
|
|
22
|
+
* at `initialIndex`, read after the list's layout effects.
|
|
22
23
|
*/
|
|
23
24
|
const useVirtualRows = ({ total, rowHeight, initialIndex, inset = 0, settle, ready = true, onScroll }) => {
|
|
24
25
|
const ref = useRef(null);
|
|
@@ -117,6 +118,7 @@ const useVirtualRows = ({ total, rowHeight, initialIndex, inset = 0, settle, rea
|
|
|
117
118
|
scroller.current.scrollTop += scrollFromTop(geometry, top) - current.position;
|
|
118
119
|
measure();
|
|
119
120
|
}, [read, measure]);
|
|
121
|
+
const started = useCallback(() => !start.current.pending, []);
|
|
120
122
|
const drawn = viewRows(view, total, rowHeight);
|
|
121
123
|
const top = settle ? settle(drawn.top) : drawn.top;
|
|
122
124
|
const { first, last } = settle ? rowsInView(total, top, rowHeight, view.height, overscan) : drawn;
|
|
@@ -132,7 +134,8 @@ const useVirtualRows = ({ total, rowHeight, initialIndex, inset = 0, settle, rea
|
|
|
132
134
|
rows,
|
|
133
135
|
first,
|
|
134
136
|
last,
|
|
135
|
-
scrollTo
|
|
137
|
+
scrollTo,
|
|
138
|
+
started
|
|
136
139
|
};
|
|
137
140
|
};
|
|
138
141
|
//#endregion
|
package/dist/package.js
CHANGED