@aiquants/virtualscroll 3.6.0 → 3.7.0
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/CHANGELOG.md +73 -0
- package/README.md +84 -11
- package/dist/ScrollBar.d.cts +17 -1
- package/dist/ScrollBar.d.ts +17 -1
- package/dist/ScrollBar.d.ts.map +1 -1
- package/dist/ScrollPane.d.cts +15 -0
- package/dist/ScrollPane.d.ts +15 -0
- package/dist/ScrollPane.d.ts.map +1 -1
- package/dist/VirtualGrid.d.cts +17 -1
- package/dist/VirtualGrid.d.ts +17 -1
- package/dist/VirtualGrid.d.ts.map +1 -1
- package/dist/VirtualScroll.d.cts +24 -5
- package/dist/VirtualScroll.d.ts +24 -5
- package/dist/VirtualScroll.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2046 -1970
- package/dist/labels.d.cts +125 -0
- package/dist/labels.d.ts +126 -0
- package/dist/labels.d.ts.map +1 -0
- package/dist/useGridTapScroll.d.cts +1 -1
- package/dist/useGridTapScroll.d.ts +1 -1
- package/dist/useGridTapScroll.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ScrollBar.tsx +21 -4
- package/src/ScrollPane.tsx +19 -0
- package/src/VirtualGrid.tsx +50 -2
- package/src/VirtualScroll.tsx +39 -12
- package/src/index.ts +1 -0
- package/src/labels.ts +236 -0
- package/src/useGridTapScroll.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,79 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@aiquants/virtualscroll` are documented here.
|
|
4
4
|
|
|
5
|
+
## 3.7.0 (2026-09-24)
|
|
6
|
+
|
|
7
|
+
- **新機能 — 内蔵 UI 文言の多言語化 (`locale` / `labels`)**: コンポーネント自身が描画する 7 文言
|
|
8
|
+
(ScrollBar 矢印の aria-label 4 種・VirtualScroll の端スクロールピル 2 種・空状態 1 種) を
|
|
9
|
+
カタログ化し、英語 (`"en"`、既定) と日本語 (`"ja"`) を内蔵した。`ScrollBar` / `ScrollPane` /
|
|
10
|
+
`VirtualScroll` / `VirtualGrid` の 4 コンポーネントに同形の `locale?: VirtualScrollLocale` と
|
|
11
|
+
`labels?: VirtualScrollLabelOverrides` (選択ロケールのカタログへ重ねるキー単位の上書き) を追加。
|
|
12
|
+
転送は `ScrollPane` → 自身の `ScrollBar`、`VirtualScroll` → `ScrollPane`、`VirtualGrid` →
|
|
13
|
+
内包 `VirtualScroll` と横 `ScrollBar` の両方 (横バーの矢印と 0 行・全行固定・退化帯の空状態まで
|
|
14
|
+
届く)。`VirtualScroll` の `locale` / `labels` は `scrollBarOptions` の中ではなくトップレベル
|
|
15
|
+
(ピルと空状態はスクロールバーの部品ではないため)。
|
|
16
|
+
- **日本語カタログ**: 上へスクロール / 下へスクロール / 左へスクロール / 右へスクロール /
|
|
17
|
+
先頭へ / 末尾へ / 項目がありません。
|
|
18
|
+
- **バレル export 追加 (値 5 + 型 3)**: 新モジュール `src/labels.ts` (React 非依存の純粋モジュール)
|
|
19
|
+
から `VIRTUAL_SCROLL_LOCALES` / `VIRTUAL_SCROLL_LABEL_KEYS` / `VIRTUAL_SCROLL_LABEL_CATALOGS`
|
|
20
|
+
(外側・各カタログとも凍結) / `resolveVirtualScrollLocale` / `resolveVirtualScrollLabels` と、型
|
|
21
|
+
`VirtualScrollLocale` / `VirtualScrollLabels` / `VirtualScrollLabelOverrides`。公開 API の削除は無い。
|
|
22
|
+
- **RangeError 契約 (fail-fast・言語ネゴシエーションなし)**: 非対応の `locale` (`null` / `""` /
|
|
23
|
+
`"EN"` / `"ja-JP"` / `"fr"` / 数値など) は描画時に `RangeError`
|
|
24
|
+
(`[virtualscroll] locale must be one of "en", "ja"; got <値の説明>`)。`labels` は非オブジェクト・
|
|
25
|
+
素のオブジェクトでない値・未知キー・空白のみ / 非文字列の値を `RangeError` で拒否し、`undefined`
|
|
26
|
+
値はカタログ値を維持する。
|
|
27
|
+
- **`labels` は素のオブジェクトのみ**: プロトタイプが `Object.prototype` か `null` でなければ
|
|
28
|
+
`RangeError` (`[virtualscroll] labels must be a plain object (prototype Object.prototype or null);
|
|
29
|
+
got an array` / `got an object with a non-plain prototype`)。配列 (`[]` を含む)・クラスインスタンス・
|
|
30
|
+
`Date`・`Object.create(proto)` の継承オブジェクトを拒否する (既知キー検査は自身のキーしか見ないため、
|
|
31
|
+
継承側の綴り誤りが無言で無視されるのを防ぐ)。畳み込みは検査済みの自身のプロパティだけを読み、
|
|
32
|
+
`Object.prototype` 汚染で継承されたラベルキーは適用しない。
|
|
33
|
+
- **エラーメッセージの値の説明は例外を投げない**: 拒否した値は文字列なら JSON 表記 (`got "ja-JP"`)、
|
|
34
|
+
`null` なら `got null`、それ以外は `typeof` のタグだけ (`got number` / `got bigint` / `got symbol` /
|
|
35
|
+
`got object` / `got function`) で示し、値そのものを文字列化しない。BigInt・Symbol・null プロトタイプの
|
|
36
|
+
入力でも `TypeError` にならず、文書どおりの `RangeError` が届く。
|
|
37
|
+
`navigator.language` からの対応付けはホストの責務。`lang` 属性は付与しない (文書言語はホスト所有)。
|
|
38
|
+
- **既定 en はバイト恒等**: en の値は従来の英語文言そのまま ("Scroll up" / "Scroll down" /
|
|
39
|
+
"Scroll left" / "Scroll right" / "Top" / "Bottom" / "No items") で、`locale` 未指定の DOM は
|
|
40
|
+
`locale="en"` 明示時と innerHTML 完全一致 (テストで固定)。上書きなしの解決はカタログ自身を同一参照で返す。
|
|
41
|
+
- **ライブリージョンは対象外のまま**: `liveRegion.format` / `buildMessage` の文面と言語は引き続き
|
|
42
|
+
消費側の所有。docstring と README の「内蔵文字列なし」は「内蔵カタログはクローム 7 文言のみ、
|
|
43
|
+
ライブリージョンの文言は消費側」へ狭めた。
|
|
44
|
+
- **内部整理**: `ScrollBar` の `OrientationConfig.arrowLabels` を撤去し、矢印ラベルは解決済みラベルから
|
|
45
|
+
向き (`horizontal`) で選ぶ。
|
|
46
|
+
- **テスト**: 単体 `labels.spec.ts` 49 件 (新規)・`localeForwarding.spec.tsx` 4 件 (新規)・
|
|
47
|
+
`ScrollBar.spec.tsx` +6・`VirtualScroll.spec.ts` +5・`VirtualGrid.spec.tsx` +4、統合
|
|
48
|
+
`scrollbar-arrow-buttons.spec.tsx` +1 (ja の下矢印でスクロールできること)、E2E `i18n.spec.ts`
|
|
49
|
+
7 件 (新規。ブラウザ言語 `ja-JP` でも `?lang` なしは en のままであることを含む)。vitest 888 / 888
|
|
50
|
+
(48 ファイル、`pnpm test` 1 回の実測)、E2E 77 件 (`test(` の字面計数)。
|
|
51
|
+
- **デモの多言語化**: デモ全ルートが URL クエリ `?lang=en|ja` に従う (未指定 = en、SSR の root
|
|
52
|
+
loader で解決し `<html lang>` へ反映、非対応値は 400)。`/`・`/advanced`・`/a11y`・
|
|
53
|
+
`/overscroll`・`/transition`・`/horizontal`・`/grid-tap` の既存コントロール行に言語セレクト
|
|
54
|
+
(`data-testid="demo-locale-select"`) を配置し、切替は再読込なしの同一ルート遷移。全ライブラリ
|
|
55
|
+
コンポーネントへ `locale` を渡す。サンプルデータ (`Item N` / `Row N` / `Col N` 等) は翻訳しない。
|
|
56
|
+
E2E `horizontal-scroll.spec.ts` のチェックボックス特定を日本語名から
|
|
57
|
+
`data-testid="wheel-horizontal-toggle"` へ変更。
|
|
58
|
+
|
|
59
|
+
## 3.6.1 (2026-09-22)
|
|
60
|
+
|
|
61
|
+
- **バグ修正 — 統合タップサークルの y / xy ドラッグが揺れ戻る (ヨーヨー) 問題**: 3.6.0 出荷版は
|
|
62
|
+
ドライバの y 基準読み (`getVy`) を `vyRef` 通知鏡像へ配線していた。鏡像にはスロットル済み
|
|
63
|
+
`onScroll` 中継 (`handleVerticalScroll`) という第 2 の書き手が居て、駆動中に最大
|
|
64
|
+
`callbackThrottleMs` 窓ぶん巻き戻すため、残差フィードバック `residual -= applied − before` が
|
|
65
|
+
`actualDelta` を staleness ギャップぶん過大計上 → 軸残差が負へ落ち、ドライバ自身が**実後退**の
|
|
66
|
+
`scrollBy` を発行していた (Chromium 実測: 純 y 保持 1.2 秒で後退 36 回・最大 307 px・正味移動が
|
|
67
|
+
単調時の 56%。x は `hxRef` 単一書き手のため無事)。修正は**軸別位置権威の x 側への整列**:
|
|
68
|
+
`getVy` を埋め込みハンドル `getScrollPosition()` (= `applyVy` の `scrollBy` が updater を解決する
|
|
69
|
+
ペイン内部 ref と同一権威) の読みへ変更 — 「各軸の `getPos` は適用シームと同一権威を読む」を
|
|
70
|
+
ドライバ契約として登記 (グリッド仕様 §3.6 ADR-31 行 / MV-XY38-39)。`applyVy`・x 経路・
|
|
71
|
+
`computeTapScrollVelocity`・フックのループ意味論はバイト不変。
|
|
72
|
+
- **デモ / ゲート**: エンジンデモに `/grid-tap` ルートを新設 (VirtualGrid + 統合サークル)。
|
|
73
|
+
実ブラウザ E2E `grid-tap-scroll.spec.ts` (ページ内 rAF サンプラーで純 x / 純 y 1 秒保持の
|
|
74
|
+
フレーム単調性 + 前進下限) と、決定的 rAF ハーネスの配線単体ゲート
|
|
75
|
+
`gridTapAxisAuthority.spec.tsx` 3 件 (純 y / 斜め xy / 純 x の毎フレーム一様前進 —
|
|
76
|
+
鏡像退行変異 MV-XY38/39 で red 実証) を追加。単体 819 / 819 (46 ファイル)。
|
|
77
|
+
|
|
5
78
|
## 3.6.0 (2026-09-18)
|
|
6
79
|
|
|
7
80
|
- **挙動置換 — `VirtualGrid` のタップサークルが 2 つ → 1 つの統合 2 軸サークルへ**: 縦バーの
|
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ High-performance virtual scrolling component for React with variable item height
|
|
|
14
14
|
- 🎨 **Customizable**: Flexible styling and theming options
|
|
15
15
|
- 🌀 **Ultrafast Tap Scroll**: Adaptive tap scroll circle that scales speed up to 120× for massive datasets
|
|
16
16
|
- ♿ **Accessibility opt-ins**: Escape row-return (`enableEscapeRowReturn`) and a screen-reader live region (`liveRegion`) announcing the visible range with your own wording
|
|
17
|
+
- 🌐 **Localization**: The built-in chrome strings (scrollbar arrow labels, scroll-to-edge pills, empty state) ship in English (default) and Japanese via `locale`, with per-key `labels` overrides. See [Localization](#localization)
|
|
17
18
|
- 🔧 **TypeScript**: Full TypeScript support with comprehensive type definitions
|
|
18
19
|
|
|
19
20
|
## Installation
|
|
@@ -40,8 +41,9 @@ pnpm add @aiquants/virtualscroll
|
|
|
40
41
|
> `@layer base` but leaves it empty — so every `.aqvs-*` rule cancels the UA defaults **its own box model**
|
|
41
42
|
> depends on: `box-sizing`, `border-style`, the UA button bevel and padding, and the tap highlight (2.2.0).
|
|
42
43
|
> The components' box model is therefore identical with and without Tailwind preflight; text that inherits
|
|
43
|
-
> host typography (the
|
|
44
|
-
>
|
|
44
|
+
> host typography (the empty-state label and the scroll-to-edge pill labels — localized chrome, see
|
|
45
|
+
> [Localization](#localization) — and your own row content) still follows the host's font and default
|
|
46
|
+
> line-height **by design**. The package's JSX writes `.aqvs-*` class names only,
|
|
45
47
|
> never a Tailwind utility, and the standalone build ships no utilities either — the `.aqvs-*` rules are
|
|
46
48
|
> byte-identical in both artifacts, so import exactly one:
|
|
47
49
|
>
|
|
@@ -342,11 +344,77 @@ settles:
|
|
|
342
344
|
/>
|
|
343
345
|
```
|
|
344
346
|
|
|
345
|
-
The
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
347
|
+
The live region has **no built-in strings** — its wording and language are yours, and `locale` /
|
|
348
|
+
`labels` do not touch it (the built-in catalog covers only the seven chrome strings, see
|
|
349
|
+
[Localization](#localization)). `format` returning the same string leaves the DOM untouched; `""`
|
|
350
|
+
clears the region. An invalid `debounceMs` (negative / non-finite) logs a warning and disables
|
|
351
|
+
announcements instead of silently substituting the default. ⚠️ If your app already maintains its
|
|
352
|
+
own live region for the list, keep using `onRangeChange` instead — two regions double-announce.
|
|
353
|
+
|
|
354
|
+
## Localization
|
|
355
|
+
|
|
356
|
+
The components render exactly **seven strings of their own** (UI chrome). They come from a built-in
|
|
357
|
+
catalog in English (`"en"`, the default) and Japanese (`"ja"`):
|
|
358
|
+
|
|
359
|
+
| Key | Where it appears | `en` | `ja` |
|
|
360
|
+
| --- | --- | --- | --- |
|
|
361
|
+
| `scrollUp` | vertical ScrollBar start arrow (`aria-label`) | Scroll up | 上へスクロール |
|
|
362
|
+
| `scrollDown` | vertical ScrollBar end arrow (`aria-label`) | Scroll down | 下へスクロール |
|
|
363
|
+
| `scrollLeft` | horizontal ScrollBar start arrow (`aria-label`) | Scroll left | 左へスクロール |
|
|
364
|
+
| `scrollRight` | horizontal ScrollBar end arrow (`aria-label`) | Scroll right | 右へスクロール |
|
|
365
|
+
| `scrollToTop` | VirtualScroll scroll-to-top pill (`enableScrollToTopBottomButtons`) | Top | 先頭へ |
|
|
366
|
+
| `scrollToBottom` | VirtualScroll scroll-to-bottom pill (`enableScrollToTopBottomButtons`) | Bottom | 末尾へ |
|
|
367
|
+
| `noItems` | VirtualScroll empty state (`itemCount === 0`; also VirtualGrid with no scroll rows) | No items | 項目がありません |
|
|
368
|
+
|
|
369
|
+
Pick the language with `locale` and override single keys with `labels`, which are laid over the
|
|
370
|
+
catalog of `locale`:
|
|
371
|
+
|
|
372
|
+
```tsx
|
|
373
|
+
<VirtualScroll locale="ja" labels={{ noItems: "データなし" }} ... />
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
- The same two props exist on `ScrollBar`, `ScrollPane`, `VirtualScroll` and `VirtualGrid`.
|
|
377
|
+
`ScrollPane` passes them to its bar, `VirtualScroll` to its pane, and `VirtualGrid` to both its
|
|
378
|
+
embedded `VirtualScroll` and its horizontal bar. Each component reads only the keys it renders.
|
|
379
|
+
- Omitting `locale` renders English, and the DOM is byte-identical to `locale="en"`.
|
|
380
|
+
- **Fail-fast**: an unsupported `locale` (`"EN"`, `"ja-JP"`, `"fr"`, `""`, `null`, ...) throws a
|
|
381
|
+
`RangeError` at render. So do an unknown `labels` key and a present value that is not a string with
|
|
382
|
+
non-whitespace content. An `undefined` value keeps the catalog text.
|
|
383
|
+
- **`labels` must be a plain object**: its prototype must be `Object.prototype` or `null`
|
|
384
|
+
(`Object.create(null)` is fine). Arrays (even `[]`), class instances, `Date`s and objects created
|
|
385
|
+
with `Object.create(proto)` throw a `RangeError`, because the unknown-key check sees only own keys
|
|
386
|
+
and would otherwise silently ignore a typo on the prototype. Only own properties are read, so a
|
|
387
|
+
label key inherited from a polluted `Object.prototype` is never applied.
|
|
388
|
+
- **Error messages describe the rejected value without throwing**: a string is shown as JSON
|
|
389
|
+
(`got "ja-JP"`), `null` as `got null`, and anything else only by its `typeof` tag (`got number`,
|
|
390
|
+
`got bigint`, `got symbol`, `got object`, `got function`) — never by its value. BigInt, Symbol
|
|
391
|
+
and null-prototype inputs therefore still produce the documented `RangeError`, not a `TypeError`
|
|
392
|
+
from stringifying them.
|
|
393
|
+
- **No language negotiation**: the package never reads `navigator.language`. Map it yourself and pass
|
|
394
|
+
a supported value:
|
|
395
|
+
|
|
396
|
+
```tsx
|
|
397
|
+
import { VIRTUAL_SCROLL_LOCALES, type VirtualScrollLocale } from '@aiquants/virtualscroll'
|
|
398
|
+
|
|
399
|
+
// Your app decides what an unsupported language maps to — here English.
|
|
400
|
+
const toLocale = (tag: string): VirtualScrollLocale => {
|
|
401
|
+
const primary = tag.split('-')[0].toLowerCase()
|
|
402
|
+
const match = VIRTUAL_SCROLL_LOCALES.find((locale) => locale === primary)
|
|
403
|
+
return match === undefined ? 'en' : match
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
<VirtualScroll locale={toLocale(navigator.language)} ... />
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
- **No `lang` attribute is stamped.** The document language belongs to the host: set `<html lang>` (or
|
|
410
|
+
a `lang` on an ancestor when the list's language differs from the page).
|
|
411
|
+
- Live-region wording stays yours (see [Screen-reader live region](#screen-reader-live-region)).
|
|
412
|
+
|
|
413
|
+
Exported API: `VIRTUAL_SCROLL_LOCALES` (`["en", "ja"]`), `VIRTUAL_SCROLL_LABEL_KEYS` (the seven keys),
|
|
414
|
+
`VIRTUAL_SCROLL_LABEL_CATALOGS` (the frozen catalogs), `resolveVirtualScrollLocale(locale)` (`undefined`
|
|
415
|
+
→ `"en"`, otherwise the value or a `RangeError`), `resolveVirtualScrollLabels(locale, labels)` (the
|
|
416
|
+
effective frozen labels — the catalog object itself when `labels` is `undefined`), and the types
|
|
417
|
+
`VirtualScrollLocale`, `VirtualScrollLabels` and `VirtualScrollLabelOverrides`.
|
|
350
418
|
|
|
351
419
|
## VirtualGrid (2D — trillion-scale columns, v3.2.0)
|
|
352
420
|
|
|
@@ -393,6 +461,9 @@ Contracts (see the design plan under `docs/plans/` for the full bounding theorem
|
|
|
393
461
|
`focusRowAtIndex`, and `behaviorOptions.defaultColWidth` (explicit Fenwick baseValue — skips
|
|
394
462
|
width sampling). The full member-by-member classification lives in
|
|
395
463
|
`docs/specs/2026.09.01 [AI] virtualscroll-virtual-grid.md`.
|
|
464
|
+
- `locale` / `labels` (see [Localization](#localization)) are forwarded to BOTH the embedded
|
|
465
|
+
`VirtualScroll` (vertical arrows and the "No items" empty state shown for 0 rows, an all-frozen row
|
|
466
|
+
set or a degenerate band) and the horizontal `ScrollBar` (left / right arrows).
|
|
396
467
|
- Frozen leading columns (v3.3.0): `frozenLeadingCols` pins the first F columns as a static
|
|
397
468
|
band OUTSIDE the anchor machinery (direct tree-absolute lefts; scroll cells live inside a
|
|
398
469
|
static clip whose inner carries the `residual - W_F` origin-shift transform). Integer in
|
|
@@ -547,6 +618,8 @@ exists in the DOM.
|
|
|
547
618
|
| `behaviorOptions` | `VirtualScrollBehaviorOptions` | ❌ | Options for scrolling behavior |
|
|
548
619
|
| `liveRegion` | `VirtualScrollLiveRegionOptions` | ❌ | Opt-in screen-reader live region announcing the visible range (nothing rendered when omitted). See [Screen-reader live region](#screen-reader-live-region) |
|
|
549
620
|
| `contentProps` | `React.AriaAttributes & { id?: string; role?: React.AriaRole }` | ❌ | ARIA / identity attributes for the scrollable **content** element — the correct host for a composite widget role. See [Composite widget roles](#composite-widget-roles-listbox--tree--grid). |
|
|
621
|
+
| `locale` | `VirtualScrollLocale` (`"en" \| "ja"`) | ❌ | UI chrome language of the built-in strings: arrow labels, scroll-to-edge pills, empty state (default: `"en"`). Unsupported values throw a `RangeError`. See [Localization](#localization) |
|
|
622
|
+
| `labels` | `VirtualScrollLabelOverrides` | ❌ | Per-key overrides laid over the catalog of `locale`: a plain object (prototype `Object.prototype` or `null`) whose own properties only are read. Unknown keys, blank or non-string values, and non-plain objects (arrays, class instances) throw a `RangeError`. See [Localization](#localization) |
|
|
550
623
|
|
|
551
624
|
### VirtualScrollScrollBarOptions
|
|
552
625
|
|
|
@@ -556,7 +629,7 @@ exists in the DOM.
|
|
|
556
629
|
| `enableThumbDrag` | `boolean` | Enable dragging the scrollbar thumb (default: true) |
|
|
557
630
|
| `enableTrackClick` | `boolean` | Enable clicking the scrollbar track (default: true) |
|
|
558
631
|
| `enableArrowButtons` | `boolean` | Enable arrow buttons on the scrollbar (default: true) |
|
|
559
|
-
| `enableScrollToTopBottomButtons` | `boolean` | Enable
|
|
632
|
+
| `enableScrollToTopBottomButtons` | `boolean` | Enable the auto-hiding Top/Bottom pills (texts from `labels.scrollToTop` / `labels.scrollToBottom`; default: false) |
|
|
560
633
|
| `renderThumbOverlay` | `(props: ScrollBarThumbOverlayRenderProps) => ReactNode` | Render prop to anchor custom UI near the scrollbar thumb |
|
|
561
634
|
| `tapScrollCircleOptions` | `ScrollBarTapCircleOptions` | Customization for the auxiliary tap scroll circle |
|
|
562
635
|
|
|
@@ -711,7 +784,7 @@ function AdvancedExample() {
|
|
|
711
784
|
### Custom Scrollbar Styling
|
|
712
785
|
|
|
713
786
|
`className` lands on the **scroll root** (`.aqvs-scroll-pane`). The bar, its track, thumb, arrow buttons
|
|
714
|
-
and the
|
|
787
|
+
and the scroll-to-edge pills are all descendants of that element, so one wrapper class reaches every part:
|
|
715
788
|
|
|
716
789
|
```tsx
|
|
717
790
|
<VirtualScroll
|
|
@@ -736,7 +809,7 @@ and the Top/Bottom pills are all descendants of that element, so one wrapper cla
|
|
|
736
809
|
.custom-virtual-scroll .aqvs-scrollbar-thumb[data-thumb-state="dragging"] { background-color: #005c99; }
|
|
737
810
|
.custom-virtual-scroll .aqvs-scrollbar-thumb[data-thumb-state="disabled"] { background-color: #b0c4d4; }
|
|
738
811
|
|
|
739
|
-
/* Arrow buttons and the
|
|
812
|
+
/* Arrow buttons and the scroll-to-edge pills. */
|
|
740
813
|
.custom-virtual-scroll .aqvs-scrollbar-arrow-button { background-color: #e8e8e8; color: #007acc; }
|
|
741
814
|
.custom-virtual-scroll .aqvs-scrollbar-arrow-button:enabled:hover { background-color: #cfe8f7; }
|
|
742
815
|
.custom-virtual-scroll .aqvs-scroll-to-edge-button { background-color: rgba(0, 122, 204, 0.85); }
|
|
@@ -767,7 +840,7 @@ Three consequences are worth knowing:
|
|
|
767
840
|
- **Do not hand-roll the hidden state.** When the content fits the viewport, the bar and the thumb wrapper
|
|
768
841
|
carry `data-visible="false"` and the packaged rule hides them (`opacity: 0; pointer-events: none`). If
|
|
769
842
|
you override `opacity` on `.aqvs-scrollbar`, scope it to `[data-visible="true"]`. The same applies to the
|
|
770
|
-
auto-hiding
|
|
843
|
+
auto-hiding scroll-to-edge pills — and there the hidden state is more than styling: `.aqvs-scroll-to-edge-overlay`
|
|
771
844
|
carries `inert` while hidden (and the pill `tabindex="-1"`) so it is not a phantom tab stop for keyboard
|
|
772
845
|
users. Forcing `opacity: 1` on the hidden overlay therefore paints a pill that cannot be clicked or focused.
|
|
773
846
|
Scope such rules to `[data-visible="true"]` as well.
|
package/dist/ScrollBar.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { VirtualScrollLabelOverrides, VirtualScrollLocale } from './labels.cjs';
|
|
2
3
|
import { TapScrollCircleRenderProps } from './TapScrollCircle.cjs';
|
|
3
4
|
/**
|
|
4
5
|
* Options to customize the auxiliary tap scroll circle.
|
|
@@ -113,6 +114,21 @@ export type ScrollBarProps = {
|
|
|
113
114
|
visibleStartIndex?: number;
|
|
114
115
|
/** The index of the last visible item. / 最後の可視アイテムのインデックス。 */
|
|
115
116
|
visibleEndIndex?: number;
|
|
117
|
+
/**
|
|
118
|
+
* UI chrome locale of the built-in arrow aria-labels (default `"en"`). An unsupported value
|
|
119
|
+
* throws a RangeError at render; no language negotiation happens.
|
|
120
|
+
* 内蔵矢印 aria-label の UI クロームロケール (既定 `"en"`)。非対応値は描画時に RangeError、
|
|
121
|
+
* 言語ネゴシエーションなし。
|
|
122
|
+
*/
|
|
123
|
+
locale?: VirtualScrollLocale;
|
|
124
|
+
/**
|
|
125
|
+
* Per-key overrides laid over the catalog of `locale`. This bar reads `scrollUp` / `scrollDown`
|
|
126
|
+
* (vertical) or `scrollLeft` / `scrollRight` (horizontal); unknown keys and blank values throw a
|
|
127
|
+
* RangeError at render.
|
|
128
|
+
* `locale` のカタログへ重ねるキー単位の上書き。本バーが読むのは縦なら `scrollUp` / `scrollDown`、
|
|
129
|
+
* 横なら `scrollLeft` / `scrollRight`。未知キーと空白値は描画時に RangeError。
|
|
130
|
+
*/
|
|
131
|
+
labels?: VirtualScrollLabelOverrides;
|
|
116
132
|
};
|
|
117
133
|
/**
|
|
118
134
|
* Defaults `computeTapScrollSpeed` callers need to reproduce the shipped speed mapping.
|
|
@@ -250,5 +266,5 @@ export declare const computeAutoTapScrollMaxSpeedMultiplier: (itemCount?: number
|
|
|
250
266
|
*
|
|
251
267
|
* カスタムスクロールバーコンポーネント。
|
|
252
268
|
*/
|
|
253
|
-
export declare const ScrollBar: ({ contentSize, viewportSize, scrollPosition, onScroll, enableThumbDrag, enableTrackClick, enableArrowButtons, horizontal, enableHorizontalTapCircle, stretchMainSize, scrollBarWidth, className, ariaControls, tapScrollCircleOptions, itemCount, renderThumbOverlay, visibleStartIndex, visibleEndIndex, }: ScrollBarProps) => import("react").JSX.Element;
|
|
269
|
+
export declare const ScrollBar: ({ contentSize, viewportSize, scrollPosition, onScroll, enableThumbDrag, enableTrackClick, enableArrowButtons, horizontal, enableHorizontalTapCircle, stretchMainSize, scrollBarWidth, className, ariaControls, tapScrollCircleOptions, itemCount, renderThumbOverlay, visibleStartIndex, visibleEndIndex, locale, labels, }: ScrollBarProps) => import("react").JSX.Element;
|
|
254
270
|
export {};
|
package/dist/ScrollBar.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { VirtualScrollLabelOverrides, VirtualScrollLocale } from './labels.ts';
|
|
2
3
|
import { TapScrollCircleRenderProps } from './TapScrollCircle.tsx';
|
|
3
4
|
/**
|
|
4
5
|
* Options to customize the auxiliary tap scroll circle.
|
|
@@ -113,6 +114,21 @@ export type ScrollBarProps = {
|
|
|
113
114
|
visibleStartIndex?: number;
|
|
114
115
|
/** The index of the last visible item. / 最後の可視アイテムのインデックス。 */
|
|
115
116
|
visibleEndIndex?: number;
|
|
117
|
+
/**
|
|
118
|
+
* UI chrome locale of the built-in arrow aria-labels (default `"en"`). An unsupported value
|
|
119
|
+
* throws a RangeError at render; no language negotiation happens.
|
|
120
|
+
* 内蔵矢印 aria-label の UI クロームロケール (既定 `"en"`)。非対応値は描画時に RangeError、
|
|
121
|
+
* 言語ネゴシエーションなし。
|
|
122
|
+
*/
|
|
123
|
+
locale?: VirtualScrollLocale;
|
|
124
|
+
/**
|
|
125
|
+
* Per-key overrides laid over the catalog of `locale`. This bar reads `scrollUp` / `scrollDown`
|
|
126
|
+
* (vertical) or `scrollLeft` / `scrollRight` (horizontal); unknown keys and blank values throw a
|
|
127
|
+
* RangeError at render.
|
|
128
|
+
* `locale` のカタログへ重ねるキー単位の上書き。本バーが読むのは縦なら `scrollUp` / `scrollDown`、
|
|
129
|
+
* 横なら `scrollLeft` / `scrollRight`。未知キーと空白値は描画時に RangeError。
|
|
130
|
+
*/
|
|
131
|
+
labels?: VirtualScrollLabelOverrides;
|
|
116
132
|
};
|
|
117
133
|
/**
|
|
118
134
|
* Defaults `computeTapScrollSpeed` callers need to reproduce the shipped speed mapping.
|
|
@@ -250,6 +266,6 @@ export declare const computeAutoTapScrollMaxSpeedMultiplier: (itemCount?: number
|
|
|
250
266
|
*
|
|
251
267
|
* カスタムスクロールバーコンポーネント。
|
|
252
268
|
*/
|
|
253
|
-
export declare const ScrollBar: ({ contentSize, viewportSize, scrollPosition, onScroll, enableThumbDrag, enableTrackClick, enableArrowButtons, horizontal, enableHorizontalTapCircle, stretchMainSize, scrollBarWidth, className, ariaControls, tapScrollCircleOptions, itemCount, renderThumbOverlay, visibleStartIndex, visibleEndIndex, }: ScrollBarProps) => import("react").JSX.Element;
|
|
269
|
+
export declare const ScrollBar: ({ contentSize, viewportSize, scrollPosition, onScroll, enableThumbDrag, enableTrackClick, enableArrowButtons, horizontal, enableHorizontalTapCircle, stretchMainSize, scrollBarWidth, className, ariaControls, tapScrollCircleOptions, itemCount, renderThumbOverlay, visibleStartIndex, visibleEndIndex, locale, labels, }: ScrollBarProps) => import("react").JSX.Element;
|
|
254
270
|
export {};
|
|
255
271
|
//# sourceMappingURL=ScrollBar.d.ts.map
|
package/dist/ScrollBar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollBar.d.ts","sourceRoot":"","sources":["../src/ScrollBar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ScrollBar.d.ts","sourceRoot":"","sources":["../src/ScrollBar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,EAA8B,KAAK,2BAA2B,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEpH,OA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C;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC5F,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,eAAO,MAAM,qBAAqB,GAAI,qHAAqH,mBAAmB,KAAG,MAuChL,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sCAAsC,GAAI,YAAY,MAAM,WASxE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,6TAqBvB,cAAc,gCA+8BhB,CAAA"}
|
package/dist/ScrollPane.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VirtualScrollLabelOverrides, VirtualScrollLocale } from './labels.cjs';
|
|
1
2
|
import { ScrollBarTapCircleOptions, ScrollBarThumbOverlayRenderProps } from './ScrollBar.cjs';
|
|
2
3
|
/**
|
|
3
4
|
* Props for the ScrollPane component.
|
|
@@ -162,6 +163,20 @@ export type ScrollPaneProps = {
|
|
|
162
163
|
id?: string;
|
|
163
164
|
role?: React.AriaRole;
|
|
164
165
|
};
|
|
166
|
+
/**
|
|
167
|
+
* UI chrome locale forwarded to the pane's ScrollBar (arrow aria-labels; default `"en"`).
|
|
168
|
+
* An unsupported value throws a RangeError at render.
|
|
169
|
+
* ペインの ScrollBar へ転送する UI クロームロケール (矢印の aria-label、既定 `"en"`)。
|
|
170
|
+
* 非対応値は描画時に RangeError。
|
|
171
|
+
*/
|
|
172
|
+
locale?: VirtualScrollLocale;
|
|
173
|
+
/**
|
|
174
|
+
* Per-key label overrides forwarded to the pane's ScrollBar, laid over the catalog of `locale`.
|
|
175
|
+
* Unknown keys and blank values throw a RangeError at render.
|
|
176
|
+
* ペインの ScrollBar へ転送するキー単位のラベル上書き (`locale` のカタログへ重ねる)。
|
|
177
|
+
* 未知キーと空白値は描画時に RangeError。
|
|
178
|
+
*/
|
|
179
|
+
labels?: VirtualScrollLabelOverrides;
|
|
165
180
|
};
|
|
166
181
|
export type ScrollPaneInertiaOptions = {
|
|
167
182
|
/** Maximum velocity applied when inertia starts. / 慣性開始時に適用する最大速度。 */
|
package/dist/ScrollPane.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VirtualScrollLabelOverrides, VirtualScrollLocale } from './labels.ts';
|
|
1
2
|
import { ScrollBarTapCircleOptions, ScrollBarThumbOverlayRenderProps } from './ScrollBar.tsx';
|
|
2
3
|
/**
|
|
3
4
|
* Props for the ScrollPane component.
|
|
@@ -162,6 +163,20 @@ export type ScrollPaneProps = {
|
|
|
162
163
|
id?: string;
|
|
163
164
|
role?: React.AriaRole;
|
|
164
165
|
};
|
|
166
|
+
/**
|
|
167
|
+
* UI chrome locale forwarded to the pane's ScrollBar (arrow aria-labels; default `"en"`).
|
|
168
|
+
* An unsupported value throws a RangeError at render.
|
|
169
|
+
* ペインの ScrollBar へ転送する UI クロームロケール (矢印の aria-label、既定 `"en"`)。
|
|
170
|
+
* 非対応値は描画時に RangeError。
|
|
171
|
+
*/
|
|
172
|
+
locale?: VirtualScrollLocale;
|
|
173
|
+
/**
|
|
174
|
+
* Per-key label overrides forwarded to the pane's ScrollBar, laid over the catalog of `locale`.
|
|
175
|
+
* Unknown keys and blank values throw a RangeError at render.
|
|
176
|
+
* ペインの ScrollBar へ転送するキー単位のラベル上書き (`locale` のカタログへ重ねる)。
|
|
177
|
+
* 未知キーと空白値は描画時に RangeError。
|
|
178
|
+
*/
|
|
179
|
+
labels?: VirtualScrollLabelOverrides;
|
|
165
180
|
};
|
|
166
181
|
export type ScrollPaneInertiaOptions = {
|
|
167
182
|
/** Maximum velocity applied when inertia starts. / 慣性開始時に適用する最大速度。 */
|
package/dist/ScrollPane.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollPane.d.ts","sourceRoot":"","sources":["../src/ScrollPane.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":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mB,CAAA;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,2BAA2B,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uGAAuG;IACvG,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,uEAAuE;IACvE,sBAAsB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AAyFD,MAAM,MAAM,gBAAgB,GAAG;IAC3B;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,EAAE,YAAY,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAA;IACpI,iBAAiB,EAAE,MAAM,MAAM,CAAA;IAC/B,cAAc,EAAE,MAAM,MAAM,CAAA;IAC5B,eAAe,EAAE,MAAM,MAAM,CAAA;IAC7B;;;;;;;;OAQG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAA;CAC7C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,8GAm0CtB,CAAA"}
|
package/dist/VirtualGrid.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { VirtualScrollLabelOverrides, VirtualScrollLocale } from './labels.cjs';
|
|
2
3
|
import { ScrollPaneProps } from './ScrollPane.cjs';
|
|
3
4
|
import { useFenwickMapTree } from './useFenwickMapTree.cjs';
|
|
4
5
|
import { VirtualScrollBehaviorOptions, VirtualScrollScrollBarOptions } from './VirtualScroll.cjs';
|
|
@@ -131,7 +132,7 @@ export type VirtualGridRange = {
|
|
|
131
132
|
totalWidth: number;
|
|
132
133
|
totalHeight: number;
|
|
133
134
|
};
|
|
134
|
-
/** Live-region options: the consumer owns wording/locale
|
|
135
|
+
/** Live-region options: the consumer owns announcement wording/locale; the built-in catalog (`locale` / `labels`) covers only the seven chrome strings (arrows, pills, empty state) — row-parity. / liveRegion オプション: 読み上げの文言とロケールは消費側所有。内蔵カタログ (`locale` / `labels`) はクローム 7 文言 (矢印・ピル・空状態) のみ対象 — 行側と同一方針。 */
|
|
135
136
|
export type VirtualGridLiveRegionOptions = {
|
|
136
137
|
/** Builds the announcement (same string = no re-announce, "" clears). / 読み上げ文言の組み立て (同一文字列 = 再読み上げなし、"" でクリア)。 */
|
|
137
138
|
buildMessage: (range: VirtualGridRange) => string;
|
|
@@ -319,6 +320,21 @@ export type VirtualGridProps<T> = {
|
|
|
319
320
|
behaviorOptions?: VirtualGridBehaviorOptions;
|
|
320
321
|
scrollBarOptions?: VirtualScrollScrollBarOptions;
|
|
321
322
|
liveRegion?: VirtualGridLiveRegionOptions;
|
|
323
|
+
/**
|
|
324
|
+
* UI chrome locale (default `"en"`), forwarded to the embedded vertical VirtualScroll (its
|
|
325
|
+
* arrows and the 0-row / all-frozen / degenerate-band empty state) and the horizontal bar
|
|
326
|
+
* arrows. An unsupported value throws a RangeError at render.
|
|
327
|
+
* UI クロームロケール (既定 `"en"`)。内蔵の縦 VirtualScroll (矢印と 0 行・全行固定・退化帯の
|
|
328
|
+
* 空状態) と横バーの矢印へ転送。非対応値は描画時に RangeError。
|
|
329
|
+
*/
|
|
330
|
+
locale?: VirtualScrollLocale;
|
|
331
|
+
/**
|
|
332
|
+
* Per-key label overrides laid over the catalog of `locale`, forwarded to the same two
|
|
333
|
+
* surfaces as `locale`. Unknown keys and blank values throw a RangeError at render.
|
|
334
|
+
* `locale` のカタログへ重ねるキー単位のラベル上書き (`locale` と同じ 2 面へ転送)。
|
|
335
|
+
* 未知キーと空白値は描画時に RangeError。
|
|
336
|
+
*/
|
|
337
|
+
labels?: VirtualScrollLabelOverrides;
|
|
322
338
|
className?: string;
|
|
323
339
|
testId?: string;
|
|
324
340
|
};
|
package/dist/VirtualGrid.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { VirtualScrollLabelOverrides, VirtualScrollLocale } from './labels.ts';
|
|
2
3
|
import { ScrollPaneProps } from './ScrollPane.tsx';
|
|
3
4
|
import { useFenwickMapTree } from './useFenwickMapTree.ts';
|
|
4
5
|
import { VirtualScrollBehaviorOptions, VirtualScrollScrollBarOptions } from './VirtualScroll.tsx';
|
|
@@ -131,7 +132,7 @@ export type VirtualGridRange = {
|
|
|
131
132
|
totalWidth: number;
|
|
132
133
|
totalHeight: number;
|
|
133
134
|
};
|
|
134
|
-
/** Live-region options: the consumer owns wording/locale
|
|
135
|
+
/** Live-region options: the consumer owns announcement wording/locale; the built-in catalog (`locale` / `labels`) covers only the seven chrome strings (arrows, pills, empty state) — row-parity. / liveRegion オプション: 読み上げの文言とロケールは消費側所有。内蔵カタログ (`locale` / `labels`) はクローム 7 文言 (矢印・ピル・空状態) のみ対象 — 行側と同一方針。 */
|
|
135
136
|
export type VirtualGridLiveRegionOptions = {
|
|
136
137
|
/** Builds the announcement (same string = no re-announce, "" clears). / 読み上げ文言の組み立て (同一文字列 = 再読み上げなし、"" でクリア)。 */
|
|
137
138
|
buildMessage: (range: VirtualGridRange) => string;
|
|
@@ -319,6 +320,21 @@ export type VirtualGridProps<T> = {
|
|
|
319
320
|
behaviorOptions?: VirtualGridBehaviorOptions;
|
|
320
321
|
scrollBarOptions?: VirtualScrollScrollBarOptions;
|
|
321
322
|
liveRegion?: VirtualGridLiveRegionOptions;
|
|
323
|
+
/**
|
|
324
|
+
* UI chrome locale (default `"en"`), forwarded to the embedded vertical VirtualScroll (its
|
|
325
|
+
* arrows and the 0-row / all-frozen / degenerate-band empty state) and the horizontal bar
|
|
326
|
+
* arrows. An unsupported value throws a RangeError at render.
|
|
327
|
+
* UI クロームロケール (既定 `"en"`)。内蔵の縦 VirtualScroll (矢印と 0 行・全行固定・退化帯の
|
|
328
|
+
* 空状態) と横バーの矢印へ転送。非対応値は描画時に RangeError。
|
|
329
|
+
*/
|
|
330
|
+
locale?: VirtualScrollLocale;
|
|
331
|
+
/**
|
|
332
|
+
* Per-key label overrides laid over the catalog of `locale`, forwarded to the same two
|
|
333
|
+
* surfaces as `locale`. Unknown keys and blank values throw a RangeError at render.
|
|
334
|
+
* `locale` のカタログへ重ねるキー単位のラベル上書き (`locale` と同じ 2 面へ転送)。
|
|
335
|
+
* 未知キーと空白値は描画時に RangeError。
|
|
336
|
+
*/
|
|
337
|
+
labels?: VirtualScrollLabelOverrides;
|
|
322
338
|
className?: string;
|
|
323
339
|
testId?: string;
|
|
324
340
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualGrid.d.ts","sourceRoot":"","sources":["../src/VirtualGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAkC,KAAK,cAAc,EAAE,KAAK,SAAS,EAA2F,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"VirtualGrid.d.ts","sourceRoot":"","sources":["../src/VirtualGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAkC,KAAK,cAAc,EAAE,KAAK,SAAS,EAA2F,MAAM,OAAO,CAAA;AAGpL,OAAO,KAAK,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG1D,OAAO,EAAqF,KAAK,4BAA4B,EAAqD,KAAK,6BAA6B,EAAyB,MAAM,qBAAqB,CAA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tC,wSAAwS;IACxS,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;CAC5E,CAAA;AAoBD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAC/B,IAAI,MAAM,EACV,eAAe,MAAM,EACrB,cAAc,MAAM,EACpB,UAAU,MAAM,EAChB,aAAa,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,EACpC,SAAS,UAAU,CAAC,OAAO,iBAAiB,CAAC,EAC7C,YAAY,MAAM,EAClB,YAAY,MAAM,KACnB;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAkBzH,CAAA;AAs7CD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAmC,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAAK,SAAS,CAAA"}
|
package/dist/VirtualScroll.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { VirtualScrollLabelOverrides, VirtualScrollLocale } from './labels.cjs';
|
|
2
3
|
import { ScrollPaneProps } from './ScrollPane.cjs';
|
|
3
4
|
import { useFenwickMapTree } from './useFenwickMapTree.cjs';
|
|
4
5
|
/**
|
|
@@ -224,12 +225,13 @@ export type VirtualScrollLiveRegionOptions = {
|
|
|
224
225
|
/**
|
|
225
226
|
* Formats the announcement text. Called after the visible range settles; returning the same
|
|
226
227
|
* string as last time leaves the DOM untouched (no re-announcement), returning `""` clears
|
|
227
|
-
* the region. The
|
|
228
|
-
*
|
|
228
|
+
* the region. The live-region wording and its language are consumer-owned: the package's
|
|
229
|
+
* built-in catalog (`locale` / `labels`) covers only the seven chrome strings (scrollbar arrow
|
|
230
|
+
* aria-labels, the scroll-to-edge pills and the empty state), never announcements.
|
|
229
231
|
* 読み上げ文言を組み立てる。可視範囲が静定した後に呼ばれ、前回と同じ文字列なら DOM を
|
|
230
|
-
* 触らない (再読み上げしない)。`""`
|
|
231
|
-
*
|
|
232
|
-
*
|
|
232
|
+
* 触らない (再読み上げしない)。`""` を返すとリージョンを空にする。読み上げの文面と言語は
|
|
233
|
+
* 消費側の所有物 — パッケージの内蔵カタログ (`locale` / `labels`) が扱うのはクローム 7 文言
|
|
234
|
+
* (スクロールバー矢印の aria-label、端スクロールピル、空状態) だけで、読み上げは対象外。
|
|
233
235
|
*
|
|
234
236
|
* @param range - The settled visible range / 静定した可視範囲
|
|
235
237
|
* @returns Announcement text / 読み上げ文言
|
|
@@ -309,6 +311,23 @@ export type VirtualScrollProps<T> = {
|
|
|
309
311
|
* その場合は `onRangeChange` から自前のリージョンを更新する従来手段を使う。
|
|
310
312
|
*/
|
|
311
313
|
liveRegion?: VirtualScrollLiveRegionOptions;
|
|
314
|
+
/**
|
|
315
|
+
* UI chrome locale of the built-in strings (default `"en"`): the scrollbar arrow aria-labels,
|
|
316
|
+
* the scroll-to-edge pills and the empty-state text. Live-region wording is not affected (see
|
|
317
|
+
* {@link VirtualScrollLiveRegionOptions.format}). An unsupported value throws a RangeError at
|
|
318
|
+
* render; no language negotiation happens.
|
|
319
|
+
* 内蔵文言 (スクロールバー矢印の aria-label、端スクロールピル、空状態文言) の UI クロームロケール
|
|
320
|
+
* (既定 `"en"`)。ライブリージョンの文言には影響しない ({@link VirtualScrollLiveRegionOptions.format}
|
|
321
|
+
* 参照)。非対応値は描画時に RangeError、言語ネゴシエーションなし。
|
|
322
|
+
*/
|
|
323
|
+
locale?: VirtualScrollLocale;
|
|
324
|
+
/**
|
|
325
|
+
* Per-key overrides laid over the catalog of `locale`; forwarded to the pane's scrollbar as-is.
|
|
326
|
+
* Unknown keys and blank values throw a RangeError at render.
|
|
327
|
+
* `locale` のカタログへ重ねるキー単位の上書き。ペインのスクロールバーへもそのまま転送。
|
|
328
|
+
* 未知キーと空白値は描画時に RangeError。
|
|
329
|
+
*/
|
|
330
|
+
labels?: VirtualScrollLabelOverrides;
|
|
312
331
|
background?: ReactNode;
|
|
313
332
|
children: (item: T, index: number) => ReactNode;
|
|
314
333
|
initialScrollIndex?: number;
|
package/dist/VirtualScroll.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { VirtualScrollLabelOverrides, VirtualScrollLocale } from './labels.ts';
|
|
2
3
|
import { ScrollPaneProps } from './ScrollPane.tsx';
|
|
3
4
|
import { useFenwickMapTree } from './useFenwickMapTree.ts';
|
|
4
5
|
/**
|
|
@@ -224,12 +225,13 @@ export type VirtualScrollLiveRegionOptions = {
|
|
|
224
225
|
/**
|
|
225
226
|
* Formats the announcement text. Called after the visible range settles; returning the same
|
|
226
227
|
* string as last time leaves the DOM untouched (no re-announcement), returning `""` clears
|
|
227
|
-
* the region. The
|
|
228
|
-
*
|
|
228
|
+
* the region. The live-region wording and its language are consumer-owned: the package's
|
|
229
|
+
* built-in catalog (`locale` / `labels`) covers only the seven chrome strings (scrollbar arrow
|
|
230
|
+
* aria-labels, the scroll-to-edge pills and the empty state), never announcements.
|
|
229
231
|
* 読み上げ文言を組み立てる。可視範囲が静定した後に呼ばれ、前回と同じ文字列なら DOM を
|
|
230
|
-
* 触らない (再読み上げしない)。`""`
|
|
231
|
-
*
|
|
232
|
-
*
|
|
232
|
+
* 触らない (再読み上げしない)。`""` を返すとリージョンを空にする。読み上げの文面と言語は
|
|
233
|
+
* 消費側の所有物 — パッケージの内蔵カタログ (`locale` / `labels`) が扱うのはクローム 7 文言
|
|
234
|
+
* (スクロールバー矢印の aria-label、端スクロールピル、空状態) だけで、読み上げは対象外。
|
|
233
235
|
*
|
|
234
236
|
* @param range - The settled visible range / 静定した可視範囲
|
|
235
237
|
* @returns Announcement text / 読み上げ文言
|
|
@@ -309,6 +311,23 @@ export type VirtualScrollProps<T> = {
|
|
|
309
311
|
* その場合は `onRangeChange` から自前のリージョンを更新する従来手段を使う。
|
|
310
312
|
*/
|
|
311
313
|
liveRegion?: VirtualScrollLiveRegionOptions;
|
|
314
|
+
/**
|
|
315
|
+
* UI chrome locale of the built-in strings (default `"en"`): the scrollbar arrow aria-labels,
|
|
316
|
+
* the scroll-to-edge pills and the empty-state text. Live-region wording is not affected (see
|
|
317
|
+
* {@link VirtualScrollLiveRegionOptions.format}). An unsupported value throws a RangeError at
|
|
318
|
+
* render; no language negotiation happens.
|
|
319
|
+
* 内蔵文言 (スクロールバー矢印の aria-label、端スクロールピル、空状態文言) の UI クロームロケール
|
|
320
|
+
* (既定 `"en"`)。ライブリージョンの文言には影響しない ({@link VirtualScrollLiveRegionOptions.format}
|
|
321
|
+
* 参照)。非対応値は描画時に RangeError、言語ネゴシエーションなし。
|
|
322
|
+
*/
|
|
323
|
+
locale?: VirtualScrollLocale;
|
|
324
|
+
/**
|
|
325
|
+
* Per-key overrides laid over the catalog of `locale`; forwarded to the pane's scrollbar as-is.
|
|
326
|
+
* Unknown keys and blank values throw a RangeError at render.
|
|
327
|
+
* `locale` のカタログへ重ねるキー単位の上書き。ペインのスクロールバーへもそのまま転送。
|
|
328
|
+
* 未知キーと空白値は描画時に RangeError。
|
|
329
|
+
*/
|
|
330
|
+
labels?: VirtualScrollLabelOverrides;
|
|
312
331
|
background?: ReactNode;
|
|
313
332
|
children: (item: T, index: number) => ReactNode;
|
|
314
333
|
initialScrollIndex?: number;
|