@iyulab/flex-table 0.35.0 → 0.37.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 +54 -0
- package/README.md +51 -0
- package/dist/{flex-table-Y4GyDV0Y.js → flex-table-BAQbidin.js} +899 -152
- package/dist/flex-table.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/locale.d.ts +32 -0
- package/dist/react.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.37.0] - 2026-09-20
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **The column menu and the cell context menu stayed in English on a translated page.** 0.36.0 moved
|
|
8
|
+
the table's chrome text into a locale namespace, but the menus added in 0.35.0 were not part of
|
|
9
|
+
that move: their items, and the accessible name of the column-menu button, were written inline. On
|
|
10
|
+
a Korean page the same button therefore announced one language in its `title` and another in its
|
|
11
|
+
`aria-label`, and a screen-reader user heard English item names in the middle of a translated
|
|
12
|
+
grid — with no way to correct it, since the strings had no keys to register over. Every one of
|
|
13
|
+
those strings now goes through the namespace, including the cell context menu, the two menu
|
|
14
|
+
accessible names and the import drop target. Three keys name a column and carry a `{header}`
|
|
15
|
+
placeholder, so word order stays the translator's choice instead of being fixed by concatenation.
|
|
16
|
+
The built-in English wording is unchanged.
|
|
17
|
+
|
|
18
|
+
### Documentation
|
|
19
|
+
|
|
20
|
+
- **The README no longer lists every message key by hand.** That paragraph had gone stale once
|
|
21
|
+
already, and a hand-copied list is the only part of this documentation that can: the exported
|
|
22
|
+
`FlexTableMessageKey` cannot. It now names the groups and points at the type, which your editor
|
|
23
|
+
completes and the compiler checks.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **The boolean filter's two options are translatable** (`booleanTrue` / `booleanFalse`). They read
|
|
28
|
+
`True` and `False` in every locale before this; the check and cross glyphs stay in the template,
|
|
29
|
+
since a symbol means the same thing in every language.
|
|
30
|
+
- **`t()` and the exported namespace now interpolate.** `FlexTableMessageKey` gains the menu keys
|
|
31
|
+
above; registering a partial table still merges, so existing registrations keep working untouched.
|
|
32
|
+
|
|
33
|
+
## [0.36.0] - 2026-09-17
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- **The table's own chrome text now goes through a locale namespace.** The filter menus, the
|
|
38
|
+
find-and-replace panel, the column menu and the empty-state message were written in English in the
|
|
39
|
+
source, so an application translated into another language showed thirty-one English strings in
|
|
40
|
+
the middle of its own UI — "Contains", "Starts with", "Match case", "Replace all" and the rest.
|
|
41
|
+
`flexTableLocale` is exported for consumers to register further languages or reword the built-in
|
|
42
|
+
ones:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { flexTableLocale } from '@iyulab/flex-table';
|
|
46
|
+
flexTableLocale.register('ja', { contains: '含む', startsWith: '前方一致' });
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
English and Korean ship with the package; other languages are added the same way. The filter
|
|
50
|
+
operators `AND` and `OR`, and the glyphs standing in for icons, are deliberately left alone —
|
|
51
|
+
they read the same in every language and translating them makes them harder to recognise.
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- The package compiles against `ESNext` rather than `ES2021`, matching every sibling package in the
|
|
56
|
+
same family.
|
|
3
57
|
## [0.35.0] - 2026-09-15
|
|
4
58
|
|
|
5
59
|
### Changed
|
package/README.md
CHANGED
|
@@ -409,6 +409,57 @@ package dependency; CSS custom properties are resolved at render time, not impor
|
|
|
409
409
|
| ArrowUp / ArrowDown / Home / End (column menu) | Move between menu items |
|
|
410
410
|
| Escape (column menu) | Close the menu and return focus to its button |
|
|
411
411
|
|
|
412
|
+
## Localization
|
|
413
|
+
|
|
414
|
+
The text the table draws itself — filter menus, the find-and-replace panel, the column menu, the
|
|
415
|
+
empty-state message — resolves through a locale namespace. English and Korean ship with the package
|
|
416
|
+
and follow whatever locale `@iyulab/components` has active:
|
|
417
|
+
|
|
418
|
+
```ts
|
|
419
|
+
import { Locale } from '@iyulab/components';
|
|
420
|
+
|
|
421
|
+
Locale.set('ko'); // the table's own chrome follows
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
Register another language, or reword the built-in strings, through the exported namespace. Partial
|
|
425
|
+
tables are merged, so you only pass the keys you want to change:
|
|
426
|
+
|
|
427
|
+
```ts
|
|
428
|
+
import { flexTableLocale, type FlexTableMessageKey } from '@iyulab/flex-table';
|
|
429
|
+
|
|
430
|
+
flexTableLocale.register('ja', {
|
|
431
|
+
contains: '含む',
|
|
432
|
+
startsWith: '前方一致',
|
|
433
|
+
matchCase: '大文字と小文字を区別',
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
flexTableLocale.register('en', { replaceAll: 'Replace everything' }); // reword one string
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
The keys are grouped by where they appear: the column header and its menu, the items inside that
|
|
440
|
+
menu, the cell context menu, cell comments, the filter panel, find-and-replace, and the import drop
|
|
441
|
+
target. **`FlexTableMessageKey` is the list** — it is exported, so your editor completes it and a
|
|
442
|
+
misspelled key is a type error rather than a string that silently falls back to its own name.
|
|
443
|
+
|
|
444
|
+
> This paragraph used to enumerate every key by hand. It went stale once, and a hand-copied list is
|
|
445
|
+
> the only thing here that can: the type cannot. If you want the full set, hover `FlexTableMessageKey`
|
|
446
|
+
> or open `src/locale.ts`.
|
|
447
|
+
|
|
448
|
+
Three of those keys name a column, and word order differs between languages, so they carry a
|
|
449
|
+
`{header}` placeholder rather than being assembled by concatenation:
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
flexTableLocale.register('ja', {
|
|
453
|
+
columnMenuFor: '{header} の列メニュー', // the column menu button's accessible name
|
|
454
|
+
columnMenuRegion: '{header} 列', // the open menu's accessible name
|
|
455
|
+
showColumn: '{header} を表示', // "show this hidden neighbour again"
|
|
456
|
+
});
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
The filter operators `AND` and `OR` are not in the table, and neither are the glyphs that stand in
|
|
460
|
+
for icons. They read the same in every language, and translating them makes them harder to
|
|
461
|
+
recognise rather than easier.
|
|
462
|
+
|
|
412
463
|
## Accessibility
|
|
413
464
|
|
|
414
465
|
The baseline is **WCAG 2.2**. The table lists what this package **measures in tests** — it is not a
|