@adapttable/i18n 0.1.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 +37 -0
- package/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/index.cjs +623 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +81 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +603 -0
- package/dist/index.js.map +1 -0
- package/package.json +70 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @adapttable/i18n
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 845ff41: Initial public release of AdaptTable — a headless, UI-agnostic React data
|
|
8
|
+
table: one API, rendered natively by your design system.
|
|
9
|
+
- `@adapttable/core`: the headless engine — declarative `columns` (bare
|
|
10
|
+
keys, dot-paths, auto headers) and `filters` (one definition drives the
|
|
11
|
+
widget, URL params, chips, and predicate, with `"auto"` and async option
|
|
12
|
+
sources), three data tiers (in-memory, server via one consolidated
|
|
13
|
+
`onQueryChange(query, { signal })`, or a full custom `TableSource`),
|
|
14
|
+
URL-synced state with an injectable adapter (`urlSync={false}` for
|
|
15
|
+
in-memory), multi-sort, summary rows, header groups, row expansion,
|
|
16
|
+
saved views, select-all-N-matching, keyboard row navigation, and opt-in
|
|
17
|
+
row/card virtualization that tracks the page or any `maxHeight` scroll
|
|
18
|
+
box — 50,000 rows stay a handful of DOM nodes.
|
|
19
|
+
- Batteries-included adapters for **Mantine**, **MUI**, **Chakra UI**,
|
|
20
|
+
**Ant Design**, and **Tailwind/shadcn** (`@adapttable/unstyled`): native
|
|
21
|
+
filter forms with operator-first number/date ranges, column management
|
|
22
|
+
(hide / reorder / pin / resize — the row-actions column included), a
|
|
23
|
+
built-in saved-views menu, mobile card layouts, and memoized rows.
|
|
24
|
+
- `@adapttable/i18n`: label presets for ten locales (en, ar, de, es, fr,
|
|
25
|
+
he, it, ja, pt, zh) with RTL helpers — headers, cells, sorting and
|
|
26
|
+
filtering can all follow per-locale data paths.
|
|
27
|
+
- `@adapttable/cli`: `npx @adapttable/cli init` detects your kit and
|
|
28
|
+
scaffolds a working table.
|
|
29
|
+
|
|
30
|
+
Highlights: shareable URL state, paging and true infinite scroll (auto by
|
|
31
|
+
device), first-class RTL, seamless dark mode, 100% test coverage, and a
|
|
32
|
+
full headless escape hatch at every layer.
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [845ff41]
|
|
37
|
+
- @adapttable/core@0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Orwa Mahmoud
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @adapttable/i18n
|
|
2
|
+
|
|
3
|
+
Locale presets and **RTL** helpers for [AdaptTable](https://github.com/orwa-mahmoud/adapttable).
|
|
4
|
+
The core stays i18n-agnostic; this optional package gives you ready label
|
|
5
|
+
sets for **10 languages** — English, Arabic, German, Spanish, French,
|
|
6
|
+
Hebrew, Italian, Japanese, Portuguese, and Chinese — plus direction
|
|
7
|
+
utilities, so you get multilingual, right-to-left support for free.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @adapttable/i18n
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { DataTable, useFrontendData } from "@adapttable/mantine";
|
|
17
|
+
import { getLabels, getDirection } from "@adapttable/i18n";
|
|
18
|
+
|
|
19
|
+
function LocalizedTable({ locale }: { locale: string }) {
|
|
20
|
+
const source = useFrontendData({ data, columns });
|
|
21
|
+
return (
|
|
22
|
+
<DataTable
|
|
23
|
+
source={source}
|
|
24
|
+
columns={columns}
|
|
25
|
+
rowKey={(r) => r.id}
|
|
26
|
+
labels={getLabels(locale)} // primary subtag → preset; unknown → English
|
|
27
|
+
dir={getDirection(locale)} // "ar" / "he" → "rtl"
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## API
|
|
34
|
+
|
|
35
|
+
- `getLabels(locale)` — the label preset for a locale (matches the primary
|
|
36
|
+
subtag, e.g. `"de-AT"` → German); falls back to English.
|
|
37
|
+
- `getDirection(locale)` → `"ltr" | "rtl"`.
|
|
38
|
+
- `isRtlLocale(locale)` / `primarySubtag(locale)` / `RTL_LANGUAGES`.
|
|
39
|
+
- Raw preset objects: `en`, `ar`, `de`, `es`, `fr`, `he`, `it`, `ja`, `pt`,
|
|
40
|
+
`zh`. `locales` — the keyed map; `hasLocale(locale)` — membership check.
|
|
41
|
+
|
|
42
|
+
Bring your own languages by spreading a preset and overriding strings:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { en } from "@adapttable/i18n";
|
|
46
|
+
const fr = { ...en, search: "Rechercher", noData: "Aucune donnée" };
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
[MIT](../../LICENSE) © Orwa Mahmoud
|