リファレンス
標準の部首選択
import { … } from "@johnmorrisdotca/bushu/picker";
最小化と gzip 圧縮をしたサイズは 89.7 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The radical picker for a page: mountBushu draws the grid of parts by stroke count and the kanji that hold the parts chosen into any
element, loadBushuData fetches the data it shows, and the words (BUSHU_STRINGS) and the style (BUSHU_STYLE) are here to read or replace.
A separate entry (@johnmorrisdotca/bushu/picker), so a server never loads any of it.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
BUSHU_RESULT_LIMIT | 定数 | The most matches a picker draws unless limit says. |
BUSHU_STRINGS | 定数 | Native English and Japanese radical-picker controls, results and accessible announcements. |
BUSHU_STYLE | 定数 | THE STYLE a Bushu picker wears (mountBushu, <bushu-picker>): its colours as custom properties on .bushu, its boxes, its tiles and its chips. |
BushuEventDetail | 型 | What a picker tells of itself, in bushu-change and bushu-pick events and to the callbacks. |
BushuLanguage | 型 | THE WORDS BUSHU SAYS, in English and Japanese: what the picker's buttons and lines of words say, and what a screen reader hears. |
bushuLanguageOf | 関数 | The language a lang attribute asks for: Japanese for any ja, English for everything else. |
BushuMount | 型 | What mountBushu gives back: methods for everything a button does, and destroy. |
BushuMountOptions | 型 | The native radical data, optional names/strokes, language, result limit, initial selection and host callbacks. |
BushuNameEntry | 型 | The names a picker shows beside a radical: what radicalNameEntry from /names returns. |
bushuSay | 関数 | A line in a language, with its {name} values filled in, and its One form when n is 1. |
ensureBushuStyle | 関数 | Puts the picker's style in the page once. |
loadBushuData | 関数 | Loads the data a picker shows, each module at the moment it is asked for, so that a page which never opens a picker never loads it: the radicals, the Japanese names and the strokes of a kanji. |
mountBushu | 関数 | Native interface, settings and words for host code. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。