@zeroman.yang/react-auto-components 0.1.2 → 0.1.3
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/README.md +17 -3
- package/dist/adapters/xlsx.d.ts +7 -1
- package/dist/components/AutoChat/types.d.ts +7 -0
- package/dist/components/AutoDialog/index.d.ts +15 -0
- package/dist/components/AutoForm/types.d.ts +28 -0
- package/dist/components/AutoMenu/index.d.ts +7 -0
- package/dist/components/AutoSearch/index.d.ts +40 -0
- package/dist/components/AutoTable/registry.d.ts +8 -0
- package/dist/components/AutoTable/types.d.ts +69 -3
- package/dist/components/AutoTabs/index.d.ts +21 -2
- package/dist/components/AutoTabs/useAutoTabsWorkspace.d.ts +65 -0
- package/dist/core/AutoConfigProvider.d.ts +27 -0
- package/dist/core/config.d.ts +6 -1
- package/dist/core/dev.d.ts +27 -0
- package/dist/core/errors.d.ts +20 -0
- package/dist/core/query.d.ts +9 -0
- package/dist/core/registry.d.ts +33 -0
- package/dist/core/testid.d.ts +5 -0
- package/dist/core/types.d.ts +320 -17
- package/dist/errors-BT5WUIOV.js +28 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1889 -1465
- package/dist/style.css +1 -1
- package/dist/xlsx.js +13 -6
- package/docs/auto-dialog.md +64 -0
- package/docs/auto-form.md +64 -0
- package/docs/auto-menu.md +47 -0
- package/docs/auto-search.md +60 -0
- package/docs/auto-table.md +144 -0
- package/docs/auto-tabs.md +99 -0
- package/docs/errors.md +118 -0
- package/docs/i18n/de/README.md +8 -2
- package/docs/i18n/de/auto-dialog.md +23 -0
- package/docs/i18n/de/auto-form.md +35 -0
- package/docs/i18n/de/auto-menu.md +23 -0
- package/docs/i18n/de/auto-search.md +32 -0
- package/docs/i18n/de/auto-table.md +31 -0
- package/docs/i18n/de/auto-tabs.md +25 -0
- package/docs/i18n/de/errors.md +110 -0
- package/docs/i18n/es/README.md +8 -2
- package/docs/i18n/es/auto-dialog.md +23 -0
- package/docs/i18n/es/auto-form.md +35 -0
- package/docs/i18n/es/auto-menu.md +23 -0
- package/docs/i18n/es/auto-search.md +32 -0
- package/docs/i18n/es/auto-table.md +31 -0
- package/docs/i18n/es/auto-tabs.md +25 -0
- package/docs/i18n/es/errors.md +110 -0
- package/docs/i18n/fr/README.md +8 -2
- package/docs/i18n/fr/auto-dialog.md +23 -0
- package/docs/i18n/fr/auto-form.md +35 -0
- package/docs/i18n/fr/auto-menu.md +23 -0
- package/docs/i18n/fr/auto-search.md +32 -0
- package/docs/i18n/fr/auto-table.md +31 -0
- package/docs/i18n/fr/auto-tabs.md +25 -0
- package/docs/i18n/fr/errors.md +110 -0
- package/docs/i18n/ja/README.md +8 -2
- package/docs/i18n/ja/auto-dialog.md +23 -0
- package/docs/i18n/ja/auto-form.md +36 -0
- package/docs/i18n/ja/auto-menu.md +23 -0
- package/docs/i18n/ja/auto-search.md +34 -0
- package/docs/i18n/ja/auto-table.md +31 -0
- package/docs/i18n/ja/auto-tabs.md +25 -0
- package/docs/i18n/ja/errors.md +110 -0
- package/docs/i18n/ko/README.md +8 -2
- package/docs/i18n/ko/auto-dialog.md +23 -0
- package/docs/i18n/ko/auto-form.md +35 -0
- package/docs/i18n/ko/auto-menu.md +23 -0
- package/docs/i18n/ko/auto-search.md +32 -0
- package/docs/i18n/ko/auto-table.md +31 -0
- package/docs/i18n/ko/auto-tabs.md +25 -0
- package/docs/i18n/ko/errors.md +110 -0
- package/docs/i18n/pt-BR/README.md +8 -2
- package/docs/i18n/pt-BR/auto-dialog.md +23 -0
- package/docs/i18n/pt-BR/auto-form.md +35 -0
- package/docs/i18n/pt-BR/auto-menu.md +23 -0
- package/docs/i18n/pt-BR/auto-search.md +32 -0
- package/docs/i18n/pt-BR/auto-table.md +31 -0
- package/docs/i18n/pt-BR/auto-tabs.md +25 -0
- package/docs/i18n/pt-BR/errors.md +110 -0
- package/docs/i18n/ru/README.md +8 -2
- package/docs/i18n/ru/auto-dialog.md +23 -0
- package/docs/i18n/ru/auto-form.md +35 -0
- package/docs/i18n/ru/auto-menu.md +23 -0
- package/docs/i18n/ru/auto-search.md +32 -0
- package/docs/i18n/ru/auto-table.md +31 -0
- package/docs/i18n/ru/auto-tabs.md +25 -0
- package/docs/i18n/ru/errors.md +110 -0
- package/docs/i18n/zh-CN/README.md +8 -2
- package/docs/i18n/zh-CN/auto-dialog.md +64 -0
- package/docs/i18n/zh-CN/auto-form.md +62 -0
- package/docs/i18n/zh-CN/auto-menu.md +47 -0
- package/docs/i18n/zh-CN/auto-search.md +55 -0
- package/docs/i18n/zh-CN/auto-table.md +62 -0
- package/docs/i18n/zh-CN/auto-tabs.md +99 -0
- package/docs/i18n/zh-CN/errors.md +112 -0
- package/docs/i18n/zh-TW/README.md +8 -2
- package/docs/i18n/zh-TW/auto-dialog.md +64 -0
- package/docs/i18n/zh-TW/auto-form.md +62 -0
- package/docs/i18n/zh-TW/auto-menu.md +47 -0
- package/docs/i18n/zh-TW/auto-search.md +55 -0
- package/docs/i18n/zh-TW/auto-table.md +62 -0
- package/docs/i18n/zh-TW/auto-tabs.md +44 -0
- package/docs/i18n/zh-TW/errors.md +112 -0
- package/llms.txt +69 -0
- package/package.json +18 -2
- package/dist/components/AutoSearchPanel/index.d.ts +0 -21
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# AutoTabs
|
|
2
|
+
|
|
3
|
+
**English** | [简体中文](i18n/zh-CN/auto-tabs.md) | [繁體中文](i18n/zh-TW/auto-tabs.md) | [日本語](i18n/ja/auto-tabs.md) | [한국어](i18n/ko/auto-tabs.md) | [Español](i18n/es/auto-tabs.md) | [Français](i18n/fr/auto-tabs.md) | [Deutsch](i18n/de/auto-tabs.md) | [Português (Brasil)](i18n/pt-BR/auto-tabs.md) | [Русский](i18n/ru/auto-tabs.md)
|
|
4
|
+
|
|
5
|
+
Tab list. Nested tabs are another `AutoTabs` fed by `children`, not a menu. Use [AutoMenu](auto-menu.md) for a sidebar.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { AutoTabs } from "@zeroman.yang/react-auto-components";
|
|
11
|
+
import "@zeroman.yang/react-auto-components/style.css";
|
|
12
|
+
|
|
13
|
+
<AutoTabs
|
|
14
|
+
items={[
|
|
15
|
+
{ id: "one", label: "One", content: <p>First</p> },
|
|
16
|
+
{ id: "two", label: "Two", content: <p>Second</p>, disabled: true },
|
|
17
|
+
]}
|
|
18
|
+
/>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Behavior and props
|
|
22
|
+
|
|
23
|
+
| Prop | Behavior |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| `items` | Each tab needs a stable `id`. `hidden` (boolean or function) and a failed `canAccess` remove the tab. |
|
|
26
|
+
| `value` | Controlled path of ids from the root. Nested selection is `["parent", "child"]`. |
|
|
27
|
+
| `defaultValue` | Uncontrolled initial path. |
|
|
28
|
+
| `onChange(path, item)` | **Not caught.** If it throws, React reports the error and the last committed path stays when the component is controlled by you. |
|
|
29
|
+
| `mode` | Default `"horizontal"`. `"vertical"` stacks the tab list. |
|
|
30
|
+
| `keepMounted` | Default `true`: inactive panels stay mounted and keep local state. `false` unmounts them. |
|
|
31
|
+
| `onRefresh` | When set, a refresh button is rendered for that tab. **Not caught.** |
|
|
32
|
+
| `loading` | Appends an ellipsis to the tab label. It does not block selection. |
|
|
33
|
+
| `size`, `density` | Override the provider. Tabs read `config.tabs`, then `config.density` / `config.size`. |
|
|
34
|
+
| `disabled` | The tab stays visible and cannot be selected. The default selection skips disabled tabs. |
|
|
35
|
+
| `closable` | With `onClose`, the tab shows a close button. Delete on the focused tab requests the same close. |
|
|
36
|
+
| `onClose(path, item)` | Asks the owner to remove the tab. **Not caught.** Nested groups pass the full path. The owner updates `items`. |
|
|
37
|
+
| `lazy` | Default `false`. `true` mounts a panel on its first visit. |
|
|
38
|
+
|
|
39
|
+
A nested `children` list replaces `content` for that tab. `defaultActive` is the nested uncontrolled id.
|
|
40
|
+
|
|
41
|
+
## Dynamic tabs
|
|
42
|
+
|
|
43
|
+
`useAutoTabsWorkspace` keeps a flat set of pages without a router. Spread `tabsProps` onto `AutoTabs`. `open` adds a page, or activates one that is already open and keeps its draft.
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import {
|
|
47
|
+
AutoTabs,
|
|
48
|
+
useAutoTabsWorkspace,
|
|
49
|
+
} from "@zeroman.yang/react-auto-components";
|
|
50
|
+
|
|
51
|
+
const pages = {
|
|
52
|
+
home: { title: "Home", render: () => <p>Pinned</p> },
|
|
53
|
+
order: {
|
|
54
|
+
title: "Order",
|
|
55
|
+
render: ({ tab, setState }) => (
|
|
56
|
+
<input
|
|
57
|
+
aria-label="Draft"
|
|
58
|
+
value={typeof tab.state === "string" ? tab.state : ""}
|
|
59
|
+
onChange={(event) => setState(event.target.value)}
|
|
60
|
+
/>
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export function Orders() {
|
|
66
|
+
const workspace = useAutoTabsWorkspace({
|
|
67
|
+
workspaceId: "orders",
|
|
68
|
+
pages,
|
|
69
|
+
defaultTabs: [{ id: "home", page: "home", pinned: true }],
|
|
70
|
+
});
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
<button
|
|
74
|
+
type="button"
|
|
75
|
+
disabled={!workspace.ready}
|
|
76
|
+
onClick={() =>
|
|
77
|
+
workspace.open({
|
|
78
|
+
id: "order:1",
|
|
79
|
+
page: "order",
|
|
80
|
+
title: "Order 1",
|
|
81
|
+
params: { orderId: "1" },
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
Open order
|
|
86
|
+
</button>
|
|
87
|
+
{workspace.ready && <AutoTabs {...workspace.tabsProps} />}
|
|
88
|
+
</>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
A pinned tab has no close button. Closing the active tab selects the next enabled neighbor. `beforeClose` returning `false`, or throwing, cancels the close. A throw from the close button is shown with `config.notify`. Tabs, the selection, `params`, and `state` are restored from `sessionStorage` after mount. Wait for `ready` before calling `open`. `storage: false` keeps the workspace in memory. `"local"` or a storage adapter chooses another store. The key is `${namespace}:tabs:${workspaceId}`.
|
|
94
|
+
|
|
95
|
+
`tabsProps` sets `lazy` and `keepMounted`, so a panel mounts on its first visit and then stays mounted. The component does not remove a tab by itself. `onClose` asks the workspace to remove it.
|
|
96
|
+
|
|
97
|
+
## Preconditions
|
|
98
|
+
|
|
99
|
+
Import `style.css` once (`RAC-CSS-MISSING` in development). `AutoConfigProvider` is optional.
|
package/docs/errors.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Error codes
|
|
2
|
+
|
|
3
|
+
**English** | [简体中文](i18n/zh-CN/errors.md) | [繁體中文](i18n/zh-TW/errors.md) | [日本語](i18n/ja/errors.md) | [한국어](i18n/ko/errors.md) | [Español](i18n/es/errors.md) | [Français](i18n/fr/errors.md) | [Deutsch](i18n/de/errors.md) | [Português (Brasil)](i18n/pt-BR/errors.md) | [Русский](i18n/ru/errors.md)
|
|
4
|
+
|
|
5
|
+
Developer failures throw `RacError` or call `console.warn` in development. The message is always:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
[Component] what is wrong.
|
|
9
|
+
Fix: what to change.
|
|
10
|
+
Code: RAC-…
|
|
11
|
+
Docs: https://github.com/Zeroman/react-auto-components/blob/main/docs/errors.md#rac-…
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
User-visible sentences stay on `config.t`. A `RacError` may carry `userKey`, the English source string the host translates. The console and the exception stay English.
|
|
15
|
+
|
|
16
|
+
## RAC-FIELD-OPTIONS
|
|
17
|
+
|
|
18
|
+
`type` is `select`, `select-v2`, `radio`, `checkbox`, or `cascader`, and `options` is missing or an empty array.
|
|
19
|
+
|
|
20
|
+
Fix: pass `options` as an array or as `(values) => Option[]`. `autocomplete` may omit options; it is a text box with optional suggestions.
|
|
21
|
+
|
|
22
|
+
## RAC-FIELD-RANGE
|
|
23
|
+
|
|
24
|
+
`type` is `daterange` or `datetimerange`, and the model field or the current value is not a two-item array.
|
|
25
|
+
|
|
26
|
+
Fix: type the field as `[start, end]` (`Pair`, or `[string, string]`, or `[number, number]` for timestamps). `dateValue` defaults to `"string"` (`YYYY-MM-DD`). `"timestamp"` stores epoch milliseconds. `null` is an open end.
|
|
27
|
+
|
|
28
|
+
A scalar string or number is a TypeScript error (`RAC-FIELD-RANGE` in the message). An array-typed model compiles; development mode warns when a real value does not have length 2.
|
|
29
|
+
|
|
30
|
+
## RAC-FIELD-BETWEEN
|
|
31
|
+
|
|
32
|
+
`match: "between"` is set and the model field or the current value is not `[from, to]`.
|
|
33
|
+
|
|
34
|
+
Fix: store a two-item tuple. A scalar does not match rows. The same rule is a TypeScript error on `Field<T>`.
|
|
35
|
+
|
|
36
|
+
## RAC-FIELD-CUSTOM
|
|
37
|
+
|
|
38
|
+
`type: "custom"` has neither `render` nor `component`.
|
|
39
|
+
|
|
40
|
+
Fix: pass `render(context)` or `component` set to a key in `AutoConfigProvider` `config.fields`.
|
|
41
|
+
|
|
42
|
+
## RAC-FIELD-DUPLICATE
|
|
43
|
+
|
|
44
|
+
Two fields share a `name`. Thrown from `defaults` while the form mounts.
|
|
45
|
+
|
|
46
|
+
Fix: unique names. `title`, `tip`, `append`, and `button` have no name and are skipped.
|
|
47
|
+
|
|
48
|
+
## RAC-CSS-MISSING
|
|
49
|
+
|
|
50
|
+
Development mode did not find `--auto-text` on `:root`. The stylesheet sets that variable. Without it the page looks unstyled and the DOM does not say why.
|
|
51
|
+
|
|
52
|
+
Fix: `import "@zeroman.yang/react-auto-components/style.css"` once in the app entry.
|
|
53
|
+
|
|
54
|
+
## RAC-TABLE-XLSX
|
|
55
|
+
|
|
56
|
+
`export("xlsx")` ran and `exportXlsx` was not passed.
|
|
57
|
+
|
|
58
|
+
Fix: `import { exportXlsx } from "@zeroman.yang/react-auto-components/xlsx"` and pass `exportXlsx={exportXlsx}`. The UI still shows the translated "Configure the XLSX export adapter".
|
|
59
|
+
|
|
60
|
+
## RAC-XLSX-DEP
|
|
61
|
+
|
|
62
|
+
The xlsx adapter could not load `exceljs`. It is an `optionalDependency`, so a normal install can skip it.
|
|
63
|
+
|
|
64
|
+
Fix: `pnpm add exceljs`. CSV and JSON do not need it.
|
|
65
|
+
|
|
66
|
+
## RAC-TABLE-EXPORT-PAGE
|
|
67
|
+
|
|
68
|
+
A remote export page was empty before the last page, so the file was not saved.
|
|
69
|
+
|
|
70
|
+
Fix: return a stable `total` and the rows for that `pageIndex`. The UI shows the translated "Export data is incomplete. Try again."
|
|
71
|
+
|
|
72
|
+
## RAC-TABLE-ROWID
|
|
73
|
+
|
|
74
|
+
`rowKey` was missing or repeated on a loaded row. Development warning.
|
|
75
|
+
|
|
76
|
+
Fix: every row needs a stable unique string. Selection, expansion, and `scrollToRow` use it.
|
|
77
|
+
|
|
78
|
+
## RAC-TABLE-ID
|
|
79
|
+
|
|
80
|
+
`AutoTable` `id` is empty, so settings would be stored at `${namespace}:table:`. Development warning.
|
|
81
|
+
|
|
82
|
+
Fix: pass a stable id per table.
|
|
83
|
+
|
|
84
|
+
## RAC-COLUMN-COMPONENT
|
|
85
|
+
|
|
86
|
+
A column `component` is not in `config.columns`. Development warning. The cell keeps the default format.
|
|
87
|
+
|
|
88
|
+
Fix: add that key to `AutoConfigProvider` `config.columns`, or set `render`, `format`, or `sort` on the column. A function on the column wins over the registry.
|
|
89
|
+
|
|
90
|
+
## RAC-ROW-ACTION
|
|
91
|
+
|
|
92
|
+
A row action has neither `onClick` nor a known `action` key. The status shows this message when the item is chosen.
|
|
93
|
+
|
|
94
|
+
Fix: pass `onClick`, or `action` set to a key in `config.rowActions`. `onClick` wins when both are set.
|
|
95
|
+
|
|
96
|
+
## RAC-TABLE-SOURCE
|
|
97
|
+
|
|
98
|
+
`AutoTable` `source` is not in `config.sources`. The table shows this message and a retry button.
|
|
99
|
+
|
|
100
|
+
Fix: add that key to `config.sources`, or pass `data` / `dataSource` instead. Pass only one of the three.
|
|
101
|
+
|
|
102
|
+
## RAC-TABLE-FILTER
|
|
103
|
+
|
|
104
|
+
The settings filter JSON is not a query. The translated "Invalid filter" stays on screen and the previous filter is kept.
|
|
105
|
+
|
|
106
|
+
Fix: a group is `{ kind: "group", operator: "and" | "or", children }`. A condition is `{ kind: "condition", field, operator, value }` where `field` is a column key. `between` value is `[from, to]`. `in` value is an array.
|
|
107
|
+
|
|
108
|
+
## RAC-QUERY-FIELD
|
|
109
|
+
|
|
110
|
+
`serializeRsql` refused a field name that is not `/^[\w.]+$/`.
|
|
111
|
+
|
|
112
|
+
Fix: letters, digits, underscore, and dots only. Rename the column or map it before serializing.
|
|
113
|
+
|
|
114
|
+
## RAC-DIALOG-PROVIDER
|
|
115
|
+
|
|
116
|
+
`useAutoDialog()` ran outside `AutoDialogProvider`.
|
|
117
|
+
|
|
118
|
+
Fix: wrap that tree in `<AutoDialogProvider>`. `AutoConfigProvider` does not provide dialogs and is optional. The declarative `<AutoDialog open>` does not use this hook.
|
package/docs/i18n/de/README.md
CHANGED
|
@@ -12,10 +12,14 @@ Eine eigenständige, schema-getriebene Komponentenbibliothek für React 19 – m
|
|
|
12
12
|
|
|
13
13
|
## Projektstatus
|
|
14
14
|
|
|
15
|
-
Die aktuelle Version ist 0.1.
|
|
15
|
+
Die aktuelle Version ist 0.1.3, und die APIs können sich noch ändern. React 19 wird vorausgesetzt. Das Paket stellt ESM- und TypeScript-Deklarationen bereit. Der eingebaute Oberflächentext ist standardmäßig Englisch und kann über AutoConfigProvider.config.t übersetzt werden.
|
|
16
16
|
|
|
17
17
|
Installation mit `pnpm add @zeroman.yang/react-auto-components` (npm und yarn funktionieren ebenso). Peer Dependencies sind React 19 und react-dom 19. Importieren Sie das Stylesheet einmal: `import "@zeroman.yang/react-auto-components/style.css"`.
|
|
18
18
|
|
|
19
|
+
Importiere einmal im App-Einstieg `import "@zeroman.yang/react-auto-components/style.css"`. Ohne Stylesheet erscheint in der Entwicklung `RAC-CSS-MISSING`.
|
|
20
|
+
|
|
21
|
+
Beim XLSX-Export bedeutet `RAC-TABLE-XLSX`, dass der Adapter `exportXlsx` fehlt; `RAC-XLSX-DEP` bedeutet, dass die optionale Abhängigkeit `exceljs` nicht geladen werden konnte. Importiere und übergib den Adapter aus `@zeroman.yang/react-auto-components/xlsx`; installiere bei Bedarf mit `pnpm add exceljs`. CSV und JSON benötigen ihn nicht.
|
|
22
|
+
|
|
19
23
|
- [Live-Demo (GitHub Pages)](https://zeroman.github.io/react-auto-components/)
|
|
20
24
|
- [Mitwirken](https://github.com/Zeroman/react-auto-components/blob/main/docs/i18n/de/CONTRIBUTING.md)
|
|
21
25
|
- [Änderungsprotokoll](https://github.com/Zeroman/react-auto-components/blob/main/docs/i18n/de/CHANGELOG.md)
|
|
@@ -85,7 +89,7 @@ Der t-Callback erhält einen Nachrichtenschlüssel und einen Fallback-Text. Numm
|
|
|
85
89
|
| Komponente | Funktionen |
|
|
86
90
|
| --- | --- |
|
|
87
91
|
| AutoForm | Native Feldtypen, virtualisierte Optionen, kaskadierende Auswahl, Upload-Adapter, benutzerdefinierte Darstellung, abhängige Felder, bedingte Sichtbarkeit, asynchrone Validierung, kontrollierter Zustand, Erhalt von Eingaben nach Fehlern |
|
|
88
|
-
|
|
|
92
|
+
| AutoSearch | Einfache/erweiterte Bedingungen, manuelle/sofortige Suche, Zurücksetzen, Sortier-Tags, gemeinsamer Abfrage-AST und RSQL-Serialisierung |
|
|
89
93
|
| AutoTable | Lokale/entfernte Daten, Mehrspaltensortierung, Spaltenfilter, Paginierung, stabile Auswahl, Virtualisierung, Aufklappen von Bäumen/Details, Zusammenfassungen, verbundene Zellen, CRUD, Kontextmenüs und Kopieren |
|
|
90
94
|
| AutoDialog | Deklarative/imperative APIs, isolierte Provider, Entwürfe, Schließschutz, Fokusverwaltung, Ziehen, Vollbild und asynchrones Absenden |
|
|
91
95
|
| AutoTabs | Horizontale/vertikale Layouts, Verschachtelung, Berechtigungen, deaktivierte Tabs, Erhalt des Panelzustands und Aktualisierung |
|
|
@@ -201,3 +205,5 @@ Formulare unterstützen `resetLabel`, `extraActions` und `onReset`; Suchpanels u
|
|
|
201
205
|
AutoChat bietet ein leichtgewichtiges Unterhaltungs-Layout mit Stream-Follow, Verlaufsladen und einem Eingabebereich. Für das Rendern der Nachrichten übergibst du React-Inhalte oder renderMessage; zusätzliche Laufzeit-Abhängigkeiten sind nicht erforderlich.
|
|
202
206
|
|
|
203
207
|
[AutoChat API](auto-chat.md)
|
|
208
|
+
|
|
209
|
+
Was die Komponente tut, wenn ein Callback wirft: [AutoForm](auto-form.md), [AutoSearch](auto-search.md), [AutoTable](auto-table.md), [AutoDialog](auto-dialog.md), [AutoTabs](auto-tabs.md), [AutoMenu](auto-menu.md). Fehlercodes für Entwickler: [errors.md](errors.md).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# AutoDialog
|
|
2
|
+
|
|
3
|
+
[English](../../auto-dialog.md) | [简体中文](../zh-CN/auto-dialog.md) | [繁體中文](../zh-TW/auto-dialog.md) | [日本語](../ja/auto-dialog.md) | [한국어](../ko/auto-dialog.md) | [Español](../es/auto-dialog.md) | [Français](../fr/auto-dialog.md) | **Deutsch** | [Português (Brasil)](../pt-BR/auto-dialog.md) | [Русский](../ru/auto-dialog.md)
|
|
4
|
+
|
|
5
|
+
Modaldialog, deklarativ (`<AutoDialog open>`) oder imperativ (`useAutoDialog().open()`). `fields` zeichnet ein [AutoForm](auto-form.md).
|
|
6
|
+
|
|
7
|
+
`useAutoDialog()` außerhalb des Providers wirft `RAC-DIALOG-PROVIDER`. `<AutoDialog open>` braucht den Provider nicht.
|
|
8
|
+
|
|
9
|
+
## Verhalten und Props
|
|
10
|
+
|
|
11
|
+
| Prop | Verhalten |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `onSubmit(values)` | Nach der Prüfung. **Ablehnen oder werfen: der Dialog bleibt offen, zeigt `error.message`, Werte bleiben.** Nach resolve läuft `beforeClose` noch. |
|
|
14
|
+
| `beforeClose(reason)` | `"submit"`, `"cancel"` oder `"close"`. **`false` lässt ihn offen. Werfen lässt ihn ebenfalls offen und zeigt die Meldung.** |
|
|
15
|
+
| `onClose` | Nur nachdem wirklich geschlossen wurde. |
|
|
16
|
+
| `draftKey` | Speichert den Entwurf unter `${namespace}:draft:${draftKey}`, bis das Absenden gelingt. Weggelassen wird nichts gespeichert. |
|
|
17
|
+
| `width` | Standard `560`. `draggable` wird im Vollbild ignoriert. |
|
|
18
|
+
|
|
19
|
+
`close()` von `open()` resolved `false`, wenn `beforeClose` das Schließen blockiert. Imperative Dialoge stapeln sich.
|
|
20
|
+
|
|
21
|
+
## Voraussetzungen
|
|
22
|
+
|
|
23
|
+
`style.css` einmal importieren. `AutoConfigProvider` ist optional und ersetzt `AutoDialogProvider` nicht. `namespace` gehört zum Entwurfsschlüssel.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# AutoForm
|
|
2
|
+
|
|
3
|
+
[English](../../auto-form.md) | [简体中文](../zh-CN/auto-form.md) | [繁體中文](../zh-TW/auto-form.md) | [日本語](../ja/auto-form.md) | [한국어](../ko/auto-form.md) | [Español](../es/auto-form.md) | [Français](../fr/auto-form.md) | **Deutsch** | [Português (Brasil)](../pt-BR/auto-form.md) | [Русский](../ru/auto-form.md)
|
|
4
|
+
|
|
5
|
+
Schema-Formular. `AutoSearch` und `AutoDialog` zeichnen ein `AutoForm`, deshalb gelten diese Callback-Regeln auch dort.
|
|
6
|
+
|
|
7
|
+
`Field<T>` ist eine nach `type` unterschiedene Union. `select` ohne `options`, ein Skalar bei `daterange` und `match: "between"` auf einem Skalar sind TypeScript-Fehler. `AnyField` und `unsafeField()` sind der Ausweg; der Entwicklungsmodus warnt weiter. Codes in [errors.md](errors.md).
|
|
8
|
+
|
|
9
|
+
## Verhalten und Props
|
|
10
|
+
|
|
11
|
+
| Prop | Verhalten |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `fields` | `readonly Field<T>[]`. Ohne `type` ist es ein Textfeld. Ein doppelter `name` wirft beim Einhängen `RAC-FIELD-DUPLICATE`. |
|
|
14
|
+
| `value` | Kontrollierter Wert. Weicht er vom inneren Zustand ab, kopiert das Formular ihn und löscht Fehler. Ignoriert der Parent `onChange`, springt die Eingabe zurück. |
|
|
15
|
+
| `onSubmit(value)` | Nur nach bestandener Prüfung. **Ablehnen oder werfen: Werte bleiben, `error.message` wird gezeigt, kein Reset.** |
|
|
16
|
+
| `columns` | Standard `2`. `actions` Standard `true`. |
|
|
17
|
+
| Beschriftung | `labelPosition` Standard `"top"`. `labelWidth` Standard `"auto"` (gemessen, höchstens 45 % der Feldbreite). |
|
|
18
|
+
|
|
19
|
+
## Wenn ein Callback wirft
|
|
20
|
+
|
|
21
|
+
| Callback | Ergebnis |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| `onSubmit` | Gefangen. Entwurf bleibt. Meldung wird gezeigt. Kein Reset. |
|
|
24
|
+
| Feld-`rules` | Die geworfene Meldung wird der Feldfehler. Spätere Regeln laufen nicht. |
|
|
25
|
+
| Feld-`onChange` | Nicht gefangen. Der vorige Wert bleibt. |
|
|
26
|
+
| `upload` | Ablehnung steht unter dem Feld, nichts wird gespeichert. `reset()` bricht das Signal ab und verwirft ein spätes Ergebnis. |
|
|
27
|
+
| Absenden während eines Uploads | `validate()` liefert `false` und ruft `onSubmit` nicht auf. |
|
|
28
|
+
| `hidden`, `disabled` oder ohne Zugriff | Dieses Feld wird nicht geprüft, auch wenn es `required` ist. |
|
|
29
|
+
| Leeres `required` | `undefined`, `null`, `""` oder ein leeres Array blockieren das Absenden. |
|
|
30
|
+
|
|
31
|
+
`handle.validate()` resolved `true` oder `false`. Es wirft nicht.
|
|
32
|
+
|
|
33
|
+
## Voraussetzungen
|
|
34
|
+
|
|
35
|
+
`style.css` einmal importieren. Fehlt `--auto-text`, warnt die Entwicklung mit `RAC-CSS-MISSING`. `AutoConfigProvider` ist optional und mountet keine Dialoge.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# AutoMenu
|
|
2
|
+
|
|
3
|
+
[English](../../auto-menu.md) | [简体中文](../zh-CN/auto-menu.md) | [繁體中文](../zh-TW/auto-menu.md) | [日本語](../ja/auto-menu.md) | [한국어](../ko/auto-menu.md) | [Español](../es/auto-menu.md) | [Français](../fr/auto-menu.md) | **Deutsch** | [Português (Brasil)](../pt-BR/auto-menu.md) | [Русский](../ru/auto-menu.md)
|
|
4
|
+
|
|
5
|
+
Seitenleiste. Für Panels [AutoTabs](auto-tabs.md).
|
|
6
|
+
|
|
7
|
+
## Verhalten und Props
|
|
8
|
+
|
|
9
|
+
| Prop | Verhalten |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `items` | `id` ist im Baum eindeutig. `hidden` und ein gescheitertes `canAccess` verwerfen den Eintrag. Ein `children`, das auf einen Vorfahren zeigt, wird ganz verworfen, damit ein schlechtes Schema nicht rekursiert. |
|
|
12
|
+
| `value` | Id des gewählten Blatts. Weggelassen bleibt die Auswahl intern. |
|
|
13
|
+
| `onChange(id, item, path)` | **Nicht gefangen.** `path` ist die id-Kette von der Wurzel zum Blatt. Ein Elternteil mit Kindern schaltet nur die Aufklappung um und wird nicht gewählt. |
|
|
14
|
+
| `collapsible` | Standard `false`. Ist `collapsed` kontrolliert, musst du es in `onCollapsedChange` selbst setzen, sonst bewegt sich die Leiste nicht. **`onCollapsedChange` wird nicht gefangen.** |
|
|
15
|
+
| `disabled` | Deaktiviert den Eintrag und seine Nachkommen. Die Auswahl überspringt sie. |
|
|
16
|
+
|
|
17
|
+
Ein Blatt zu wählen navigiert nicht von selbst. Das einzige Signal ist `onChange`.
|
|
18
|
+
|
|
19
|
+
## Voraussetzungen
|
|
20
|
+
|
|
21
|
+
`style.css` einmal importieren. `AutoConfigProvider` ist optional. Rechte laufen über `config.canAccess`.
|
|
22
|
+
|
|
23
|
+
Importiere einmal im App-Einstieg `import "@zeroman.yang/react-auto-components/style.css"`. Ohne Stylesheet erscheint in der Entwicklung `RAC-CSS-MISSING`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# AutoSearch
|
|
2
|
+
|
|
3
|
+
[English](../../auto-search.md) | [简体中文](../zh-CN/auto-search.md) | [繁體中文](../zh-TW/auto-search.md) | [日本語](../ja/auto-search.md) | [한국어](../ko/auto-search.md) | [Español](../es/auto-search.md) | [Français](../fr/auto-search.md) | **Deutsch** | [Português (Brasil)](../pt-BR/auto-search.md) | [Русский](../ru/auto-search.md)
|
|
4
|
+
|
|
5
|
+
Suchformular. Es zeichnet ein `AutoForm` und gibt einen `QueryNode` plus die Werte aus. Wirft ein Feld-Callback, gelten die Regeln von [AutoForm](auto-form.md).
|
|
6
|
+
|
|
7
|
+
`AutoSearchPanel` und `AutoSearchPanelProps` sind veraltete Aliase von `AutoSearch` und `AutoSearchProps`.
|
|
8
|
+
|
|
9
|
+
## Verhalten und Props
|
|
10
|
+
|
|
11
|
+
| Prop | Verhalten |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `onSearch(query, values)` | Pflicht. **Werfen oder ablehnen: das innere Formular fängt es, Werte bleiben, `error.message` wird gezeigt. Kein Reset.** |
|
|
14
|
+
| `mode` | Standard `"manual"` (Schaltfläche). `"instant"` sucht auch bei jeder Änderung. |
|
|
15
|
+
| `columns` | Standard `3`. |
|
|
16
|
+
| `more: true` | Versteckt das Feld, bis „Mehr“ geöffnet wird. Versteckte Felder fehlen in der Abfrage. |
|
|
17
|
+
|
|
18
|
+
| `match` | Wert |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| weggelassen | `"eq"`, oder `"in"` wenn der Wert ein Array ist. |
|
|
21
|
+
| `"contains"` | Teilstring. `ignoreCase: true` ignoriert Großschreibung. |
|
|
22
|
+
| `"between"` | `[from, to]`. Ein Skalar warnt `RAC-FIELD-BETWEEN` und trifft keine Zeile. |
|
|
23
|
+
| `"isNull"` | Trifft null oder undefined. Der eingegebene Wert wird ignoriert. |
|
|
24
|
+
| leer | `undefined`, `null`, `""` und leere Arrays entfallen, außer `"isNull"`. |
|
|
25
|
+
|
|
26
|
+
Reset stellt `defaultValue` wieder her und sucht dann. `serializeRsql` wirft `RAC-QUERY-FIELD`, wenn der Name nicht `/^[\w.]+$/` ist.
|
|
27
|
+
|
|
28
|
+
## Voraussetzungen
|
|
29
|
+
|
|
30
|
+
`style.css` einmal importieren. `AutoConfigProvider` ist optional.
|
|
31
|
+
|
|
32
|
+
Importiere einmal im App-Einstieg `import "@zeroman.yang/react-auto-components/style.css"`. Ohne Stylesheet erscheint in der Entwicklung `RAC-CSS-MISSING`.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# AutoTable
|
|
2
|
+
|
|
3
|
+
[English](../../auto-table.md) | [简体中文](../zh-CN/auto-table.md) | [繁體中文](../zh-TW/auto-table.md) | [日本語](../ja/auto-table.md) | [한국어](../ko/auto-table.md) | [Español](../es/auto-table.md) | [Français](../fr/auto-table.md) | **Deutsch** | [Português (Brasil)](../pt-BR/auto-table.md) | [Русский](../ru/auto-table.md)
|
|
4
|
+
|
|
5
|
+
Lokale oder entfernte Tabelle. Übergib genau eine Variante: `data`, `dataSource` oder `source`. Mehrere zugleich sind ein Typfehler. Suche folgt [AutoSearch](auto-search.md). Anlegen und Bearbeiten folgen [AutoDialog](auto-dialog.md) und [AutoForm](auto-form.md).
|
|
6
|
+
|
|
7
|
+
`exportXlsx` kommt aus `@zeroman.yang/react-auto-components/xlsx`. `exceljs` ist optional (`RAC-XLSX-DEP`, wenn es fehlt).
|
|
8
|
+
|
|
9
|
+
## Verhalten und Props
|
|
10
|
+
|
|
11
|
+
| Prop | Verhalten |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `id` | Pflicht. Schlüssel ist `${namespace}:table:${id}`. Leer warnt `RAC-TABLE-ID`. |
|
|
14
|
+
| `rowKey` | Eindeutig in den geladenen Zeilen. Fehlend oder doppelt: `RAC-TABLE-ROWID`. Auswahl, Aufklappen und `scrollToRow` nutzen ihn. |
|
|
15
|
+
| `dataSource` | **Ablehnen: Meldung und Wiederholen-Schaltfläche. Abbruch wird ignoriert.** `total` ist die gesamte gefilterte Anzahl, nicht die Seitenlänge. |
|
|
16
|
+
| `pageSize` | Standard `10`. `pagination` Standard `true`. `height` Standard `440`. `"auto"` füllt einen Elternteil, der schon eine Höhe hat. |
|
|
17
|
+
| `onAdd`, `onEdit`, `onDelete` | **Ablehnen oder werfen: der Dialog bleibt offen und zeigt `error.message`.** Zeilen ändern sich nur, wenn dein Handler sie schon geändert hat. |
|
|
18
|
+
| `rowActions` | Eine Ablehnung von `onClick` wird abgefangen und etwa 2,5 Sekunden in der Statuszeile angezeigt. Die Zeile bleibt erhalten. Fehlt einer Zeilenaktion `onClick` und ist `action` kein bekannter Schlüssel in `config.rowActions`, zeigt die Statuszeile beim Auswählen `RAC-ROW-ACTION`. Übergib `onClick` oder registriere den Schlüssel für `action`. Sind beide gesetzt, hat `onClick` Vorrang. |
|
|
19
|
+
| `component` | Ist der Spaltenwert `component` nicht in `AutoConfigProvider` unter `config.columns` registriert, erscheint in der Entwicklung `RAC-COLUMN-COMPONENT`; die Zelle verwendet das Standardformat. Registriere den Schlüssel oder setze `render`, `format` oder `sort` auf der Spalte. Funktionen auf der Spalte haben Vorrang. |
|
|
20
|
+
| `source` | `source` bezeichnet einen Schlüssel in `AutoConfigProvider` unter `config.sources`. Ein unbekannter Schlüssel zeigt `RAC-TABLE-SOURCE` mit einer Schaltfläche zum Wiederholen. Registriere ihn oder verwende `data` / `dataSource`. Übergib genau eine der drei Varianten. |
|
|
21
|
+
| `exportXlsx` | Nur für xlsx nötig. Fehlt er, `RAC-TABLE-XLSX`. CSV und JSON sind eingebaut. |
|
|
22
|
+
|
|
23
|
+
`handle.export` resolved auch wenn der Status einen Fehler zeigt; er wirft nicht erneut. Entferntes `"filtered"` geht alle Seiten durch. Eine leere Seite vor der letzten wirft `RAC-TABLE-EXPORT-PAGE` und lädt keine halbe Datei herunter.
|
|
24
|
+
|
|
25
|
+
Ungültiges Filter-JSON zeigt den übersetzten Text, warnt `RAC-TABLE-FILTER` und behält den vorigen Filter. `between` hat die Länge 2. `in` ist ein Array.
|
|
26
|
+
|
|
27
|
+
`handle.reset()` löscht Sortierung, Filter und Auswahl und setzt das Layout auf die Spalten zurück. `scrollToRow` tut nichts, wenn die id nicht geladen ist.
|
|
28
|
+
|
|
29
|
+
## Voraussetzungen
|
|
30
|
+
|
|
31
|
+
`style.css` einmal importieren. Trenne `namespace`, wenn mehrere Apps derselben Origin Tabellen speichern; Standard ist `"auto"`. Die eingebauten Dialoge zum Anlegen und Bearbeiten brauchen kein `AutoDialogProvider`. Nur `useAutoDialog()` braucht es.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# AutoTabs
|
|
2
|
+
|
|
3
|
+
[English](../../auto-tabs.md) | [简体中文](../zh-CN/auto-tabs.md) | [繁體中文](../zh-TW/auto-tabs.md) | [日本語](../ja/auto-tabs.md) | [한국어](../ko/auto-tabs.md) | [Español](../es/auto-tabs.md) | [Français](../fr/auto-tabs.md) | **Deutsch** | [Português (Brasil)](../pt-BR/auto-tabs.md) | [Русский](../ru/auto-tabs.md)
|
|
4
|
+
|
|
5
|
+
Reiter. Verschachtelte Reiter sind ein weiteres `AutoTabs` aus `children`. Für eine Seitenleiste [AutoMenu](auto-menu.md).
|
|
6
|
+
|
|
7
|
+
## Verhalten und Props
|
|
8
|
+
|
|
9
|
+
| Prop | Verhalten |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `items` | Jeder Reiter braucht eine stabile `id`. `hidden` und ein gescheitertes `canAccess` entfernen ihn. |
|
|
12
|
+
| `value` | Kontrollierter id-Pfad von der Wurzel. Verschachtelt ist `["parent", "child"]`. |
|
|
13
|
+
| `onChange(path, item)` | **Nicht gefangen.** Wirft er, meldet React den Fehler. Im kontrollierten Modus bleibt der noch nicht übernommene Pfad beim vorigen. |
|
|
14
|
+
| `mode` | Standard `"horizontal"`. `"vertical"` stapelt die Liste. |
|
|
15
|
+
| `keepMounted` | Standard `true`: inaktive Panels bleiben eingehängt. `false` hängt sie aus. |
|
|
16
|
+
| `onRefresh` | Wenn gesetzt, gibt es eine Aktualisieren-Schaltfläche. **Nicht gefangen.** |
|
|
17
|
+
| `disabled` | Bleibt sichtbar und ist nicht wählbar. Die Standardauswahl überspringt deaktivierte Reiter. |
|
|
18
|
+
|
|
19
|
+
## Voraussetzungen
|
|
20
|
+
|
|
21
|
+
`style.css` einmal importieren (`RAC-CSS-MISSING` in der Entwicklung). `AutoConfigProvider` ist optional.
|
|
22
|
+
|
|
23
|
+
## Dynamische Tabs
|
|
24
|
+
|
|
25
|
+
`useAutoTabsWorkspace` öffnet und schließt Seiten ohne Router. Geben Sie `tabsProps` an `AutoTabs` weiter. `open` mit derselben id wählt nur diesen Tab und behält den Entwurf. Ein angehefteter Tab lässt sich nicht schließen. Warten Sie auf `ready`, bevor Sie `open` aufrufen. Auswahl, `params` und `state` kommen nach dem Mount aus `sessionStorage` zurück. Gibt `beforeClose` `false` zurück oder wirft es, bleibt der Tab offen. Das Beispiel steht in [DynamicTabsDemo.tsx](../../../test-project/src/examples/DynamicTabsDemo.tsx).
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Fehlercodes
|
|
2
|
+
|
|
3
|
+
[English](../../errors.md) | [简体中文](../zh-CN/errors.md) | [繁體中文](../zh-TW/errors.md) | [日本語](../ja/errors.md) | [한국어](../ko/errors.md) | [Español](../es/errors.md) | [Français](../fr/errors.md) | **Deutsch** | [Português (Brasil)](../pt-BR/errors.md) | [Русский](../ru/errors.md)
|
|
4
|
+
|
|
5
|
+
Entwicklerfehler werfen `RacError` oder rufen in der Entwicklung `console.warn` auf. Der Text ist immer Englisch.
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
[Component] what is wrong.
|
|
9
|
+
Fix: what to change.
|
|
10
|
+
Code: RAC-…
|
|
11
|
+
Docs: https://github.com/Zeroman/react-auto-components/blob/main/docs/errors.md#rac-…
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Oberflächentext bleibt bei `config.t`. `userKey` ist der englische Quellsatz, den der Host übersetzt. Konsole und Ausnahme bleiben Englisch.
|
|
15
|
+
|
|
16
|
+
## RAC-FIELD-OPTIONS
|
|
17
|
+
|
|
18
|
+
`type` ist `select`, `select-v2`, `radio`, `checkbox` oder `cascader`, und `options` fehlt oder ist leer.
|
|
19
|
+
|
|
20
|
+
Korrektur: Übergib `options` als Array oder `(values) => Option[]`. `autocomplete` darf sie weglassen.
|
|
21
|
+
|
|
22
|
+
## RAC-FIELD-RANGE
|
|
23
|
+
|
|
24
|
+
`daterange` oder `datetimerange` hat keinen Zwei-Element-Wert.
|
|
25
|
+
|
|
26
|
+
Korrektur: Typisiere das Feld als `[start, end]`. `dateValue` ist standardmäßig `"string"`. `"timestamp"` speichert lokale Millisekunden. `null` lässt das Ende offen. Ein Skalar ist ein TypeScript-Fehler. Ein Array im Modell kompiliert; die Entwicklung warnt, wenn die echte Länge nicht 2 ist.
|
|
27
|
+
|
|
28
|
+
## RAC-FIELD-BETWEEN
|
|
29
|
+
|
|
30
|
+
`match: "between"` ist nicht `[from, to]`.
|
|
31
|
+
|
|
32
|
+
Korrektur: Speichere ein Paar. Ein Skalar trifft keine Zeile. Auf `Field<T>` ist das ebenfalls ein Typfehler.
|
|
33
|
+
|
|
34
|
+
## RAC-FIELD-CUSTOM
|
|
35
|
+
|
|
36
|
+
`type: "custom"` hat weder `render` noch `component`.
|
|
37
|
+
|
|
38
|
+
Korrektur: Übergib `render(context)` oder einen `component`-Schlüssel aus `config.fields`.
|
|
39
|
+
|
|
40
|
+
## RAC-FIELD-DUPLICATE
|
|
41
|
+
|
|
42
|
+
Zwei Felder teilen sich `name`. `defaults` wirft beim Einhängen.
|
|
43
|
+
|
|
44
|
+
Korrektur: Eindeutige Namen. `title`, `tip`, `append` und `button` haben keinen Namen.
|
|
45
|
+
|
|
46
|
+
## RAC-CSS-MISSING
|
|
47
|
+
|
|
48
|
+
In der Entwicklung fehlt `--auto-text` auf `:root`. Ohne Stylesheet wirkt die Seite kaputt, und das DOM sagt nicht warum.
|
|
49
|
+
|
|
50
|
+
Korrektur: Einmal: `import "@zeroman.yang/react-auto-components/style.css"`.
|
|
51
|
+
|
|
52
|
+
## RAC-TABLE-XLSX
|
|
53
|
+
|
|
54
|
+
`export("xlsx")` ohne `exportXlsx`.
|
|
55
|
+
|
|
56
|
+
Korrektur: Importiere `{ exportXlsx }` aus `@zeroman.yang/react-auto-components/xlsx`. Die Oberfläche zeigt den übersetzten Satz.
|
|
57
|
+
|
|
58
|
+
## RAC-XLSX-DEP
|
|
59
|
+
|
|
60
|
+
`exceljs` ließ sich nicht laden. Es ist eine `optionalDependency`.
|
|
61
|
+
|
|
62
|
+
Korrektur: `pnpm add exceljs`. CSV und JSON brauchen es nicht.
|
|
63
|
+
|
|
64
|
+
## RAC-TABLE-EXPORT-PAGE
|
|
65
|
+
|
|
66
|
+
Eine entfernte Seite war vor der letzten leer. Es wird keine halbe Datei gespeichert.
|
|
67
|
+
|
|
68
|
+
Korrektur: Gib ein stabiles `total` und die Zeilen dieser `pageIndex` zurück.
|
|
69
|
+
|
|
70
|
+
## RAC-TABLE-ROWID
|
|
71
|
+
|
|
72
|
+
`rowKey` fehlt oder wiederholt sich in den geladenen Zeilen.
|
|
73
|
+
|
|
74
|
+
Korrektur: Jede Zeile braucht einen stabilen eindeutigen String.
|
|
75
|
+
|
|
76
|
+
## RAC-TABLE-ID
|
|
77
|
+
|
|
78
|
+
`id` ist leer. Der Schlüssel wäre `${namespace}:table:`.
|
|
79
|
+
|
|
80
|
+
Korrektur: Gib pro Tabelle eine stabile id.
|
|
81
|
+
|
|
82
|
+
## RAC-COLUMN-COMPONENT
|
|
83
|
+
|
|
84
|
+
Ist der Spaltenwert `component` nicht in `AutoConfigProvider` unter `config.columns` registriert, erscheint in der Entwicklung `RAC-COLUMN-COMPONENT`; die Zelle verwendet das Standardformat. Registriere den Schlüssel oder setze `render`, `format` oder `sort` auf der Spalte. Funktionen auf der Spalte haben Vorrang.
|
|
85
|
+
|
|
86
|
+
## RAC-ROW-ACTION
|
|
87
|
+
|
|
88
|
+
Fehlt einer Zeilenaktion `onClick` und ist `action` kein bekannter Schlüssel in `config.rowActions`, zeigt die Statuszeile beim Auswählen `RAC-ROW-ACTION`. Übergib `onClick` oder registriere den Schlüssel für `action`. Sind beide gesetzt, hat `onClick` Vorrang.
|
|
89
|
+
|
|
90
|
+
## RAC-TABLE-SOURCE
|
|
91
|
+
|
|
92
|
+
`source` bezeichnet einen Schlüssel in `AutoConfigProvider` unter `config.sources`. Ein unbekannter Schlüssel zeigt `RAC-TABLE-SOURCE` mit einer Schaltfläche zum Wiederholen. Registriere ihn oder verwende `data` / `dataSource`. Übergib genau eine der drei Varianten.
|
|
93
|
+
|
|
94
|
+
## RAC-TABLE-FILTER
|
|
95
|
+
|
|
96
|
+
Das Filter-JSON ist keine Abfrage. Der übersetzte Text erscheint, der vorige Filter bleibt.
|
|
97
|
+
|
|
98
|
+
Korrektur: Gruppe `{ kind: "group", operator, children }`. Bedingung `{ kind: "condition", field, operator, value }`. `between` ist `[from, to]`.
|
|
99
|
+
|
|
100
|
+
## RAC-QUERY-FIELD
|
|
101
|
+
|
|
102
|
+
`serializeRsql` lehnt einen Namen außerhalb `/^[\\w.]+$/` ab.
|
|
103
|
+
|
|
104
|
+
Korrektur: Nur Buchstaben, Ziffern, Unterstrich und Punkte.
|
|
105
|
+
|
|
106
|
+
## RAC-DIALOG-PROVIDER
|
|
107
|
+
|
|
108
|
+
`useAutoDialog()` außerhalb von `AutoDialogProvider`.
|
|
109
|
+
|
|
110
|
+
Korrektur: Umschließe den Baum mit `<AutoDialogProvider>`. `AutoConfigProvider` liefert keine Dialoge und ist optional. `<AutoDialog open>` nutzt diesen Hook nicht.
|
package/docs/i18n/es/README.md
CHANGED
|
@@ -12,10 +12,14 @@ Una biblioteca de componentes independiente y basada en esquemas para React 19,
|
|
|
12
12
|
|
|
13
13
|
## Estado del proyecto
|
|
14
14
|
|
|
15
|
-
La versión actual es 0.1.
|
|
15
|
+
La versión actual es 0.1.3 y las API aún pueden cambiar. Se requiere React 19. El paquete proporciona declaraciones ESM y de TypeScript. El texto integrado de la interfaz tiene el inglés como idioma predeterminado y puede traducirse mediante AutoConfigProvider.config.t.
|
|
16
16
|
|
|
17
17
|
Instálalo con `pnpm add @zeroman.yang/react-auto-components` (npm y yarn funcionan igual). Las peer dependencies son React 19 y react-dom 19. Importa la hoja de estilos una vez: `import "@zeroman.yang/react-auto-components/style.css"`.
|
|
18
18
|
|
|
19
|
+
Importa una vez en la entrada de la aplicación `import "@zeroman.yang/react-auto-components/style.css"`. Si falta la hoja de estilos, el desarrollo avisa con `RAC-CSS-MISSING`.
|
|
20
|
+
|
|
21
|
+
En la exportación XLSX, `RAC-TABLE-XLSX` indica que falta el adaptador `exportXlsx`; `RAC-XLSX-DEP` indica que no se pudo cargar la dependencia opcional `exceljs`. Importa y pasa el adaptador desde `@zeroman.yang/react-auto-components/xlsx`; instala con `pnpm add exceljs` cuando sea necesario. CSV y JSON no lo necesitan.
|
|
22
|
+
|
|
19
23
|
- [Demo en vivo (GitHub Pages)](https://zeroman.github.io/react-auto-components/)
|
|
20
24
|
- [Contribuir](https://github.com/Zeroman/react-auto-components/blob/main/docs/i18n/es/CONTRIBUTING.md)
|
|
21
25
|
- [Registro de cambios](https://github.com/Zeroman/react-auto-components/blob/main/docs/i18n/es/CHANGELOG.md)
|
|
@@ -85,7 +89,7 @@ La función de devolución de llamada t recibe una clave de mensaje y un texto a
|
|
|
85
89
|
| Componente | Capacidades |
|
|
86
90
|
| --- | --- |
|
|
87
91
|
| AutoForm | Tipos de campo nativos, opciones virtualizadas, selección en cascada, adaptadores de carga, renderizado personalizado, campos dependientes, visibilidad condicional, validación asíncrona, estado controlado y conservación de los datos introducidos tras errores |
|
|
88
|
-
|
|
|
92
|
+
| AutoSearch | Condiciones básicas/avanzadas, búsqueda manual/instantánea, restablecimiento, etiquetas de ordenación, un AST de consulta compartido y serialización RSQL |
|
|
89
93
|
| AutoTable | Datos locales/remotos, ordenación por varias columnas, filtros de columna, paginación, selección estable, virtualización, expansión de árboles/detalles, resúmenes, celdas combinadas, CRUD, menús contextuales y copia |
|
|
90
94
|
| AutoDialog | API declarativas/imperativas, proveedores aislados, borradores, protección de cierre, gestión del foco, arrastre, pantalla completa y envío asíncrono |
|
|
91
95
|
| AutoTabs | Diseños horizontales/verticales, anidamiento, permisos, pestañas deshabilitadas, conservación del estado de los paneles y actualización |
|
|
@@ -201,3 +205,5 @@ Los formularios admiten `resetLabel`, `extraActions` y `onReset`; los paneles de
|
|
|
201
205
|
AutoChat proporciona una disposición de conversación ligera con seguimiento automático del streaming, carga del historial y un área de redacción. Usa contenido de React o renderMessage para renderizar los mensajes; no se necesitan dependencias adicionales en tiempo de ejecución.
|
|
202
206
|
|
|
203
207
|
[AutoChat API](auto-chat.md)
|
|
208
|
+
|
|
209
|
+
Qué hace el componente si un callback lanza: [AutoForm](auto-form.md), [AutoSearch](auto-search.md), [AutoTable](auto-table.md), [AutoDialog](auto-dialog.md), [AutoTabs](auto-tabs.md), [AutoMenu](auto-menu.md). Códigos de error para desarrolladores: [errors.md](errors.md).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# AutoDialog
|
|
2
|
+
|
|
3
|
+
[English](../../auto-dialog.md) | [简体中文](../zh-CN/auto-dialog.md) | [繁體中文](../zh-TW/auto-dialog.md) | [日本語](../ja/auto-dialog.md) | [한국어](../ko/auto-dialog.md) | **Español** | [Français](../fr/auto-dialog.md) | [Deutsch](../de/auto-dialog.md) | [Português (Brasil)](../pt-BR/auto-dialog.md) | [Русский](../ru/auto-dialog.md)
|
|
4
|
+
|
|
5
|
+
Diálogo modal, declarativo (`<AutoDialog open>`) o imperativo (`useAutoDialog().open()`). `fields` dibuja un [AutoForm](auto-form.md).
|
|
6
|
+
|
|
7
|
+
`useAutoDialog()` fuera del proveedor lanza `RAC-DIALOG-PROVIDER`. `<AutoDialog open>` no necesita el proveedor.
|
|
8
|
+
|
|
9
|
+
## Comportamiento y props
|
|
10
|
+
|
|
11
|
+
| Prop | Comportamiento |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `onSubmit(values)` | Tras validar. **Rechazar o lanzar: el diálogo sigue abierto, muestra `error.message` y los valores se quedan.** Después de resolver sigue corriendo `beforeClose`. |
|
|
14
|
+
| `beforeClose(reason)` | `"submit"`, `"cancel"` o `"close"`. **`false` lo deja abierto. Lanzar también lo deja abierto y muestra el mensaje.** |
|
|
15
|
+
| `onClose` | Solo después de cerrar de verdad. |
|
|
16
|
+
| `draftKey` | Guarda el borrador en `${namespace}:draft:${draftKey}` hasta un envío correcto. Si se omite, no se guarda nada. |
|
|
17
|
+
| `width` | Por defecto `560`. `draggable` se ignora a pantalla completa. |
|
|
18
|
+
|
|
19
|
+
`close()` de `open()` resuelve `false` si `beforeClose` bloquea el cierre. Los diálogos imperativos se apilan.
|
|
20
|
+
|
|
21
|
+
## Precondiciones
|
|
22
|
+
|
|
23
|
+
Importa `style.css` una vez. `AutoConfigProvider` es opcional y no sustituye a `AutoDialogProvider`. `namespace` forma parte de la clave del borrador.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# AutoForm
|
|
2
|
+
|
|
3
|
+
[English](../../auto-form.md) | [简体中文](../zh-CN/auto-form.md) | [繁體中文](../zh-TW/auto-form.md) | [日本語](../ja/auto-form.md) | [한국어](../ko/auto-form.md) | **Español** | [Français](../fr/auto-form.md) | [Deutsch](../de/auto-form.md) | [Português (Brasil)](../pt-BR/auto-form.md) | [Русский](../ru/auto-form.md)
|
|
4
|
+
|
|
5
|
+
Formulario por esquema. `AutoSearch` y `AutoDialog` dibujan un `AutoForm`, así que estas reglas de callbacks también valen para ellos.
|
|
6
|
+
|
|
7
|
+
`Field<T>` es una unión discriminada por `type`. Un `select` sin `options`, un escalar en `daterange` y `match: "between"` sobre un escalar son errores de TypeScript. `AnyField` y `unsafeField()` son la salida; el modo desarrollo sigue avisando. Códigos en [errors.md](errors.md).
|
|
8
|
+
|
|
9
|
+
## Comportamiento y props
|
|
10
|
+
|
|
11
|
+
| Prop | Comportamiento |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `fields` | `readonly Field<T>[]`. Sin `type` es un texto. Un `name` duplicado lanza `RAC-FIELD-DUPLICATE` al montar. |
|
|
14
|
+
| `value` | Valor controlado. Si difiere del estado interno, el formulario lo copia y limpia errores. Si el padre ignora `onChange`, el input vuelve atrás. |
|
|
15
|
+
| `onSubmit(value)` | Solo tras validar. **Rechazar o lanzar: los valores se quedan, se muestra `error.message` y no hay reset.** |
|
|
16
|
+
| `columns` | Por defecto `2`. `actions` por defecto `true`. |
|
|
17
|
+
| Etiquetas | `labelPosition` por defecto `"top"`. `labelWidth` por defecto `"auto"` (medido, tope 45% del campo). |
|
|
18
|
+
|
|
19
|
+
## Si un callback lanza
|
|
20
|
+
|
|
21
|
+
| Callback | Resultado |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| `onSubmit` | Se captura. El borrador se queda. Se muestra el mensaje. No hay reset. |
|
|
24
|
+
| `rules` del campo | El mensaje lanzado pasa a ser el error de ese campo. Las reglas siguientes no corren. |
|
|
25
|
+
| `onChange` del campo | No se captura. Queda el valor anterior. |
|
|
26
|
+
| `upload` | El rechazo se ve bajo el input y no se guarda valor. `reset()` aborta la señal y tira un resultado tardío. |
|
|
27
|
+
| Envío con una subida en curso | `validate()` devuelve `false` y no llama a `onSubmit`. |
|
|
28
|
+
| `hidden`, `disabled` o sin acceso | Ese campo no se valida, aunque sea `required`. |
|
|
29
|
+
| `required` vacío | `undefined`, `null`, `""` o un array vacío bloquean el envío. |
|
|
30
|
+
|
|
31
|
+
`handle.validate()` resuelve `true` o `false`. No lanza.
|
|
32
|
+
|
|
33
|
+
## Precondiciones
|
|
34
|
+
|
|
35
|
+
Importa `style.css` una vez. En desarrollo, si falta `--auto-text`, avisa `RAC-CSS-MISSING`. `AutoConfigProvider` es opcional y no monta diálogos.
|