@godxjp/ui 31.4.0 → 31.6.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/agent/START-HERE.md +6 -6
- package/agent/components/BranchScopePicker.json +5 -0
- package/agent/components/Cascader.json +1 -1
- package/agent/components/CodeBlock.json +7 -1
- package/agent/components/DataTable.json +2 -2
- package/agent/components/InfiniteQueryState.json +6 -1
- package/agent/components/OrgChart.json +59 -0
- package/agent/components/RangeTimeline.json +6 -0
- package/agent/components/RecordPicker.json +10 -0
- package/agent/components/Transfer.json +5 -0
- package/agent/components/Tree.json +21 -4
- package/agent/components/TreeSelect.json +1 -1
- package/agent/components-index.json +5 -0
- package/agent/components.json +123 -10
- package/agent/index.json +7 -7
- package/agent/llms.txt +7 -7
- package/agent/tokens.json +114 -0
- package/dist/components/data-display/code-block.js +90 -4
- package/dist/components/data-display/data-table.d.ts +3 -0
- package/dist/components/data-display/data-table.js +415 -370
- package/dist/components/data-display/index.d.ts +2 -0
- package/dist/components/data-display/index.js +2 -0
- package/dist/components/data-display/org-chart.d.ts +5 -0
- package/dist/components/data-display/org-chart.js +169 -0
- package/dist/components/data-display/range-timeline.d.ts +20 -0
- package/dist/components/data-display/range-timeline.js +217 -197
- package/dist/components/data-display/tree.js +179 -23
- package/dist/components/data-entry/branch-scope-picker.d.ts +1 -0
- package/dist/components/data-entry/branch-scope-picker.js +2 -1
- package/dist/components/data-entry/cascader.js +4 -5
- package/dist/components/data-entry/record-picker.d.ts +2 -0
- package/dist/components/data-entry/record-picker.js +22 -3
- package/dist/components/data-entry/transfer.d.ts +1 -1
- package/dist/components/data-entry/transfer.js +5 -2
- package/dist/components/data-entry/tree-select.js +14 -5
- package/dist/components/general/typography.d.ts +32 -0
- package/dist/components/general/typography.js +11 -2
- package/dist/components/query/infinite-query-state.d.ts +1 -1
- package/dist/components/query/infinite-query-state.js +2 -1
- package/dist/contracts/measurement.json +1 -1
- package/dist/i18n/messages/en.json +26 -2
- package/dist/i18n/messages/ja.json +17 -2
- package/dist/i18n/messages/vi.json +17 -2
- package/dist/lib/hooks.d.ts +8 -4
- package/dist/lib/hooks.js +5 -2
- package/dist/lib/tree.d.ts +23 -0
- package/dist/lib/tree.js +29 -0
- package/dist/props/components/data-display.prop.d.ts +72 -3
- package/dist/props/components/data-entry.prop.d.ts +31 -4
- package/dist/props/components/query.prop.d.ts +8 -1
- package/dist/props/registry.d.ts +63 -6
- package/dist/props/registry.js +90 -4
- package/dist/props/vocabulary/data.prop.d.ts +32 -2
- package/dist/props/vocabulary/index.d.ts +1 -1
- package/dist/styles/data-display-layout.css +225 -0
- package/dist/styles/layers.json +14 -1
- package/dist/styles/table-layout.css +16 -1
- package/dist/tokens/base.css +1 -0
- package/dist/tokens/components/org-chart.css +27 -0
- package/dist/tokens/components/tree.css +2 -0
- package/docs/FRAME-COVERAGE-REPORT.md +3 -2
- package/docs/data-display/code-block.tsx +27 -0
- package/docs/data-display/data-table/examples/server-paged.tsx +23 -0
- package/docs/data-display/data-table/index.md +2 -0
- package/docs/data-display/org-chart.tsx +165 -0
- package/docs/data-display/timeline.tsx +33 -0
- package/docs/data-display/tree.tsx +154 -0
- package/docs/data-entry/branch-scope-picker.tsx +6 -1
- package/docs/data-entry/record-picker.tsx +1 -0
- package/docs/data-entry/transfer.tsx +1 -0
- package/docs/i18n/messages/en.json +19 -0
- package/docs/i18n/messages/ja.json +18 -0
- package/docs/i18n/messages/vi.json +18 -0
- package/docs/navigation/tabs.tsx +17 -15
- package/docs/query/data-state.tsx +2 -4
- package/docs/query/infinite-query-state.tsx +5 -1
- package/docs/roadmap/tree-components.md +2 -1
- package/docs/showcase/table-view-tabs.tsx +1 -1
- package/package.json +2 -2
- package/scripts/ui-audit.mjs +15 -5
|
@@ -360,7 +360,8 @@
|
|
|
360
360
|
"collapse": "Collapse",
|
|
361
361
|
"loading": "Loading child nodes…",
|
|
362
362
|
"empty": "Nothing to show",
|
|
363
|
-
"selected": "Selected"
|
|
363
|
+
"selected": "Selected",
|
|
364
|
+
"filterMatch": "Matches the filter"
|
|
364
365
|
},
|
|
365
366
|
"thoughtChain": {
|
|
366
367
|
"label": "Reasoning steps",
|
|
@@ -371,6 +372,11 @@
|
|
|
371
372
|
"abort": "stopped"
|
|
372
373
|
}
|
|
373
374
|
},
|
|
375
|
+
"orgChart": {
|
|
376
|
+
"label": "Organization chart",
|
|
377
|
+
"scrollRegion": "Scrollable organization chart",
|
|
378
|
+
"agent": "AI agent"
|
|
379
|
+
},
|
|
374
380
|
"timeline": {
|
|
375
381
|
"statusDone": "Completed: ",
|
|
376
382
|
"statusCurrent": "Current: ",
|
|
@@ -419,6 +425,11 @@
|
|
|
419
425
|
"edit": "Edit",
|
|
420
426
|
"expand": "Expand",
|
|
421
427
|
"collapse": "Collapse"
|
|
428
|
+
},
|
|
429
|
+
"codeBlock": {
|
|
430
|
+
"copy": "Copy code",
|
|
431
|
+
"copied": "Copied",
|
|
432
|
+
"copiedAnnounce": "Code copied to clipboard"
|
|
422
433
|
}
|
|
423
434
|
},
|
|
424
435
|
"navigation": {
|
|
@@ -575,7 +586,20 @@
|
|
|
575
586
|
"sortDescending": "Sort descending",
|
|
576
587
|
"sortCancel": "Cancel sort",
|
|
577
588
|
"selectColumn": "Select",
|
|
578
|
-
"scrollRegion": "Scrollable table"
|
|
589
|
+
"scrollRegion": "Scrollable table",
|
|
590
|
+
"selectPage": "Select all rows on this page",
|
|
591
|
+
"matchingPage": {
|
|
592
|
+
"one": "{count} row on this page is selected.",
|
|
593
|
+
"other": "All {count} rows on this page are selected."
|
|
594
|
+
},
|
|
595
|
+
"matchingSelectAll": {
|
|
596
|
+
"one": "Select {count} matching row",
|
|
597
|
+
"other": "Select all {count} matching rows"
|
|
598
|
+
},
|
|
599
|
+
"matchingSelected": {
|
|
600
|
+
"one": "{count} matching row is selected.",
|
|
601
|
+
"other": "All {count} matching rows are selected."
|
|
602
|
+
}
|
|
579
603
|
},
|
|
580
604
|
"dataGrid": {
|
|
581
605
|
"search": "Search",
|
|
@@ -353,7 +353,8 @@
|
|
|
353
353
|
"collapse": "折りたたむ",
|
|
354
354
|
"loading": "子ノードを読み込み中…",
|
|
355
355
|
"empty": "表示する項目がありません",
|
|
356
|
-
"selected": "選択中"
|
|
356
|
+
"selected": "選択中",
|
|
357
|
+
"filterMatch": "フィルターに一致"
|
|
357
358
|
},
|
|
358
359
|
"thoughtChain": {
|
|
359
360
|
"label": "思考の手順",
|
|
@@ -364,6 +365,11 @@
|
|
|
364
365
|
"abort": "中断"
|
|
365
366
|
}
|
|
366
367
|
},
|
|
368
|
+
"orgChart": {
|
|
369
|
+
"label": "組織図",
|
|
370
|
+
"scrollRegion": "スクロールできる組織図",
|
|
371
|
+
"agent": "AIエージェント"
|
|
372
|
+
},
|
|
367
373
|
"timeline": {
|
|
368
374
|
"statusDone": "完了: ",
|
|
369
375
|
"statusCurrent": "現在: ",
|
|
@@ -412,6 +418,11 @@
|
|
|
412
418
|
"edit": "編集",
|
|
413
419
|
"expand": "展開",
|
|
414
420
|
"collapse": "折りたたむ"
|
|
421
|
+
},
|
|
422
|
+
"codeBlock": {
|
|
423
|
+
"copy": "コードをコピー",
|
|
424
|
+
"copied": "コピーしました",
|
|
425
|
+
"copiedAnnounce": "コードをクリップボードにコピーしました"
|
|
415
426
|
}
|
|
416
427
|
},
|
|
417
428
|
"navigation": {
|
|
@@ -562,7 +573,11 @@
|
|
|
562
573
|
"sortDescending": "降順に並べ替え",
|
|
563
574
|
"sortCancel": "並べ替えを解除",
|
|
564
575
|
"selectColumn": "選択",
|
|
565
|
-
"scrollRegion": "スクロール可能な表"
|
|
576
|
+
"scrollRegion": "スクロール可能な表",
|
|
577
|
+
"selectPage": "このページの行をすべて選択",
|
|
578
|
+
"matchingPage": "このページの{count}件を選択中",
|
|
579
|
+
"matchingSelectAll": "{count}件すべてを選択",
|
|
580
|
+
"matchingSelected": "{count}件すべてを選択中"
|
|
566
581
|
},
|
|
567
582
|
"dataGrid": {
|
|
568
583
|
"search": "検索",
|
|
@@ -354,7 +354,8 @@
|
|
|
354
354
|
"collapse": "Thu gọn",
|
|
355
355
|
"loading": "Đang tải nút con…",
|
|
356
356
|
"empty": "Không có gì để hiển thị",
|
|
357
|
-
"selected": "Đã chọn"
|
|
357
|
+
"selected": "Đã chọn",
|
|
358
|
+
"filterMatch": "Khớp bộ lọc"
|
|
358
359
|
},
|
|
359
360
|
"thoughtChain": {
|
|
360
361
|
"label": "Các bước suy luận",
|
|
@@ -365,6 +366,11 @@
|
|
|
365
366
|
"abort": "đã dừng"
|
|
366
367
|
}
|
|
367
368
|
},
|
|
369
|
+
"orgChart": {
|
|
370
|
+
"label": "Sơ đồ tổ chức",
|
|
371
|
+
"scrollRegion": "Sơ đồ tổ chức có thể cuộn",
|
|
372
|
+
"agent": "Tác tử AI"
|
|
373
|
+
},
|
|
368
374
|
"timeline": {
|
|
369
375
|
"statusDone": "Đã xong: ",
|
|
370
376
|
"statusCurrent": "Hiện tại: ",
|
|
@@ -413,6 +419,11 @@
|
|
|
413
419
|
"edit": "Sửa",
|
|
414
420
|
"expand": "Mở rộng",
|
|
415
421
|
"collapse": "Thu gọn"
|
|
422
|
+
},
|
|
423
|
+
"codeBlock": {
|
|
424
|
+
"copy": "Sao chép mã",
|
|
425
|
+
"copied": "Đã sao chép",
|
|
426
|
+
"copiedAnnounce": "Đã sao chép mã vào bộ nhớ tạm"
|
|
416
427
|
}
|
|
417
428
|
},
|
|
418
429
|
"navigation": {
|
|
@@ -563,7 +574,11 @@
|
|
|
563
574
|
"sortDescending": "Sắp xếp giảm dần",
|
|
564
575
|
"sortCancel": "Bỏ sắp xếp",
|
|
565
576
|
"selectColumn": "Chọn",
|
|
566
|
-
"scrollRegion": "Bảng có thể cuộn"
|
|
577
|
+
"scrollRegion": "Bảng có thể cuộn",
|
|
578
|
+
"selectPage": "Chọn tất cả các dòng trên trang này",
|
|
579
|
+
"matchingPage": "Đã chọn {count} dòng trên trang này.",
|
|
580
|
+
"matchingSelectAll": "Chọn tất cả {count} dòng khớp",
|
|
581
|
+
"matchingSelected": "Đã chọn tất cả {count} dòng khớp."
|
|
567
582
|
},
|
|
568
583
|
"dataGrid": {
|
|
569
584
|
"search": "Tìm kiếm",
|
package/dist/lib/hooks.d.ts
CHANGED
|
@@ -53,12 +53,16 @@ export declare function useScrollableRegionTabIndex(element: HTMLElement | null)
|
|
|
53
53
|
* overflows. Reading it as "no overflow" would strand the overflow from every keyboard user — a
|
|
54
54
|
* worse failure than an extra tab stop — so an unmeasured box counts as scrolling.
|
|
55
55
|
*
|
|
56
|
-
* `axis`
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* `axis` names the axes the caller KNOWS scroll; an axis whose computed `overflow` is `auto` or
|
|
57
|
+
* `scroll` is measured as well, because the box scrolls there whatever the caller asked. An axis
|
|
58
|
+
* that is `hidden` CLIPS rather than scrolls, so it is never measured — that would keep a tab stop
|
|
59
|
+
* that scrolls nothing. `ScrollArea`'s `orientation` is exactly this union.
|
|
59
60
|
*/
|
|
60
61
|
export declare function useScrollsOnAxis(ref: RefObject<HTMLElement | null>, enabled: boolean, axis: "horizontal" | "vertical" | "both"): boolean;
|
|
61
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* The horizontal question a table asks (gh#817). The block axis is measured TOO whenever the box's
|
|
64
|
+
* computed `overflow-y` scrolls — `overflow-x: auto` computes it to `auto` — see `useScrollsOnAxis`.
|
|
65
|
+
*/
|
|
62
66
|
export declare function useScrollsHorizontally(ref: RefObject<HTMLElement | null>, enabled: boolean): boolean;
|
|
63
67
|
/**
|
|
64
68
|
* Nearest scrollable ancestor — the box an element actually scrolls inside — else `null`, which is
|
package/dist/lib/hooks.js
CHANGED
|
@@ -111,9 +111,12 @@ function useScrollsOnAxis(ref, enabled, axis) {
|
|
|
111
111
|
useEffect(() => {
|
|
112
112
|
const el = ref.current;
|
|
113
113
|
if (!enabled || !el) return void 0;
|
|
114
|
-
const overflows = (client, scroll) =>
|
|
114
|
+
const overflows = (client, scroll) => scroll - client > 1;
|
|
115
|
+
const scrollsOn = (value) => value === "auto" || value === "scroll";
|
|
115
116
|
const update = (sync) => {
|
|
116
|
-
const
|
|
117
|
+
const unmeasured = el.clientWidth === 0 && el.clientHeight === 0;
|
|
118
|
+
const style = getComputedStyle(el);
|
|
119
|
+
const next = unmeasured || (axis !== "vertical" || scrollsOn(style.overflowX)) && overflows(el.clientWidth, el.scrollWidth) || (axis !== "horizontal" || scrollsOn(style.overflowY)) && overflows(el.clientHeight, el.scrollHeight);
|
|
117
120
|
if (next && sync) flushSync(() => setScrolls(true));
|
|
118
121
|
else setScrolls(next);
|
|
119
122
|
};
|
package/dist/lib/tree.d.ts
CHANGED
|
@@ -50,4 +50,27 @@ export declare function filterVisibleTree(options: NormalizedTreeOption[], query
|
|
|
50
50
|
}[];
|
|
51
51
|
export declare function collectAllExpandableKeys(options: NormalizedTreeOption[]): string[];
|
|
52
52
|
export declare function findNodeByValue(options: NormalizedTreeOption[], value: string): NormalizedTreeOption | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* rc-tree gives up on a node after this many rejected `loadData` calls and treats it as loaded
|
|
55
|
+
* (rc-tree `MAX_RETRY_TIMES`), so a permanently broken endpoint cannot be hammered forever.
|
|
56
|
+
*/
|
|
57
|
+
export declare const MAX_LAZY_LOAD_RETRIES = 10;
|
|
58
|
+
/**
|
|
59
|
+
* The lazy-children ledger shared by `Tree`, `TreeSelect` and `Cascader` — rc-tree's
|
|
60
|
+
* `loadedKeys` / `loadingKeys` / `loadingRetryTimes`, in one place (gh#1041).
|
|
61
|
+
*
|
|
62
|
+
* A key is asked for at most once while in flight and never again once it RESOLVED. A REJECTED
|
|
63
|
+
* load is not "loaded": the key leaves the in-flight set and the next expand asks again, until
|
|
64
|
+
* `MAX_LAZY_LOAD_RETRIES` failures. The old per-component ledgers recorded the key before the
|
|
65
|
+
* promise settled and never cleared it, so one network blip left a branch unloadable for the life
|
|
66
|
+
* of the component.
|
|
67
|
+
*/
|
|
68
|
+
export type LazyLoadLedger = {
|
|
69
|
+
/**
|
|
70
|
+
* Call `load` for `key` unless it is in flight or already loaded. A synchronous throw counts
|
|
71
|
+
* as a rejection. `onSettle(ok)` runs once the load settles. Returns whether `load` was called.
|
|
72
|
+
*/
|
|
73
|
+
run: (key: string, load: () => void | Promise<void>, onSettle?: (ok: boolean) => void) => boolean;
|
|
74
|
+
};
|
|
75
|
+
export declare function createLazyLoadLedger(): LazyLoadLedger;
|
|
53
76
|
export {};
|
package/dist/lib/tree.js
CHANGED
|
@@ -136,10 +136,39 @@ function findNodeByValue(options, value) {
|
|
|
136
136
|
}
|
|
137
137
|
return void 0;
|
|
138
138
|
}
|
|
139
|
+
const MAX_LAZY_LOAD_RETRIES = 10;
|
|
140
|
+
function createLazyLoadLedger() {
|
|
141
|
+
const loaded = /* @__PURE__ */ new Set();
|
|
142
|
+
const inFlight = /* @__PURE__ */ new Set();
|
|
143
|
+
const failures = /* @__PURE__ */ new Map();
|
|
144
|
+
return {
|
|
145
|
+
run(key, load, onSettle) {
|
|
146
|
+
if (loaded.has(key) || inFlight.has(key)) return false;
|
|
147
|
+
inFlight.add(key);
|
|
148
|
+
new Promise((resolve) => resolve(load())).then(
|
|
149
|
+
() => {
|
|
150
|
+
inFlight.delete(key);
|
|
151
|
+
loaded.add(key);
|
|
152
|
+
onSettle?.(true);
|
|
153
|
+
},
|
|
154
|
+
() => {
|
|
155
|
+
inFlight.delete(key);
|
|
156
|
+
const count = (failures.get(key) ?? 0) + 1;
|
|
157
|
+
failures.set(key, count);
|
|
158
|
+
if (count >= MAX_LAZY_LOAD_RETRIES) loaded.add(key);
|
|
159
|
+
onSettle?.(false);
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
139
166
|
export {
|
|
167
|
+
MAX_LAZY_LOAD_RETRIES,
|
|
140
168
|
collectAllExpandableKeys,
|
|
141
169
|
collectAllPaths,
|
|
142
170
|
collectLeafPaths,
|
|
171
|
+
createLazyLoadLedger,
|
|
143
172
|
filterTreeOptions,
|
|
144
173
|
filterVisibleTree,
|
|
145
174
|
findNodeByValue,
|
|
@@ -22,6 +22,13 @@ export type CodeBlockProp = {
|
|
|
22
22
|
size?: Extract<SizeProp, "xs" | "sm">;
|
|
23
23
|
/** Lands on `data-language`; no highlighter is bundled — see `children` for colouring its output. */
|
|
24
24
|
language?: string;
|
|
25
|
+
/**
|
|
26
|
+
* A copy button in the block's inline-end corner — antd `Typography`'s `copyable`, same name and
|
|
27
|
+
* semantics. `true` copies the block's text content; the object form sets `text`, `onCopy`,
|
|
28
|
+
* `tooltips` (`[copy, copied]`, or `false`), `icon` (`[copy, copied]`), `format` and `tabIndex`.
|
|
29
|
+
* The copy is announced politely to assistive technology.
|
|
30
|
+
*/
|
|
31
|
+
copyable?: boolean | TypographyCopyConfigProp;
|
|
25
32
|
className?: ClassNameProp;
|
|
26
33
|
};
|
|
27
34
|
/**
|
|
@@ -36,7 +43,7 @@ export type ProseProp = {
|
|
|
36
43
|
className?: ClassNameProp;
|
|
37
44
|
children?: ChildrenProp;
|
|
38
45
|
};
|
|
39
|
-
import type { ActionProp, ClassNameProp, DescriptionProp, IconProp, TitleProp, ColumnDefProp, GetRowIdProp, GetRowLabelProp, OnRowClickProp, OnSelectChangeProp, OnSortChangeProp, OnTableDensityChangeProp, SelectedIdsProp, SortStateProp, TableDensityProp, TablePresetProp, BreakpointProp, DensityProp, ChildrenProp, PendingProp, ToneProp, AvatarShapeProp, HeadingLevelProp, HandlerProp, SizeProp, LabelProp, IdProp, DescriptionsLayoutProp, DescriptionsColumnProp, DescriptionsSpanProp, DescriptionsItemsProp, GapProp, SortDirectionProp, OnColumnFilterChangeProp, OnRowProp, TableExpandableProp, TableRowSelectionProp, TableScrollProp, TableStickyProp, TableSummaryProp, DisabledProp, OnClickProp, ValueProp, DefaultValueProp, OnValueChangeProp } from "../vocabulary/index.js";
|
|
46
|
+
import type { ActionProp, ClassNameProp, DescriptionProp, IconProp, TitleProp, ExtraProp, ColumnDefProp, GetRowIdProp, GetRowLabelProp, OnRowClickProp, OnSelectChangeProp, OnSortChangeProp, OnTableDensityChangeProp, SelectedIdsProp, SortStateProp, TableDensityProp, TablePresetProp, BreakpointProp, DensityProp, ChildrenProp, PendingProp, ToneProp, AvatarShapeProp, HeadingLevelProp, HandlerProp, SizeProp, LabelProp, IdProp, DescriptionsLayoutProp, DescriptionsColumnProp, DescriptionsSpanProp, DescriptionsItemsProp, GapProp, SortDirectionProp, OnColumnFilterChangeProp, OnRowProp, TableExpandableProp, TableRowSelectionProp, TableScrollProp, TableStickyProp, TableSummaryProp, DisabledProp, OnClickProp, ValueProp, DefaultValueProp, OnValueChangeProp, TypographyCopyConfigProp } from "../vocabulary/index.js";
|
|
40
47
|
import type { TreeFieldNamesProp, TreeOptionProp } from "./data-entry.prop.js";
|
|
41
48
|
/**
|
|
42
49
|
* One key in a `Legend`: a tone, and the words that tone stands for.
|
|
@@ -736,12 +743,31 @@ export type TreeProp = {
|
|
|
736
743
|
/** Start with every branch open (antd `defaultExpandAll`). Seeded once, never re-applied. */
|
|
737
744
|
defaultExpandAll?: boolean;
|
|
738
745
|
/**
|
|
739
|
-
* Lazy children (antd `loadData`). Called
|
|
740
|
-
* `
|
|
746
|
+
* Lazy children (antd `loadData`). Called when a branch with no `children` and
|
|
747
|
+
* `isLeaf !== true` is expanded, and never again once its promise RESOLVES; push the fetched
|
|
748
|
+
* children into `treeData`. A REJECTED promise is not a load: the branch folds back shut
|
|
749
|
+
* (uncontrolled expansion) and the next expand asks again, up to 10 attempts (rc-tree).
|
|
741
750
|
*/
|
|
742
751
|
loadData?: (node: TreeNodeProp) => void | Promise<void>;
|
|
743
752
|
/** Render a node's title (antd `titleRender`). */
|
|
744
753
|
titleRender?: (node: TreeNodeProp) => React.ReactNode;
|
|
754
|
+
/**
|
|
755
|
+
* Highlight the nodes this returns `true` for (antd `filterTreeNode`) — the match of a search
|
|
756
|
+
* box above the tree. Matching rows are marked, NOT hidden: the outline, the keyboard path and
|
|
757
|
+
* every ARIA attribute stay exactly as they were. The row gets `data-filter-node="true"` and its
|
|
758
|
+
* label reads `--tree-node-filter-foreground` in the medium weight, plus an sr-only "matches"
|
|
759
|
+
* so the mark is never colour alone. Receives the node data, as `titleRender` and `loadData` do.
|
|
760
|
+
*/
|
|
761
|
+
filterTreeNode?: (node: TreeNodeProp) => boolean;
|
|
762
|
+
/**
|
|
763
|
+
* Viewport height in px (antd `height`). The tree scrolls inside this height, and — unless
|
|
764
|
+
* `virtual` is `false` — renders only the rows in view (plus a small overscan), so a branch of
|
|
765
|
+
* several hundred lazily-loaded children stays a few dozen DOM rows. Rows must share one height
|
|
766
|
+
* (the `size` tier) for the window to be exact.
|
|
767
|
+
*/
|
|
768
|
+
height?: number;
|
|
769
|
+
/** Set `false` to render every row even when `height` is set (antd `virtual`). Default `true`. */
|
|
770
|
+
virtual?: boolean;
|
|
745
771
|
/** Draw the connector rails between a parent and its children (antd `showLine`). */
|
|
746
772
|
showLine?: boolean;
|
|
747
773
|
/**
|
|
@@ -1126,3 +1152,46 @@ export type MarqueeProp = Omit<React.HTMLAttributes<HTMLDivElement>, "onPlay" |
|
|
|
1126
1152
|
label?: LabelProp;
|
|
1127
1153
|
className?: ClassNameProp;
|
|
1128
1154
|
};
|
|
1155
|
+
/**
|
|
1156
|
+
* @see OrgChart — who a box stands for. `agent` draws the box with a DASHED border so an AI agent
|
|
1157
|
+
* is told apart from a person at a glance, and adds a localized visually hidden "AI agent" to the
|
|
1158
|
+
* node's accessible name, so the difference is never carried by the stroke alone (WCAG 1.4.1).
|
|
1159
|
+
*/
|
|
1160
|
+
export type OrgChartNodeVariantProp = "person" | "agent";
|
|
1161
|
+
/** @see OrgChart — one box of the chart. */
|
|
1162
|
+
export type OrgChartNodeProp = {
|
|
1163
|
+
/** Identity of the node. Unique across the whole chart. */
|
|
1164
|
+
key: string;
|
|
1165
|
+
/** The person's or agent's name — the box's first line and the start of its accessible name. */
|
|
1166
|
+
name: React.ReactNode;
|
|
1167
|
+
/** Role / job title, the line under the name. */
|
|
1168
|
+
title?: TitleProp;
|
|
1169
|
+
/** The mark at the box's inline start — usually an `<Avatar>`. Decorative; the name carries identity. */
|
|
1170
|
+
avatar?: React.ReactNode;
|
|
1171
|
+
/** Free slot under the text — a Badge, a status, a count. */
|
|
1172
|
+
extra?: ExtraProp;
|
|
1173
|
+
/** `person` (default) or `agent` (dashed box). */
|
|
1174
|
+
variant?: OrgChartNodeVariantProp;
|
|
1175
|
+
children?: readonly OrgChartNodeProp[];
|
|
1176
|
+
};
|
|
1177
|
+
/**
|
|
1178
|
+
* @see OrgChart — an organization chart: boxes joined by lines, top-down, with a horizontal scroll
|
|
1179
|
+
* region of its own when the chart is wider than its container, and an indented `Tree` of the same
|
|
1180
|
+
* data when the CONTAINER is narrow. It is the WAI-ARIA APG tree view in both forms.
|
|
1181
|
+
*/
|
|
1182
|
+
export type OrgChartProp = {
|
|
1183
|
+
/** The hierarchy. Usually one root; several roots render side by side. */
|
|
1184
|
+
data: readonly OrgChartNodeProp[];
|
|
1185
|
+
/**
|
|
1186
|
+
* Replace the box's content (avatar · name · title · extra) with your own. The box, its border,
|
|
1187
|
+
* the connectors and the keyboard stay the library's. Used by the narrow `Tree` form too.
|
|
1188
|
+
*/
|
|
1189
|
+
renderNode?: (node: OrgChartNodeProp) => React.ReactNode;
|
|
1190
|
+
/**
|
|
1191
|
+
* Accessible name of the chart (the `role="tree"`) — a plain string. A localized default
|
|
1192
|
+
* ("Organization chart") applies when omitted.
|
|
1193
|
+
*/
|
|
1194
|
+
label?: Extract<LabelProp, string>;
|
|
1195
|
+
className?: ClassNameProp;
|
|
1196
|
+
id?: IdProp;
|
|
1197
|
+
};
|
|
@@ -1209,6 +1209,17 @@ export type RecordPickerProp = Omit<React.ButtonHTMLAttributes<HTMLButtonElement
|
|
|
1209
1209
|
};
|
|
1210
1210
|
placeholder?: string;
|
|
1211
1211
|
dialogTitle?: string;
|
|
1212
|
+
/**
|
|
1213
|
+
* Node shown when the search finds nothing (antd `notFoundContent`) — in the dropdown shape and
|
|
1214
|
+
* in the dialog alike. Localized `dataEntry.recordPicker.empty` otherwise.
|
|
1215
|
+
*/
|
|
1216
|
+
notFoundContent?: NotFoundContentProp;
|
|
1217
|
+
/**
|
|
1218
|
+
* Text of the dialog's load-more button (localized `dataEntry.recordPicker.more` otherwise). Only
|
|
1219
|
+
* the label: the button and when it appears (the server returned a `nextCursor`) stay the
|
|
1220
|
+
* picker's.
|
|
1221
|
+
*/
|
|
1222
|
+
loadMoreLabel?: LabelProp;
|
|
1212
1223
|
size?: "xs" | "sm" | "md" | "lg";
|
|
1213
1224
|
/**
|
|
1214
1225
|
* Tên trường, do `FormField` truyền xuống. Khai tường minh vì CẢ HAI nhánh phải giữ nó: một
|
|
@@ -1788,8 +1799,9 @@ export type CascaderProp = FieldA11yProps & {
|
|
|
1788
1799
|
*/
|
|
1789
1800
|
showCheckedStrategy?: Exclude<ShowCheckedStrategyProp, "SHOW_ALL">;
|
|
1790
1801
|
/**
|
|
1791
|
-
* Lazy children (antd `loadData`). Called
|
|
1792
|
-
* `
|
|
1802
|
+
* Lazy children (antd `loadData`). Called when a branch with no `children` and
|
|
1803
|
+
* `isLeaf !== true` is expanded, and never again once its promise RESOLVES; push the fetched
|
|
1804
|
+
* children into `options`. A REJECTED promise is forgotten, so the next activation asks again.
|
|
1793
1805
|
*/
|
|
1794
1806
|
loadData?: (selectedOptions: TreeOptionProp[]) => void | Promise<void>;
|
|
1795
1807
|
/** Render the trigger label from the selected path (antd `displayRender`). */
|
|
@@ -1864,8 +1876,10 @@ export type TreeSelectProp = FieldA11yProps & {
|
|
|
1864
1876
|
/** Panel open change (antd `onOpenChange`). Fires for both controlled and uncontrolled panels. */
|
|
1865
1877
|
onOpenChange?: OnOpenChangeProp;
|
|
1866
1878
|
/**
|
|
1867
|
-
* Lazy children (antd `loadData`). Called
|
|
1868
|
-
* `
|
|
1879
|
+
* Lazy children (antd `loadData`). Called when a branch with no `children` and
|
|
1880
|
+
* `isLeaf !== true` is expanded, and never again once its promise RESOLVES; push the fetched
|
|
1881
|
+
* children into `treeData`. A REJECTED promise folds the branch shut and the next expand asks
|
|
1882
|
+
* again, up to 10 attempts (rc-tree).
|
|
1869
1883
|
*/
|
|
1870
1884
|
loadData?: (node: TreeOptionProp) => void | Promise<void>;
|
|
1871
1885
|
/** Render a node's title (antd `treeTitleRender`). */
|
|
@@ -1945,6 +1959,14 @@ export type TransferProp = FieldA11yProps & {
|
|
|
1945
1959
|
className?: ClassNameProp;
|
|
1946
1960
|
selectedKeys?: [string[], string[]];
|
|
1947
1961
|
onSelectChange?: (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => void;
|
|
1962
|
+
/**
|
|
1963
|
+
* antd `locale`, ported for `notFoundContent` only: the node an empty (or search-emptied) pane
|
|
1964
|
+
* shows. A `[source, target]` pair sets each pane separately, as in antd. Localized
|
|
1965
|
+
* `dataEntry.transfer.empty` otherwise.
|
|
1966
|
+
*/
|
|
1967
|
+
locale?: {
|
|
1968
|
+
notFoundContent?: NotFoundContentProp | [NotFoundContentProp, NotFoundContentProp];
|
|
1969
|
+
};
|
|
1948
1970
|
};
|
|
1949
1971
|
/** @see BranchScopePicker — scope mode: every branch, or an explicit subset. */
|
|
1950
1972
|
export type BranchScopeModeProp = "all" | "selected";
|
|
@@ -1989,6 +2011,11 @@ export type BranchScopePickerProp = FieldA11yProps & {
|
|
|
1989
2011
|
loading?: boolean;
|
|
1990
2012
|
/** Custom empty content when `branches` is empty; defaults to a localized message. */
|
|
1991
2013
|
empty?: React.ReactNode;
|
|
2014
|
+
/**
|
|
2015
|
+
* Shown when the branch search matches nothing (antd `notFoundContent`); localized
|
|
2016
|
+
* `dataEntry.branchScope.noMatches` otherwise. An empty `branches` list is `empty`'s, not this.
|
|
2017
|
+
*/
|
|
2018
|
+
notFoundContent?: NotFoundContentProp;
|
|
1992
2019
|
/** Branch-collection READ failure (distinct from `error`, which is field validation). */
|
|
1993
2020
|
listError?: React.ReactNode;
|
|
1994
2021
|
/** Permission-denied state — the branch read was refused. Takes precedence over `listError`. */
|
|
@@ -3,7 +3,7 @@ import type * as React from "react";
|
|
|
3
3
|
import type { InfiniteData, QueryKey, UseInfiniteQueryResult, UseMutationResult, UseQueryResult } from "@tanstack/react-query";
|
|
4
4
|
import type { LinkProps } from "react-router-dom";
|
|
5
5
|
import type { ButtonProp } from "./general.prop.js";
|
|
6
|
-
import type { ClassNameProp, HandlerProp } from "../vocabulary/index.js";
|
|
6
|
+
import type { ClassNameProp, HandlerProp, LabelProp } from "../vocabulary/index.js";
|
|
7
7
|
/** @see DataState — TanStack Query lifecycle widget (not a visual component). */
|
|
8
8
|
export type DataStateProp<T> = {
|
|
9
9
|
query: UseQueryResult<T>;
|
|
@@ -103,6 +103,13 @@ export type InfiniteQueryStateProp<TPage, TFlat = TPage extends {
|
|
|
103
103
|
loadingMore?: React.ReactNode;
|
|
104
104
|
/** Custom load-more footer; `false` hides footer entirely. */
|
|
105
105
|
loadMore?: React.ReactNode | false;
|
|
106
|
+
/**
|
|
107
|
+
* Text of the built-in load-more button (localized `query.loadMore` otherwise) — e.g.
|
|
108
|
+
* 「さらに表示」「さらに古い版を表示」. Only the idle label: the button, its pending label and its
|
|
109
|
+
* disabled-while-fetching behaviour stay the component's. Ignored when `loadMore` replaces the
|
|
110
|
+
* footer.
|
|
111
|
+
*/
|
|
112
|
+
loadMoreLabel?: LabelProp;
|
|
106
113
|
/** Show default load-more button when `hasNextPage`. Default `true`. */
|
|
107
114
|
showLoadMore?: boolean;
|
|
108
115
|
children: (flat: TFlat, helpers: InfiniteQueryHelpers) => React.ReactNode;
|
package/dist/props/registry.d.ts
CHANGED
|
@@ -304,10 +304,20 @@ export declare const VOCABULARY_REGISTRY: {
|
|
|
304
304
|
readonly category: "data";
|
|
305
305
|
readonly description: "One entry in the selection-column dropdown — { key, text, onSelect } (antd SelectionItem)";
|
|
306
306
|
};
|
|
307
|
+
readonly TableSelectionBuiltInProp: {
|
|
308
|
+
readonly file: "vocabulary/data.prop.ts";
|
|
309
|
+
readonly category: "data";
|
|
310
|
+
readonly description: "Built-in selections entry — SELECT_ALL | SELECT_INVERT | SELECT_NONE (antd Table.SELECTION_ALL / SELECTION_INVERT / SELECTION_NONE, published as DataTable.SELECTION_*)";
|
|
311
|
+
};
|
|
312
|
+
readonly TableSelectAllMatchingProp: {
|
|
313
|
+
readonly file: "vocabulary/data.prop.ts";
|
|
314
|
+
readonly category: "data";
|
|
315
|
+
readonly description: "Server-paged 'select all N matching' banner — { total, selected, onSelectedChange } (no antd equivalent; Gmail/Jira/GitHub pattern)";
|
|
316
|
+
};
|
|
307
317
|
readonly TableRowSelectionProp: {
|
|
308
318
|
readonly file: "vocabulary/data.prop.ts";
|
|
309
319
|
readonly category: "data";
|
|
310
|
-
readonly description: "DataTable row-selection config — type | selectedRowKeys | onChange | getCheckboxProps | preserveSelectedRowKeys | selections | hideSelectAll | columnTitle (antd TableRowSelection)";
|
|
320
|
+
readonly description: "DataTable row-selection config — type | selectedRowKeys | onChange | getCheckboxProps | preserveSelectedRowKeys | selections | hideSelectAll | columnTitle | selectAllLabel | matching (antd TableRowSelection + select-all-matching)";
|
|
311
321
|
};
|
|
312
322
|
readonly TableExpandableProp: {
|
|
313
323
|
readonly file: "vocabulary/data.prop.ts";
|
|
@@ -1810,7 +1820,7 @@ export declare const COMPONENT_PROP_REGISTRY: {
|
|
|
1810
1820
|
readonly RecordPickerProp: {
|
|
1811
1821
|
readonly group: "data-entry";
|
|
1812
1822
|
readonly file: "components/data-entry.prop.ts";
|
|
1813
|
-
readonly vocabulary: readonly ["ValueProp", "OnValueChangeProp", "DisabledProp", "SizeProp", "PlaceholderProp"];
|
|
1823
|
+
readonly vocabulary: readonly ["ValueProp", "OnValueChangeProp", "DisabledProp", "SizeProp", "PlaceholderProp", "NotFoundContentProp", "LabelProp"];
|
|
1814
1824
|
readonly note: "One picker whose SHAPE follows the size of the set: Select at or under `threshold`, a searchable Dialog with consumer-declared filters over it (gh#932).";
|
|
1815
1825
|
};
|
|
1816
1826
|
readonly RecordPickerFilterProp: {
|
|
@@ -1882,7 +1892,11 @@ export declare const COMPONENT_PROP_REGISTRY: {
|
|
|
1882
1892
|
readonly TransferProp: {
|
|
1883
1893
|
readonly group: "data-entry";
|
|
1884
1894
|
readonly file: "components/data-entry.prop.ts";
|
|
1885
|
-
readonly vocabulary: readonly ["DisabledProp", "ClassNameProp"
|
|
1895
|
+
readonly vocabulary: readonly ["DisabledProp", "ClassNameProp", {
|
|
1896
|
+
readonly field: "locale";
|
|
1897
|
+
readonly local: true;
|
|
1898
|
+
readonly reason: "antd Transfer `locale`, ported for `notFoundContent` only (one node, or a [source, target] pair) — gh#1044.";
|
|
1899
|
+
}];
|
|
1886
1900
|
};
|
|
1887
1901
|
readonly TransferItemProp: {
|
|
1888
1902
|
readonly group: "data-entry";
|
|
@@ -1940,7 +1954,7 @@ export declare const COMPONENT_PROP_REGISTRY: {
|
|
|
1940
1954
|
readonly DataTableProp: {
|
|
1941
1955
|
readonly group: "data-display";
|
|
1942
1956
|
readonly file: "components/data-display.prop.ts";
|
|
1943
|
-
readonly vocabulary: readonly ["ColumnDefProp", "DensityProp", "SortStateProp", "SelectedIdsProp", "GetRowLabelProp", "HandlerProp", "TablePresetProp", "TableColumnPriorityProp", "BreakpointProp", "ColumnFixedProp", "ColumnFilterItemProp", "ColumnFilterStateProp", "ColumnSorterProp", "TableRowSelectionProp", "TableExpandableProp", "TableSummaryProp", "TableScrollProp", "TableStickyProp", "OnRowProp", "TablePaginationProp", "TablePaginationPositionProp", "SortDirectionProp", "OnColumnFilterChangeProp"];
|
|
1957
|
+
readonly vocabulary: readonly ["ColumnDefProp", "DensityProp", "SortStateProp", "SelectedIdsProp", "GetRowLabelProp", "HandlerProp", "TablePresetProp", "TableColumnPriorityProp", "BreakpointProp", "ColumnFixedProp", "ColumnFilterItemProp", "ColumnFilterStateProp", "ColumnSorterProp", "TableRowSelectionProp", "TableSelectionBuiltInProp", "TableSelectAllMatchingProp", "TableExpandableProp", "TableSummaryProp", "TableScrollProp", "TableStickyProp", "OnRowProp", "TablePaginationProp", "TablePaginationPositionProp", "SortDirectionProp", "OnColumnFilterChangeProp"];
|
|
1944
1958
|
};
|
|
1945
1959
|
readonly ListRowDensityProp: {
|
|
1946
1960
|
readonly group: "data-display";
|
|
@@ -2408,7 +2422,7 @@ export declare const COMPONENT_PROP_REGISTRY: {
|
|
|
2408
2422
|
readonly InfiniteQueryStateProp: {
|
|
2409
2423
|
readonly group: "query";
|
|
2410
2424
|
readonly file: "components/query.prop.ts";
|
|
2411
|
-
readonly vocabulary: readonly ["HandlerProp"];
|
|
2425
|
+
readonly vocabulary: readonly ["HandlerProp", "LabelProp"];
|
|
2412
2426
|
};
|
|
2413
2427
|
readonly PrefetchLinkProp: {
|
|
2414
2428
|
readonly group: "query";
|
|
@@ -3293,6 +3307,10 @@ export declare const COMPONENT_PROP_REGISTRY: {
|
|
|
3293
3307
|
readonly field: "onRangeChange";
|
|
3294
3308
|
readonly local: true;
|
|
3295
3309
|
readonly reason: "An endpoint movement command, not an internally owned value; the consumer commits its row data.";
|
|
3310
|
+
}, {
|
|
3311
|
+
readonly field: "sticky";
|
|
3312
|
+
readonly local: true;
|
|
3313
|
+
readonly reason: "antd Table `sticky` — `true` or `{ offsetHeader }` (px) keeps the axis header on screen while the page scrolls (gh#1044).";
|
|
3296
3314
|
}, {
|
|
3297
3315
|
readonly field: "expandedValues";
|
|
3298
3316
|
readonly local: true;
|
|
@@ -3476,7 +3494,7 @@ export declare const COMPONENT_PROP_REGISTRY: {
|
|
|
3476
3494
|
readonly field: "empty";
|
|
3477
3495
|
readonly local: true;
|
|
3478
3496
|
readonly reason: "Custom empty content when there are no branches.";
|
|
3479
|
-
}, {
|
|
3497
|
+
}, "NotFoundContentProp", {
|
|
3480
3498
|
readonly field: "listError";
|
|
3481
3499
|
readonly local: true;
|
|
3482
3500
|
readonly reason: "Branch-collection READ failure — deliberately distinct from ErrorProp `error`, which stays field validation.";
|
|
@@ -3929,6 +3947,45 @@ export declare const COMPONENT_PROP_REGISTRY: {
|
|
|
3929
3947
|
readonly file: "components/data-display.prop.ts";
|
|
3930
3948
|
readonly vocabulary: readonly ["TitleProp", "DescriptionProp", "IconProp", "StatusProp", "ControlVariantProp", "DisabledProp", "OnClickProp", "IdProp", "ClassNameProp"];
|
|
3931
3949
|
};
|
|
3950
|
+
readonly OrgChartNodeVariantProp: {
|
|
3951
|
+
readonly group: "data-display";
|
|
3952
|
+
readonly file: "components/data-display.prop.ts";
|
|
3953
|
+
readonly vocabulary: readonly ["ControlVariantProp"];
|
|
3954
|
+
};
|
|
3955
|
+
readonly OrgChartNodeProp: {
|
|
3956
|
+
readonly group: "data-display";
|
|
3957
|
+
readonly file: "components/data-display.prop.ts";
|
|
3958
|
+
readonly vocabulary: readonly ["TitleProp", "ExtraProp", "ControlVariantProp", {
|
|
3959
|
+
readonly field: "key";
|
|
3960
|
+
readonly local: true;
|
|
3961
|
+
readonly reason: "The node's identity, unique across the chart.";
|
|
3962
|
+
}, {
|
|
3963
|
+
readonly field: "name";
|
|
3964
|
+
readonly local: true;
|
|
3965
|
+
readonly reason: "The person's or agent's display name (a ReactNode), not a form field `name` — NameProp is the submitted-field key.";
|
|
3966
|
+
}, {
|
|
3967
|
+
readonly field: "avatar";
|
|
3968
|
+
readonly local: true;
|
|
3969
|
+
readonly reason: "The mark at the box's inline start, usually an <Avatar>. Decorative.";
|
|
3970
|
+
}, {
|
|
3971
|
+
readonly field: "children";
|
|
3972
|
+
readonly local: true;
|
|
3973
|
+
readonly reason: "The node's own reports — the hierarchy itself, not a slot.";
|
|
3974
|
+
}];
|
|
3975
|
+
};
|
|
3976
|
+
readonly OrgChartProp: {
|
|
3977
|
+
readonly group: "data-display";
|
|
3978
|
+
readonly file: "components/data-display.prop.ts";
|
|
3979
|
+
readonly vocabulary: readonly ["LabelProp", "ClassNameProp", "IdProp", {
|
|
3980
|
+
readonly field: "data";
|
|
3981
|
+
readonly local: true;
|
|
3982
|
+
readonly reason: "The hierarchy of OrgChartNodeProp — the same shape feeds the boxes and the narrow Tree.";
|
|
3983
|
+
}, {
|
|
3984
|
+
readonly field: "renderNode";
|
|
3985
|
+
readonly local: true;
|
|
3986
|
+
readonly reason: "Escape hatch replacing a box's content; the box, connectors and keyboard stay the library's.";
|
|
3987
|
+
}];
|
|
3988
|
+
};
|
|
3932
3989
|
};
|
|
3933
3990
|
export type ComponentPropName = keyof typeof COMPONENT_PROP_REGISTRY;
|
|
3934
3991
|
/** Forbidden duplicate concepts — use the canonical name on the left. */
|