@northgraindata/dsui 0.3.2 → 0.4.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/bin/dsui.mjs +1 -1
- package/dist/server.mjs +196 -171
- package/package.json +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/package.json +2 -2
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs +7 -4
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js +7 -4
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/package.json +1 -1
- package/sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/src/index.ts +20 -5
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/react-virtual/package.json +2 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs +7 -4
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js +7 -4
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/package.json +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@northgraindata/dsui-adapter-sdk/node_modules/@tanstack/virtual-core/src/index.ts +20 -5
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/react-virtual/package.json +2 -2
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs +7 -4
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js +7 -4
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/dist/esm/index.js.map +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/package.json +1 -1
- package/sdk/node_modules/@northgraindata/dsui-plugin-sdk/node_modules/@tanstack/virtual-core/src/index.ts +20 -5
- package/web/assets/index-BBd7EEtd.js +98 -0
- package/web/assets/index-C16grSph.css +1 -0
- package/web/index.html +2 -2
- package/web/assets/index-BfI6FAmB.css +0 -1
- package/web/assets/index-Bn86bxkF.js +0 -93
|
@@ -300,16 +300,29 @@ export const measureElement = <TItemElement extends Element>(
|
|
|
300
300
|
]
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
const scrollWithAdjustments =
|
|
303
|
+
const scrollWithAdjustments = <
|
|
304
|
+
TScrollElement extends Element | Window,
|
|
305
|
+
TItemElement extends Element,
|
|
306
|
+
>(
|
|
304
307
|
offset: number,
|
|
305
308
|
{
|
|
306
309
|
adjustments = 0,
|
|
307
310
|
behavior,
|
|
308
311
|
}: { adjustments?: number; behavior?: ScrollBehavior },
|
|
309
|
-
instance: Virtualizer<
|
|
312
|
+
instance: Virtualizer<TScrollElement, TItemElement>,
|
|
310
313
|
) => {
|
|
311
|
-
instance
|
|
312
|
-
|
|
314
|
+
const { scrollElement, options } = instance
|
|
315
|
+
const adjustedOffset = offset + adjustments
|
|
316
|
+
const isRtlElement =
|
|
317
|
+
options.horizontal &&
|
|
318
|
+
options.isRtl &&
|
|
319
|
+
scrollElement !== null &&
|
|
320
|
+
'ownerDocument' in scrollElement
|
|
321
|
+
|
|
322
|
+
scrollElement?.scrollTo?.({
|
|
323
|
+
[options.horizontal ? 'left' : 'top']: isRtlElement
|
|
324
|
+
? -adjustedOffset
|
|
325
|
+
: adjustedOffset,
|
|
313
326
|
behavior,
|
|
314
327
|
})
|
|
315
328
|
}
|
|
@@ -2376,7 +2389,9 @@ export class Virtualizer<
|
|
|
2376
2389
|
const size = this.getSize()
|
|
2377
2390
|
const scrollOffset = this.getScrollOffset()
|
|
2378
2391
|
|
|
2379
|
-
|
|
2392
|
+
// Not `measurementsCache`: that field is only rebuilt by getMeasurements,
|
|
2393
|
+
// so it lags a size change until the next render reads the items.
|
|
2394
|
+
const item = this.getMeasurements()[index]
|
|
2380
2395
|
if (!item) return
|
|
2381
2396
|
|
|
2382
2397
|
if (align === 'auto') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-virtual",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.26",
|
|
4
4
|
"description": "Headless UI for virtualizing scrollable elements in React",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"src"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@tanstack/virtual-core": "3.19.
|
|
48
|
+
"@tanstack/virtual-core": "3.19.11"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@testing-library/react": "^16.3.0",
|
|
@@ -158,9 +158,12 @@ const scrollWithAdjustments = (offset, {
|
|
|
158
158
|
adjustments = 0,
|
|
159
159
|
behavior
|
|
160
160
|
}, instance) => {
|
|
161
|
-
var _a
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
var _a;
|
|
162
|
+
const { scrollElement, options } = instance;
|
|
163
|
+
const adjustedOffset = offset + adjustments;
|
|
164
|
+
const isRtlElement = options.horizontal && options.isRtl && scrollElement !== null && "ownerDocument" in scrollElement;
|
|
165
|
+
(_a = scrollElement == null ? void 0 : scrollElement.scrollTo) == null ? void 0 : _a.call(scrollElement, {
|
|
166
|
+
[options.horizontal ? "left" : "top"]: isRtlElement ? -adjustedOffset : adjustedOffset,
|
|
164
167
|
behavior
|
|
165
168
|
});
|
|
166
169
|
};
|
|
@@ -1255,7 +1258,7 @@ class Virtualizer {
|
|
|
1255
1258
|
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1256
1259
|
const size = this.getSize();
|
|
1257
1260
|
const scrollOffset = this.getScrollOffset();
|
|
1258
|
-
const item = this.
|
|
1261
|
+
const item = this.getMeasurements()[index];
|
|
1259
1262
|
if (!item) return;
|
|
1260
1263
|
if (align === "auto") {
|
|
1261
1264
|
if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {
|