prime-ui-kit 0.12.0 → 0.13.1
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 +3 -1
- package/dist/chunks/{chunk-YJO3NJIJ.js → chunk-JV2KB5JZ.js} +6662 -5282
- package/dist/chunks/{chunk-VOZ7J72X.js → chunk-PK2GC77E.js} +169 -51
- package/dist/chunks/{chunk-OTOIOHVE.js → chunk-XNOJEX55.js} +14 -5
- package/dist/color-picker.js +2 -2
- package/dist/components/chat/Chat.d.ts +11 -12
- package/dist/components/chat/chatContext.d.ts +2 -0
- package/dist/components/chat-list/ChatList.d.ts +191 -0
- package/dist/components/chat-list/formatChatTime.d.ts +6 -0
- package/dist/components/command-menu/CommandMenu.d.ts +10 -5
- package/dist/components/composer/Composer.d.ts +3 -10
- package/dist/components/data-table/DataTable.d.ts +16 -2
- package/dist/components/data-table/Row.d.ts +23 -7
- package/dist/components/data-table/StateRows.d.ts +5 -1
- package/dist/components/data-table/reorder.d.ts +3 -1
- package/dist/components/data-table/rows.d.ts +20 -4
- package/dist/components/file-upload/FileUpload.d.ts +7 -0
- package/dist/components/gantt/Gantt.d.ts +19 -1
- package/dist/components/gantt/GanttBar.d.ts +4 -1
- package/dist/components/gantt/GanttRow.d.ts +8 -1
- package/dist/components/index.d.ts +10 -8
- package/dist/components/kanban/Kanban.d.ts +17 -2
- package/dist/components/list/List.d.ts +18 -3
- package/dist/components/message/Message.d.ts +13 -0
- package/dist/components/message/MessageParts.d.ts +2 -0
- package/dist/components/modal/DialogParts.d.ts +5 -1
- package/dist/components/select/Select.d.ts +11 -5
- package/dist/components/select/SelectItem.d.ts +19 -0
- package/dist/components/select/selectContext.d.ts +4 -0
- package/dist/components/sparkline/Sparkline.d.ts +14 -3
- package/dist/components/textarea/Textarea.d.ts +11 -3
- package/dist/hooks/useUploadQueue.d.ts +5 -1
- package/dist/icons/registry.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/index.js +6 -2
- package/dist/internal/attachmentTile.d.ts +5 -1
- package/dist/internal/richText.d.ts +7 -2
- package/dist/internal/textFormatting.d.ts +52 -0
- package/dist/internal/textFormattingToolbar.d.ts +26 -0
- package/dist/skill/cheatsheet.md +12 -0
- package/dist/skill/choosing.md +5 -2
- package/dist/skill/components.md +5 -4
- package/dist/skill/composition.md +1 -1
- package/dist/skill/layouts.md +2 -0
- package/dist/skill/patterns/chat.module.css +0 -9
- package/dist/skill/patterns/chat.tsx +71 -25
- package/dist/skill/patterns/kanban-board.tsx +2 -8
- package/dist/skill/patterns/schedule.tsx +15 -3
- package/dist/skill/reference/components/chat/COMPONENT.md +13 -4
- package/dist/skill/reference/components/chat/examples/states.tsx +100 -0
- package/dist/skill/reference/components/chat-list/COMPONENT.md +256 -0
- package/dist/skill/reference/components/chat-list/examples/controlled.tsx +103 -0
- package/dist/skill/reference/components/chat-list/examples/examples.module.css +66 -0
- package/dist/skill/reference/components/chat-list/examples/live.tsx +133 -0
- package/dist/skill/reference/components/chat-list/examples/long-list.tsx +87 -0
- package/dist/skill/reference/components/chat-list/examples/narrow.tsx +88 -0
- package/dist/skill/reference/components/chat-list/examples/overview.tsx +194 -0
- package/dist/skill/reference/components/chat-list/examples/search.tsx +71 -0
- package/dist/skill/reference/components/chat-list/examples/sizes.tsx +61 -0
- package/dist/skill/reference/components/chat-list/examples/states.tsx +107 -0
- package/dist/skill/reference/components/chat-list/examples/structure.tsx +135 -0
- package/dist/skill/reference/components/command-menu/COMPONENT.md +15 -11
- package/dist/skill/reference/components/command-menu/examples/server-search.tsx +11 -9
- package/dist/skill/reference/components/composer/COMPONENT.md +8 -7
- package/dist/skill/reference/components/composer/examples/formatting.tsx +1 -1
- package/dist/skill/reference/components/confirm-dialog/COMPONENT.md +1 -0
- package/dist/skill/reference/components/data-table/COMPONENT.md +21 -6
- package/dist/skill/reference/components/data-table/examples/groups.tsx +2 -1
- package/dist/skill/reference/components/data-table/examples/trend.tsx +85 -0
- package/dist/skill/reference/components/drawer/COMPONENT.md +7 -6
- package/dist/skill/reference/components/drawer/examples/client-card.tsx +50 -0
- package/dist/skill/reference/components/fieldset/COMPONENT.md +1 -0
- package/dist/skill/reference/components/file-upload/COMPONENT.md +9 -7
- package/dist/skill/reference/components/file-upload/examples/overview.tsx +14 -3
- package/dist/skill/reference/components/gantt/COMPONENT.md +15 -5
- package/dist/skill/reference/components/gantt/examples/row-link.tsx +96 -0
- package/dist/skill/reference/components/kanban/COMPONENT.md +12 -4
- package/dist/skill/reference/components/kanban/examples/item-link.tsx +92 -0
- package/dist/skill/reference/components/list/COMPONENT.md +19 -4
- package/dist/skill/reference/components/list/examples/reorder.tsx +48 -0
- package/dist/skill/reference/components/message/COMPONENT.md +18 -2
- package/dist/skill/reference/components/message/examples/bot-actions.tsx +51 -0
- package/dist/skill/reference/components/modal/COMPONENT.md +6 -4
- package/dist/skill/reference/components/select/COMPONENT.md +38 -7
- package/dist/skill/reference/components/select/examples/create-action.tsx +107 -0
- package/dist/skill/reference/components/select/examples/saving.tsx +47 -0
- package/dist/skill/reference/components/sheet/COMPONENT.md +4 -4
- package/dist/skill/reference/components/sparkline/COMPONENT.md +16 -2
- package/dist/skill/reference/components/sparkline/examples/compact.tsx +41 -0
- package/dist/skill/reference/components/sparkline/examples/examples.module.css +12 -0
- package/dist/skill/reference/components/textarea/COMPONENT.md +22 -2
- package/dist/skill/reference/components/textarea/examples/formatting.tsx +20 -0
- package/package.json +2 -2
- package/src/components/chat/COMPONENT.md +13 -4
- package/src/components/chat/examples/states.tsx +100 -0
- package/src/components/chat-list/COMPONENT.md +256 -0
- package/src/components/chat-list/examples/controlled.tsx +103 -0
- package/src/components/chat-list/examples/examples.module.css +66 -0
- package/src/components/chat-list/examples/live.tsx +133 -0
- package/src/components/chat-list/examples/long-list.tsx +87 -0
- package/src/components/chat-list/examples/narrow.tsx +88 -0
- package/src/components/chat-list/examples/overview.tsx +194 -0
- package/src/components/chat-list/examples/search.tsx +71 -0
- package/src/components/chat-list/examples/sizes.tsx +61 -0
- package/src/components/chat-list/examples/states.tsx +107 -0
- package/src/components/chat-list/examples/structure.tsx +135 -0
- package/src/components/command-menu/COMPONENT.md +15 -11
- package/src/components/command-menu/examples/server-search.tsx +11 -9
- package/src/components/composer/COMPONENT.md +8 -7
- package/src/components/composer/examples/formatting.tsx +1 -1
- package/src/components/confirm-dialog/COMPONENT.md +1 -0
- package/src/components/data-table/COMPONENT.md +21 -6
- package/src/components/data-table/examples/groups.tsx +2 -1
- package/src/components/data-table/examples/trend.tsx +85 -0
- package/src/components/drawer/COMPONENT.md +7 -6
- package/src/components/drawer/examples/client-card.tsx +50 -0
- package/src/components/fieldset/COMPONENT.md +1 -0
- package/src/components/file-upload/COMPONENT.md +9 -7
- package/src/components/file-upload/examples/overview.tsx +14 -3
- package/src/components/gantt/COMPONENT.md +15 -5
- package/src/components/gantt/examples/row-link.tsx +96 -0
- package/src/components/kanban/COMPONENT.md +12 -4
- package/src/components/kanban/examples/item-link.tsx +92 -0
- package/src/components/list/COMPONENT.md +19 -4
- package/src/components/list/examples/reorder.tsx +48 -0
- package/src/components/message/COMPONENT.md +18 -2
- package/src/components/message/examples/bot-actions.tsx +51 -0
- package/src/components/modal/COMPONENT.md +6 -4
- package/src/components/select/COMPONENT.md +38 -7
- package/src/components/select/examples/create-action.tsx +107 -0
- package/src/components/select/examples/saving.tsx +47 -0
- package/src/components/sheet/COMPONENT.md +4 -4
- package/src/components/sparkline/COMPONENT.md +16 -2
- package/src/components/sparkline/examples/compact.tsx +41 -0
- package/src/components/sparkline/examples/examples.module.css +12 -0
- package/src/components/textarea/COMPONENT.md +22 -2
- package/src/components/textarea/examples/formatting.tsx +20 -0
- package/dist/components/composer/format.d.ts +0 -39
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type DropdownContentProps } from "../dropdown/Dropdown";
|
|
3
|
+
import { type ListItemProps } from "../list/List";
|
|
4
|
+
import type { MessageStatus } from "../message/Message";
|
|
5
|
+
import { type ControlSize } from "../../internal/states";
|
|
6
|
+
export { formatChatTime } from "./formatChatTime";
|
|
7
|
+
/** What the last message of a dialog is when it is not text: the word the preview shows. */
|
|
8
|
+
export type ChatListMediaKind = "photo" | "video" | "voice" | "videoNote" | "file" | "location" | "contact";
|
|
9
|
+
export type ChatListLabels = {
|
|
10
|
+
/** `aria-label` of the list. */
|
|
11
|
+
list: string;
|
|
12
|
+
/** `aria-label` of the search field. */
|
|
13
|
+
search: string;
|
|
14
|
+
/** Placeholder of the search field. */
|
|
15
|
+
searchPlaceholder: string;
|
|
16
|
+
/** Announced while `loading`. */
|
|
17
|
+
loading: string;
|
|
18
|
+
/** The empty state without a search. */
|
|
19
|
+
empty: string;
|
|
20
|
+
/** The empty state of a search; announced. */
|
|
21
|
+
noResults: string;
|
|
22
|
+
/** Announced after a search changes the list; `{count}` — the dialogs found. */
|
|
23
|
+
results: string;
|
|
24
|
+
/** The preview while the other side types (`typing`). */
|
|
25
|
+
typing: string;
|
|
26
|
+
/** The preview while someone in a group types (`typing="Анна"`); `{name}` — who. */
|
|
27
|
+
typingName: string;
|
|
28
|
+
/** Before an unsent draft in the preview. */
|
|
29
|
+
draft: string;
|
|
30
|
+
/** Spoken for the unread count; `{count}` — the number. */
|
|
31
|
+
unread: string;
|
|
32
|
+
/** Spoken for the «@» mark (`mention`). */
|
|
33
|
+
mention: string;
|
|
34
|
+
/** Name of the muted glyph (`muted`). */
|
|
35
|
+
muted: string;
|
|
36
|
+
/** Name of the pin glyph (`pinned`). */
|
|
37
|
+
pinned: string;
|
|
38
|
+
/** Delivery of the reader's last message, as `Message` says it. */
|
|
39
|
+
sending: string;
|
|
40
|
+
sent: string;
|
|
41
|
+
read: string;
|
|
42
|
+
failed: string;
|
|
43
|
+
/** Media words of the preview (`ChatList.ItemDescription kind`). */
|
|
44
|
+
photo: string;
|
|
45
|
+
video: string;
|
|
46
|
+
voice: string;
|
|
47
|
+
videoNote: string;
|
|
48
|
+
file: string;
|
|
49
|
+
location: string;
|
|
50
|
+
contact: string;
|
|
51
|
+
/** `aria-label` of the point the row menu opens from. */
|
|
52
|
+
menu: string;
|
|
53
|
+
};
|
|
54
|
+
export type ChatListItemIconProps = Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
55
|
+
/** Before the name: an `Avatar.Root` (sized by the row). After it: a small `Icon`. */
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The avatar of the dialog before `ChatList.ItemText`; after it, a glyph beside the name (a
|
|
61
|
+
* verified mark, a bot). Drawn by `ChatList.Item`.
|
|
62
|
+
*/
|
|
63
|
+
declare function ChatListItemIcon(_props: ChatListItemIconProps): React.ReactNode;
|
|
64
|
+
declare namespace ChatListItemIcon {
|
|
65
|
+
var displayName: string;
|
|
66
|
+
}
|
|
67
|
+
export type ChatListItemTextProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
68
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
69
|
+
};
|
|
70
|
+
/** The name of the dialog: one line, truncated; the search query is marked in it. */
|
|
71
|
+
declare function ChatListItemText(_props: ChatListItemTextProps): React.ReactNode;
|
|
72
|
+
declare namespace ChatListItemText {
|
|
73
|
+
var displayName: string;
|
|
74
|
+
}
|
|
75
|
+
export type ChatListItemDescriptionProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
76
|
+
/** Who wrote the last message: «Вы», a member of a group. Shown as «{author}: » before it. */
|
|
77
|
+
author?: string;
|
|
78
|
+
/** The last message is not text: its word («Фото», «Голосовое сообщение») leads the preview. */
|
|
79
|
+
kind?: ChatListMediaKind;
|
|
80
|
+
/** Length of a voice or video message, seconds: «Голосовое сообщение 0:42». */
|
|
81
|
+
duration?: number;
|
|
82
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The preview of the last message, one line: the author, the media word and the text (a caption,
|
|
86
|
+
* a file name). The search query is marked in the text. Drawn by `ChatList.Item`.
|
|
87
|
+
*/
|
|
88
|
+
declare function ChatListItemDescription(_props: ChatListItemDescriptionProps): React.ReactNode;
|
|
89
|
+
declare namespace ChatListItemDescription {
|
|
90
|
+
var displayName: string;
|
|
91
|
+
}
|
|
92
|
+
export type ChatListItemMenuProps = Omit<DropdownContentProps, "side" | "align" | "matchTriggerWidth">;
|
|
93
|
+
/**
|
|
94
|
+
* The menu of a dialog: your `Dropdown.Item`s (Закрепить, Без звука, Отметить прочитанным,
|
|
95
|
+
* Удалить — the last one `tone="danger"`). Opens where the pointer is on right click, on a long
|
|
96
|
+
* press, and from the keyboard (Shift+F10, the menu key).
|
|
97
|
+
*/
|
|
98
|
+
declare function ChatListItemMenu({ children, ...rest }: ChatListItemMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
declare namespace ChatListItemMenu {
|
|
100
|
+
var displayName: string;
|
|
101
|
+
}
|
|
102
|
+
type ChatListItemOwnProps = {
|
|
103
|
+
/** When the last message was sent: a `Date` (shown with the root's `formatTime`) or the text to show. */
|
|
104
|
+
time?: Date | string;
|
|
105
|
+
/** Delivery of the reader's own last message: ✓ sent, ✓✓ read, the clock, or failed. */
|
|
106
|
+
status?: MessageStatus;
|
|
107
|
+
/** Unread messages: the count at the end of the row. Default 0. */
|
|
108
|
+
unread?: number;
|
|
109
|
+
/** The reader is mentioned among the unread: an «@» beside the count. */
|
|
110
|
+
mention?: boolean;
|
|
111
|
+
/** Notifications are off: a muted glyph beside the name and a gray count. */
|
|
112
|
+
muted?: boolean;
|
|
113
|
+
/** Pinned by the reader: a pin at the end of the row while nothing is unread. */
|
|
114
|
+
pinned?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* The other side types: the preview turns into «печатает…» in the accent, and back. A name
|
|
117
|
+
* («Анна») for a group: «Анна печатает…».
|
|
118
|
+
*/
|
|
119
|
+
typing?: boolean | string;
|
|
120
|
+
/** The reader's unsent text: the preview shows «Черновик:» and the text. */
|
|
121
|
+
draft?: string;
|
|
122
|
+
/**
|
|
123
|
+
* `ChatList.ItemIcon` (the avatar; after the name — a glyph), `ChatList.ItemText`,
|
|
124
|
+
* `ChatList.ItemDescription`, `ChatList.ItemMenu`.
|
|
125
|
+
*/
|
|
126
|
+
children?: React.ReactNode;
|
|
127
|
+
};
|
|
128
|
+
export type ChatListItemProps = ChatListItemOwnProps & Omit<ListItemProps, keyof ChatListItemOwnProps | "value" | "current" | "asChild" | "disabled">;
|
|
129
|
+
/**
|
|
130
|
+
* A dialog: a `List.Item` row (a button, or a link with `href`) with the avatar, the name and the
|
|
131
|
+
* time on the first line, the preview and the counts on the second. Its key and `current` come
|
|
132
|
+
* from `ChatList.Root`.
|
|
133
|
+
*/
|
|
134
|
+
declare function ChatListItem({ time, status, unread, mention, muted, pinned, typing, draft, className, children, onClick, onKeyDown, onFocus, onContextMenu, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, ref, ...rest }: ChatListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
135
|
+
declare namespace ChatListItem {
|
|
136
|
+
var displayName: string;
|
|
137
|
+
}
|
|
138
|
+
export type ChatListRootProps<T = unknown> = Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "children"> & {
|
|
139
|
+
/** Dialogs as application data, in the order to show (pinned first, then by the last message). */
|
|
140
|
+
items: readonly T[];
|
|
141
|
+
/** A stable key of a dialog: the `value` of its row. */
|
|
142
|
+
getKey: (item: T) => string;
|
|
143
|
+
/** Renders a dialog: a `ChatList.Item` with its parts. */
|
|
144
|
+
renderItem: (item: T) => React.ReactElement;
|
|
145
|
+
/** The open dialog (controlled); `null` — none. */
|
|
146
|
+
value?: string | null;
|
|
147
|
+
/** The dialog open at first (uncontrolled). Default `null`. */
|
|
148
|
+
defaultValue?: string | null;
|
|
149
|
+
/** The reader opened a dialog: a click, a tap, Enter or Space on its row. */
|
|
150
|
+
onValueChange?: (value: string) => void;
|
|
151
|
+
/** The search query (controlled). Any of the triad shows the search field. */
|
|
152
|
+
search?: string;
|
|
153
|
+
/** The initial query (uncontrolled). */
|
|
154
|
+
defaultSearch?: string;
|
|
155
|
+
/** The query changed: filter `items` by it (the list marks the matches). */
|
|
156
|
+
onSearchChange?: (search: string) => void;
|
|
157
|
+
/** The first load: placeholder rows in the rows' geometry, then a cross-fade into the dialogs. */
|
|
158
|
+
loading?: boolean;
|
|
159
|
+
/** More dialogs exist: a placeholder row ends the list and `onLoadMore` runs near the end. */
|
|
160
|
+
hasMore?: boolean;
|
|
161
|
+
/** The reader scrolled near the end while `hasMore`: load the next dialogs and append them. */
|
|
162
|
+
onLoadMore?: () => void | Promise<void>;
|
|
163
|
+
/** The empty state without a search. Default: «Нет диалогов». */
|
|
164
|
+
empty?: React.ReactNode;
|
|
165
|
+
/** Row tier: height, text, avatar, the search field. Default `m`. */
|
|
166
|
+
size?: ControlSize;
|
|
167
|
+
/** «Now» for the times. Default: the moment of the render. */
|
|
168
|
+
now?: Date;
|
|
169
|
+
/** Display of a `Date` time. Default `formatChatTime`: «14:32», «пн», «12 мар». */
|
|
170
|
+
formatTime?: (date: Date, now: Date) => string;
|
|
171
|
+
labels?: Partial<ChatListLabels>;
|
|
172
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* The conversation list of a messenger: the dialogs as data, each drawn by `renderItem` as a
|
|
176
|
+
* `ChatList.Item`, the open one `value`. An optional search field on top, rows that glide to their
|
|
177
|
+
* new places when the order changes, a long list rendered only around the view, placeholder rows
|
|
178
|
+
* while loading and more dialogs loaded near the end. Draws no surface: put it in a pane.
|
|
179
|
+
*/
|
|
180
|
+
declare function ChatListRoot<T>({ items, getKey, renderItem, value: valueProp, defaultValue, onValueChange, search: searchProp, defaultSearch, onSearchChange, loading, hasMore, onLoadMore, empty, size, now: nowProp, formatTime, labels: labelsProp, className, ref, ...rest }: ChatListRootProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
181
|
+
declare namespace ChatListRoot {
|
|
182
|
+
var displayName: string;
|
|
183
|
+
}
|
|
184
|
+
export declare const ChatList: {
|
|
185
|
+
Root: typeof ChatListRoot;
|
|
186
|
+
Item: typeof ChatListItem;
|
|
187
|
+
ItemIcon: typeof ChatListItemIcon;
|
|
188
|
+
ItemText: typeof ChatListItemText;
|
|
189
|
+
ItemDescription: typeof ChatListItemDescription;
|
|
190
|
+
ItemMenu: typeof ChatListItemMenu;
|
|
191
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The time of a dialog's last message, as a messenger shows it: today «14:32», within the last
|
|
3
|
+
* six days the weekday «пн», earlier this year «12 мар», another year «12.03.2025». The default
|
|
4
|
+
* `ChatList.Root formatTime`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatChatTime(date: Date, now: Date): string;
|
|
@@ -119,11 +119,16 @@ export type CommandMenuItemProps = Omit<React.ButtonHTMLAttributes<HTMLButtonEle
|
|
|
119
119
|
keywords?: string;
|
|
120
120
|
/** Unavailable right now: shown muted with `aria-disabled`, skipped by the arrows, not runnable. */
|
|
121
121
|
disabled?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Shown whatever the query and never counted as a match (the match count, `CommandMenu.Empty`);
|
|
124
|
+
* the arrows reach it after the matches. For one «create from the query» item at the end.
|
|
125
|
+
*/
|
|
126
|
+
persistent?: boolean;
|
|
122
127
|
/** Runs the command: a click, or Enter while the item is active. */
|
|
123
128
|
onSelect?: () => void;
|
|
124
129
|
ref?: React.Ref<HTMLButtonElement>;
|
|
125
130
|
};
|
|
126
|
-
declare function CommandMenuItem({ className, value, keywords, disabled, onSelect, onClick, onPointerMove, ref, children, ...rest }: CommandMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
131
|
+
declare function CommandMenuItem({ className, value, keywords, disabled, persistent, onSelect, onClick, onPointerMove, ref, children, ...rest }: CommandMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
127
132
|
declare namespace CommandMenuItem {
|
|
128
133
|
var displayName: string;
|
|
129
134
|
}
|
|
@@ -154,15 +159,15 @@ declare function CommandMenuItemShortcut({ className, ...rest }: CommandMenuItem
|
|
|
154
159
|
declare namespace CommandMenuItemShortcut {
|
|
155
160
|
var displayName: string;
|
|
156
161
|
}
|
|
157
|
-
export type CommandMenuEmptyProps = Omit<React.HTMLAttributes<HTMLDivElement>, "role"> & {
|
|
162
|
+
export type CommandMenuEmptyProps = Omit<React.HTMLAttributes<HTMLDivElement>, "role" | "children"> & {
|
|
158
163
|
ref?: React.Ref<HTMLDivElement>;
|
|
159
164
|
};
|
|
160
165
|
/**
|
|
161
166
|
* Shown only while nothing matches the query and nothing loads: `labels.empty` and
|
|
162
|
-
* `labels.emptyHint
|
|
163
|
-
*
|
|
167
|
+
* `labels.emptyHint`, text only. An action for the query («Создать «…»») is a `persistent`
|
|
168
|
+
* `CommandMenu.Item` at the end of the list, never a child of `Empty`.
|
|
164
169
|
*/
|
|
165
|
-
declare function CommandMenuEmpty(
|
|
170
|
+
declare function CommandMenuEmpty(props: CommandMenuEmptyProps): import("react/jsx-runtime").JSX.Element | null;
|
|
166
171
|
declare namespace CommandMenuEmpty {
|
|
167
172
|
var displayName: string;
|
|
168
173
|
}
|
|
@@ -2,10 +2,11 @@ import * as React from "react";
|
|
|
2
2
|
import type { UploadItem, UploadQueue } from "../../hooks/useUploadQueue";
|
|
3
3
|
import { type MediaKind } from "../../internal/mediaKind";
|
|
4
4
|
import { type ControlSize } from "../../internal/states";
|
|
5
|
+
import { type TextFormattingLabels } from "../../internal/textFormatting";
|
|
5
6
|
import { type ComposerRecording, type ComposerRecordMode } from "./useRecorder";
|
|
6
|
-
export type { ComposerFormat } from "./format";
|
|
7
7
|
export type { ComposerRecording, ComposerRecordMode } from "./useRecorder";
|
|
8
|
-
|
|
8
|
+
/** Every built-in string; the formatting toolbar's names are shared with Textarea. */
|
|
9
|
+
export type ComposerLabels = TextFormattingLabels & {
|
|
9
10
|
/** Accessible name of the composer `<form>`. */
|
|
10
11
|
region: string;
|
|
11
12
|
/** Placeholder and accessible name of the message field. */
|
|
@@ -60,14 +61,6 @@ export type ComposerLabels = {
|
|
|
60
61
|
attachments: string;
|
|
61
62
|
/** The option that sends the attached photos and videos as files, uncompressed. */
|
|
62
63
|
sendAsFiles: string;
|
|
63
|
-
/** Accessible name of the formatting toolbar. */
|
|
64
|
-
formatting: string;
|
|
65
|
-
bold: string;
|
|
66
|
-
italic: string;
|
|
67
|
-
strikethrough: string;
|
|
68
|
-
code: string;
|
|
69
|
-
link: string;
|
|
70
|
-
quote: string;
|
|
71
64
|
/** Name of the close button of a reply bar. */
|
|
72
65
|
cancelReply: string;
|
|
73
66
|
/** Name of the close button of an edit bar. */
|
|
@@ -4,7 +4,7 @@ import { DataTableColumnsMenu } from "./ColumnsMenu";
|
|
|
4
4
|
import type { DataTableColumn, DataTableGroup, DataTableRowClickEvent, DataTableSortState } from "./types";
|
|
5
5
|
export type { DataTableColumnsMenuProps } from "./ColumnsMenu";
|
|
6
6
|
export type { DataTableColumn, DataTableGroup, DataTableOrder, DataTableRowClickEvent, DataTableSortState, } from "./types";
|
|
7
|
-
/** System strings; `{from}`, `{to}`, `{total}`, `{label}`, `{count}` are replaced. */
|
|
7
|
+
/** System strings; `{from}`, `{to}`, `{total}`, `{label}`, `{count}`, `{group}` are replaced. */
|
|
8
8
|
export type DataTableLabels = {
|
|
9
9
|
/** Screen-reader announcement while skeleton rows are shown. */
|
|
10
10
|
loading: string;
|
|
@@ -34,6 +34,10 @@ export type DataTableLabels = {
|
|
|
34
34
|
reorderRow: string;
|
|
35
35
|
/** Tooltip of the handles while the table is sorted by a column (reordering is off). */
|
|
36
36
|
reorderSorted: string;
|
|
37
|
+
/** `aria-label` of the toggle of a collapsed group; `{group}` is the group key. */
|
|
38
|
+
expandGroup: string;
|
|
39
|
+
/** `aria-label` of the toggle of an expanded group; `{group}` is the group key. */
|
|
40
|
+
collapseGroup: string;
|
|
37
41
|
};
|
|
38
42
|
export type DataTableProps<Row> = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
39
43
|
/** The outer card-fill `<div>`. */
|
|
@@ -166,8 +170,18 @@ export type DataTableProps<Row> = Omit<React.HTMLAttributes<HTMLDivElement>, "ch
|
|
|
166
170
|
renderGroupHeader?: (group: DataTableGroup<Row>) => React.ReactNode;
|
|
167
171
|
/** Group header rows stick under the head while their rows scroll. */
|
|
168
172
|
stickyGroupHeaders?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Keys of the collapsed groups, controlled. Passing any of `collapsedGroups`,
|
|
175
|
+
* `defaultCollapsedGroups`, `onCollapsedGroupsChange` makes groups fold: each group header gets
|
|
176
|
+
* a disclosure toggle and its rows fold away and back.
|
|
177
|
+
*/
|
|
178
|
+
collapsedGroups?: (string | number)[];
|
|
179
|
+
/** Initially collapsed group keys, uncontrolled (`[]` — every group open, but foldable). */
|
|
180
|
+
defaultCollapsedGroups?: (string | number)[];
|
|
181
|
+
/** The collapsed group keys changed (a group header toggle). */
|
|
182
|
+
onCollapsedGroupsChange?: (collapsedGroups: (string | number)[]) => void;
|
|
169
183
|
};
|
|
170
|
-
export declare function DataTable<Row>({ columns: allColumns, hiddenColumns, defaultHiddenColumns, onHiddenColumnsChange, rows, source, rowCount, size, className, showHeader, stickyHeader, stickyFirstColumn, getRowKey, getRowHref, onRowClick, isRowClickable, loading, empty, labels: labelsProp, rowDividers, columnDividers, sort, defaultSort, onSortChange, paging, page, defaultPage, onPageChange, pageSize, infiniteBatchSize, hasMore, loadingMore, onLoadMore, scrollHeight, fullWidth, highlightRowOnHover, highlightColumnOnHover, striped, getRowLabel, selectable, selected, defaultSelected, onSelectedChange, onReorder, getRowChildren, renderExpanded, isRowExpandable, expanded, defaultExpanded, onExpandedChange, error, loadingRows, toolbar, getRowGroup, renderGroupHeader, stickyGroupHeaders, ref, ...rest }: DataTableProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
184
|
+
export declare function DataTable<Row>({ columns: allColumns, hiddenColumns, defaultHiddenColumns, onHiddenColumnsChange, rows, source, rowCount, size, className, showHeader, stickyHeader, stickyFirstColumn, getRowKey, getRowHref, onRowClick, isRowClickable, loading, empty, labels: labelsProp, rowDividers, columnDividers, sort, defaultSort, onSortChange, paging, page, defaultPage, onPageChange, pageSize, infiniteBatchSize, hasMore, loadingMore, onLoadMore, scrollHeight, fullWidth, highlightRowOnHover, highlightColumnOnHover, striped, getRowLabel, selectable, selected, defaultSelected, onSelectedChange, onReorder, getRowChildren, renderExpanded, isRowExpandable, expanded, defaultExpanded, onExpandedChange, error, loadingRows, toolbar, getRowGroup, renderGroupHeader, stickyGroupHeaders, collapsedGroups, defaultCollapsedGroups, onCollapsedGroupsChange, ref, ...rest }: DataTableProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
171
185
|
export declare namespace DataTable {
|
|
172
186
|
var ColumnsMenu: typeof DataTableColumnsMenu;
|
|
173
187
|
}
|
|
@@ -47,8 +47,10 @@ type DataTableRowProps<Row> = {
|
|
|
47
47
|
expandable: boolean;
|
|
48
48
|
expanded: boolean;
|
|
49
49
|
animate: boolean;
|
|
50
|
-
/** A
|
|
50
|
+
/** A row of a collapsing parent or group: it folds away before it unmounts. */
|
|
51
51
|
folding?: boolean;
|
|
52
|
+
/** The row folds open and shut: a sub-row, or a row of a collapsible group. */
|
|
53
|
+
foldable?: boolean;
|
|
52
54
|
/** The detail panel opened by the latest expand: it drops in. */
|
|
53
55
|
detailAnimate: boolean;
|
|
54
56
|
selected: boolean;
|
|
@@ -59,28 +61,42 @@ type DataTableRowProps<Row> = {
|
|
|
59
61
|
/** A virtualized body: the row's position among all rows of the table, head included. */
|
|
60
62
|
ariaRowIndex?: number | undefined;
|
|
61
63
|
};
|
|
62
|
-
declare function DataTableRowImpl<Row>({ shared, row, rowKey, rowLabel, opens, href, index, depth, expandable, expanded, animate, folding, detailAnimate, selected, childControls, measureRef, ariaRowIndex, }: DataTableRowProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
declare function DataTableRowImpl<Row>({ shared, row, rowKey, rowLabel, opens, href, index, depth, expandable, expanded, animate, folding, foldable, detailAnimate, selected, childControls, measureRef, ariaRowIndex, }: DataTableRowProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
63
65
|
/** A body row (plus its detail panel); re-renders only when its own props change. */
|
|
64
66
|
export declare const DataTableRow: typeof DataTableRowImpl;
|
|
67
|
+
/** The disclosure toggle of a collapsible group (`collapsedGroups`). */
|
|
68
|
+
export type GroupToggle = {
|
|
69
|
+
collapsed: boolean;
|
|
70
|
+
/** `labels.expandGroup` / `labels.collapseGroup` with `{group}` filled in. */
|
|
71
|
+
label: string;
|
|
72
|
+
/** Ids of the group's rows on screen (while expanded). */
|
|
73
|
+
controls: string | undefined;
|
|
74
|
+
onToggle: () => void;
|
|
75
|
+
};
|
|
65
76
|
type GroupRowProps = {
|
|
66
77
|
totalColumns: number;
|
|
67
78
|
sticky: boolean;
|
|
79
|
+
size: ControlSize;
|
|
80
|
+
toggle?: GroupToggle | undefined;
|
|
68
81
|
children: React.ReactNode;
|
|
69
82
|
};
|
|
70
83
|
/**
|
|
71
84
|
* The header row of a group (`getRowGroup`): a `<th scope="rowgroup">` across every column at the
|
|
72
|
-
* head of its own `<tbody
|
|
85
|
+
* head of its own `<tbody>`, led by a disclosure toggle when groups fold. Its content stays in the
|
|
86
|
+
* visible width while the table scrolls sideways.
|
|
73
87
|
*/
|
|
74
|
-
export declare function GroupRow({ totalColumns, sticky, children }: GroupRowProps): import("react/jsx-runtime").JSX.Element;
|
|
88
|
+
export declare function GroupRow({ totalColumns, sticky, size, toggle, children }: GroupRowProps): import("react/jsx-runtime").JSX.Element;
|
|
75
89
|
type MeasureBodyProps<Row> = {
|
|
76
90
|
rows: MeasureRow<Row>[];
|
|
77
91
|
columns: DataTableColumn<Row>[];
|
|
78
92
|
selectable: boolean;
|
|
79
93
|
expandEnabled: boolean;
|
|
94
|
+
/** A leading column of row handles (`onReorder`). */
|
|
95
|
+
reorderable: boolean;
|
|
80
96
|
};
|
|
81
97
|
/**
|
|
82
|
-
* Sub-rows of collapsed rows, laid out invisibly so the columns are
|
|
83
|
-
* be once a row opens; never shown or reachable.
|
|
98
|
+
* Sub-rows of collapsed rows and rows of collapsed groups, laid out invisibly so the columns are
|
|
99
|
+
* already as wide as they will be once a row or group opens; never shown or reachable.
|
|
84
100
|
*/
|
|
85
|
-
export declare function MeasureBody<Row>({ rows, columns, selectable, expandEnabled, }: MeasureBodyProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
export declare function MeasureBody<Row>({ rows, columns, selectable, expandEnabled, reorderable, }: MeasureBodyProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
86
102
|
export {};
|
|
@@ -15,6 +15,10 @@ type StateRowsProps<Row> = {
|
|
|
15
15
|
emptyLabel: string;
|
|
16
16
|
skeletonRows: number;
|
|
17
17
|
};
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* The body of the loading (skeleton rows), empty and error states. The empty and error content sits
|
|
20
|
+
* in a sticky box of the visible width, so a wide table centres it in the viewport, not across
|
|
21
|
+
* every column.
|
|
22
|
+
*/
|
|
19
23
|
export declare function StateRows<Row>({ state, columns, size, totalColumns, selectable, expandEnabled, reorderable, error, empty, emptyLabel, skeletonRows, }: StateRowsProps<Row>): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
|
|
20
24
|
export {};
|
|
@@ -77,10 +77,12 @@ type HandleCellProps = {
|
|
|
77
77
|
rowKey: React.Key;
|
|
78
78
|
rowLabel: string | undefined;
|
|
79
79
|
className?: string | undefined;
|
|
80
|
+
/** Wraps the content like the row's other cells (the fold of a collapsible group's row). */
|
|
81
|
+
wrap?: (node: React.ReactNode) => React.ReactNode;
|
|
80
82
|
};
|
|
81
83
|
/**
|
|
82
84
|
* The leading cell of a reorderable row: the grip (Alt + ↑ / ↓ from the keyboard), a spinner while
|
|
83
85
|
* the owner saves this row's move, and, while the table is sorted, a disabled grip that says why.
|
|
84
86
|
*/
|
|
85
|
-
export declare function ReorderHandleCell({ reorder, rowKey, rowLabel, className }: HandleCellProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export declare function ReorderHandleCell({ reorder, rowKey, rowLabel, className, wrap }: HandleCellProps): import("react/jsx-runtime").JSX.Element;
|
|
86
88
|
export {};
|
|
@@ -28,16 +28,22 @@ export type FlatRow<Row> = {
|
|
|
28
28
|
expanded: boolean;
|
|
29
29
|
/** Mounted by the latest expand, or newly added to `rows`: plays the enter animation. */
|
|
30
30
|
animate: boolean;
|
|
31
|
-
/** A
|
|
31
|
+
/** A row of a collapsing parent or group: still drawn while it folds away. */
|
|
32
32
|
folding: boolean;
|
|
33
|
-
/**
|
|
34
|
-
|
|
33
|
+
/** The row folds open and shut: a sub-row, or a row of a collapsible group. */
|
|
34
|
+
foldable: boolean;
|
|
35
35
|
};
|
|
36
36
|
export type MeasureRow<Row> = {
|
|
37
37
|
row: Row;
|
|
38
38
|
key: React.Key;
|
|
39
39
|
depth: number;
|
|
40
40
|
};
|
|
41
|
+
/** A run of rows of one group on screen: its key and the range of its rows in `rows`. */
|
|
42
|
+
export type GroupRun = {
|
|
43
|
+
key: string | number;
|
|
44
|
+
start: number;
|
|
45
|
+
end: number;
|
|
46
|
+
};
|
|
41
47
|
export type FlattenOptions<Row> = {
|
|
42
48
|
/** Top-level rows in `[start, end)` are rendered; the rest only contribute keys. */
|
|
43
49
|
start: number;
|
|
@@ -59,8 +65,16 @@ export type FlattenOptions<Row> = {
|
|
|
59
65
|
lastExpandedKey: React.Key | null;
|
|
60
66
|
/** Collect every key of the data (all pages, all depths) for «select all». */
|
|
61
67
|
collectKeys: boolean;
|
|
62
|
-
/** Group key of a top-level row:
|
|
68
|
+
/** Group key of a top-level row: consecutive rows of one group on screen make a run. */
|
|
63
69
|
groupOf?: (row: Row) => string | number;
|
|
70
|
+
/** Groups fold (`collapsedGroups`): their rows fold open and shut. */
|
|
71
|
+
foldGroups?: boolean;
|
|
72
|
+
/** Collapsed groups: their rows are not drawn (only measured for the column widths). */
|
|
73
|
+
collapsedGroups?: ReadonlySet<string | number>;
|
|
74
|
+
/** Groups collapsed a moment ago: their rows stay drawn (folding) until the fold ends. */
|
|
75
|
+
closingGroups?: ReadonlySet<string | number>;
|
|
76
|
+
/** Group whose latest expand mounted its rows: they fold open. */
|
|
77
|
+
openedGroup?: string | number | null;
|
|
64
78
|
};
|
|
65
79
|
export type Flattened<Row> = {
|
|
66
80
|
/** Rendered rows in order: the page rows plus the sub-rows of expanded rows. */
|
|
@@ -72,6 +86,8 @@ export type Flattened<Row> = {
|
|
|
72
86
|
measure: MeasureRow<Row>[];
|
|
73
87
|
/** Every row id in the data: the scope of «select all» (empty without `collectKeys`). */
|
|
74
88
|
keys: React.Key[];
|
|
89
|
+
/** Group runs on screen in order (`groupOf`); a collapsed group's run holds no rows. */
|
|
90
|
+
runs: GroupRun[];
|
|
75
91
|
};
|
|
76
92
|
/**
|
|
77
93
|
* One walk over the sorted data. Sub-rows are sorted like the top level and keyed the same way in
|
|
@@ -29,6 +29,11 @@ export type FileUploadFile = {
|
|
|
29
29
|
src?: string;
|
|
30
30
|
/** What the picture shows: spoken in place of the name, never drawn. */
|
|
31
31
|
alt?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The file's address on the server: the row's name or the whole tile becomes a link that opens it
|
|
34
|
+
* in a new tab (the server's `Content-Disposition` decides open or download).
|
|
35
|
+
*/
|
|
36
|
+
href?: string;
|
|
32
37
|
};
|
|
33
38
|
export type FileUploadLabels = {
|
|
34
39
|
/** Title of the built-in drop zone body. */
|
|
@@ -67,6 +72,8 @@ export type FileUploadLabels = {
|
|
|
67
72
|
retry: string;
|
|
68
73
|
/** Name of the remove button of a file: `{name}`. */
|
|
69
74
|
remove: string;
|
|
75
|
+
/** Name of a tile's link to the file (`href`): `{name}`. */
|
|
76
|
+
open: string;
|
|
70
77
|
/** Live region: a file was removed: `{name}`. */
|
|
71
78
|
removed: string;
|
|
72
79
|
/** Live region: a reorder put another file first, the new cover: `{name}`. */
|
|
@@ -3,6 +3,8 @@ import * as React from "react";
|
|
|
3
3
|
import type { ControlSize } from "../../internal/states";
|
|
4
4
|
import { type GanttBar, type GanttDates, type GanttScale } from "./ganttModel";
|
|
5
5
|
export type { GanttBar, GanttDates, GanttScale } from "./ganttModel";
|
|
6
|
+
/** What opened a row: a click on its header, or Enter / Space on the focused header. */
|
|
7
|
+
export type GanttRowClickEvent = React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
|
|
6
8
|
/** System strings; `{label}`, `{start}`, `{end}`, `{date}`, `{progress}` are replaced. */
|
|
7
9
|
export type GanttLabels = {
|
|
8
10
|
/** Heading of the first column. */
|
|
@@ -55,6 +57,22 @@ export type GanttProps<Row, Bar extends GanttBar = GanttBar> = Omit<React.HTMLAt
|
|
|
55
57
|
renderRow?: (row: Row) => React.ReactNode;
|
|
56
58
|
/** A picture before the row content (an `Avatar`); on a narrow chart the column keeps only it. */
|
|
57
59
|
renderRowAvatar?: (row: Row) => React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* The row header is a link: a real `<a>` fills the first column and is the row's stop in the
|
|
62
|
+
* grid, so a click, ⌘/Ctrl-click, a middle click and «open in new tab» work on it.
|
|
63
|
+
*/
|
|
64
|
+
getRowHref?: (row: Row) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Opens a row in place: a click on its header (never on a control inside it, never from a
|
|
67
|
+
* portal) or Enter / Space on the focused header. With `getRowHref` it gets the plain clicks
|
|
68
|
+
* only — call `event.preventDefault()` there to route in the app instead of loading the page.
|
|
69
|
+
*/
|
|
70
|
+
onRowClick?: (row: Row, event: GanttRowClickEvent) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Extra content of a bar's tooltip, under its title and the dates line (which always stay: the
|
|
73
|
+
* dates are what the bar means on the axis). A client, hours, an owner.
|
|
74
|
+
*/
|
|
75
|
+
renderBarTooltip?: (bar: Bar, row: Row) => React.ReactNode;
|
|
58
76
|
/** Zoom, controlled. */
|
|
59
77
|
scale?: GanttScale;
|
|
60
78
|
/** Initial zoom, uncontrolled. */
|
|
@@ -99,4 +117,4 @@ export type GanttProps<Row, Bar extends GanttBar = GanttBar> = Omit<React.HTMLAt
|
|
|
99
117
|
* keyboard through an async `onBarChange`, and are drawn on empty space through `onBarCreate`.
|
|
100
118
|
* Rows and the time axis are virtualized: thousands of rows over years stay fast.
|
|
101
119
|
*/
|
|
102
|
-
export declare function Gantt<Row, Bar extends GanttBar = GanttBar>({ rows, getRowKey, getRowLabel, getRowBars, renderRow, renderRowAvatar, scale: scaleProp, defaultScale, onScaleChange, range: rangeProp, today: todayProp, locale, size, readOnly, loading, empty, toolbar, scrollHeight, onSelect, onBarChange, onBarCreate, labels: labelsProp, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...rest }: GanttProps<Row, Bar>): import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
export declare function Gantt<Row, Bar extends GanttBar = GanttBar>({ rows, getRowKey, getRowLabel, getRowBars, renderRow, renderRowAvatar, getRowHref, onRowClick, renderBarTooltip, scale: scaleProp, defaultScale, onScaleChange, range: rangeProp, today: todayProp, locale, size, readOnly, loading, empty, toolbar, scrollHeight, onSelect, onBarChange, onBarCreate, labels: labelsProp, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...rest }: GanttProps<Row, Bar>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Locale } from "date-fns";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { type GanttBar, type GanttDates, type GanttScale } from "./ganttModel";
|
|
3
4
|
export type GanttBarViewProps = {
|
|
4
5
|
bar: GanttBar;
|
|
@@ -13,6 +14,8 @@ export type GanttBarViewProps = {
|
|
|
13
14
|
nameFor: (dates: GanttDates) => string;
|
|
14
15
|
/** «14 дн.» — the duration in the tooltip. */
|
|
15
16
|
formatDuration: (days: number) => string;
|
|
17
|
+
/** `renderBarTooltip`: extra tooltip content under the dates line. */
|
|
18
|
+
renderTip?: () => React.ReactNode;
|
|
16
19
|
editable: boolean;
|
|
17
20
|
pending: boolean;
|
|
18
21
|
/** The roving tab stop of the chart. */
|
|
@@ -48,4 +51,4 @@ export type GanttBarViewProps = {
|
|
|
48
51
|
* edge at the week and month zoom, and the tooltip shows the new dates. Release commits through
|
|
49
52
|
* `onCommit`; Escape or a cancelled pointer drops it. On touch a long press picks the bar up.
|
|
50
53
|
*/
|
|
51
|
-
export declare function GanttBarView({ bar, dates, x, lane, scale, locale, nameFor, formatDuration, editable, pending, active, hintId, dayPx, direction, scrollLeft, autoScroll, onActivate, onFocusBar, onTipChange, canShowTip, onCommit, onDragChange, barRef, }: GanttBarViewProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare function GanttBarView({ bar, dates, x, lane, scale, locale, nameFor, formatDuration, renderTip, editable, pending, active, hintId, dayPx, direction, scrollLeft, autoScroll, onActivate, onFocusBar, onTipChange, canShowTip, onCommit, onDragChange, barRef, }: GanttBarViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,6 +16,8 @@ export type GanttRowContext = {
|
|
|
16
16
|
register: (id: string) => (node: HTMLElement | null) => void;
|
|
17
17
|
focus: (id: string) => void;
|
|
18
18
|
select: (barId: string, rowIndex: number) => void;
|
|
19
|
+
/** `onRowClick` of the row at `rowIndex`. */
|
|
20
|
+
openRow: (rowIndex: number, event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;
|
|
19
21
|
commit: (barId: string, rowIndex: number, dates: GanttDates) => void;
|
|
20
22
|
nameFor: (bar: GanttBar, dates: GanttDates) => string;
|
|
21
23
|
formatDuration: (days: number) => string;
|
|
@@ -47,6 +49,11 @@ export type GanttRowProps = {
|
|
|
47
49
|
row: unknown;
|
|
48
50
|
renderRow?: (row: unknown) => React.ReactNode;
|
|
49
51
|
renderRowAvatar?: (row: unknown) => React.ReactNode;
|
|
52
|
+
renderBarTooltip?: (bar: GanttBar, row: unknown) => React.ReactNode;
|
|
53
|
+
/** `getRowHref(row)`: the header is a link. */
|
|
54
|
+
href: string | undefined;
|
|
55
|
+
/** `onRowClick` is set: the header opens the row. */
|
|
56
|
+
clickable: boolean;
|
|
50
57
|
ghost: GanttGhost | undefined;
|
|
51
58
|
ghostLane: number;
|
|
52
59
|
hover: {
|
|
@@ -69,7 +76,7 @@ export type GanttRowProps = {
|
|
|
69
76
|
hintId: string;
|
|
70
77
|
createHintId: string;
|
|
71
78
|
};
|
|
72
|
-
declare function GanttRowView({ ctx, index, navId, label, bars, lanes, laneCount, top, measureRef, row, renderRow, renderRowAvatar, ghost, ghostLane, hover, tabStop, pending, dragging, windowFrom, windowTo, scale, rangeStart, locale, newBarLabel, editableAtAll, creatable, hintId, createHintId, }: GanttRowProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
declare function GanttRowView({ ctx, index, navId, label, bars, lanes, laneCount, top, measureRef, row, renderRow, renderRowAvatar, renderBarTooltip, href, clickable, ghost, ghostLane, hover, tabStop, pending, dragging, windowFrom, windowTo, scale, rangeStart, locale, newBarLabel, editableAtAll, creatable, hintId, createHintId, }: GanttRowProps): import("react/jsx-runtime").JSX.Element;
|
|
73
80
|
/** One row of the chart: memoized, so scrolling renders only the rows that come into view. */
|
|
74
81
|
export declare const GanttRow: React.MemoExoticComponent<typeof GanttRowView>;
|
|
75
82
|
export {};
|