@expcat/tigercat-react 0.2.27 → 0.3.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/dist/chunk-4IO2M3ZJ.js +110 -0
- package/dist/{chunk-2UVQIL26.mjs → chunk-6DYS4PJT.mjs} +1 -1
- package/dist/chunk-6YKZAWNX.js +258 -0
- package/dist/chunk-73DMQ2SR.mjs +206 -0
- package/dist/chunk-FAZQT7YP.mjs +255 -0
- package/dist/{chunk-HRYBEBZC.js → chunk-GJKT2B56.js} +5 -1
- package/dist/{chunk-5XKYWZZZ.mjs → chunk-HGTF6A46.mjs} +5 -1
- package/dist/chunk-HT2BXCEM.js +264 -0
- package/dist/{chunk-6ZC7H22S.mjs → chunk-IAF24RKI.mjs} +1 -1
- package/dist/chunk-IYFSM2GA.mjs +141 -0
- package/dist/chunk-JAVDNFJD.js +144 -0
- package/dist/{chunk-P273E6XE.js → chunk-MQTHGPHF.js} +37 -21
- package/dist/chunk-OVWCTDAL.js +209 -0
- package/dist/{chunk-GIYBVWR4.mjs → chunk-OZLAGTZW.mjs} +38 -22
- package/dist/{chunk-OD2NNQD2.js → chunk-PBJ2J2B3.js} +2 -2
- package/dist/chunk-PVOQUXIB.mjs +189 -0
- package/dist/chunk-R67R3TVA.mjs +261 -0
- package/dist/{chunk-VR5OP4MO.js → chunk-UG3I4PCY.js} +2 -2
- package/dist/chunk-WKGCUR7O.mjs +107 -0
- package/dist/chunk-ZN2BZCTI.js +192 -0
- package/dist/components/ActivityFeed.d.mts +10 -0
- package/dist/components/ActivityFeed.d.ts +10 -0
- package/dist/components/ActivityFeed.js +23 -0
- package/dist/components/ActivityFeed.mjs +8 -0
- package/dist/components/AreaChart.js +4 -4
- package/dist/components/AreaChart.mjs +2 -2
- package/dist/components/BarChart.js +4 -4
- package/dist/components/BarChart.mjs +2 -2
- package/dist/components/ChatWindow.d.mts +12 -0
- package/dist/components/ChatWindow.d.ts +12 -0
- package/dist/components/ChatWindow.js +20 -0
- package/dist/components/ChatWindow.mjs +5 -0
- package/dist/components/CommentThread.d.mts +8 -0
- package/dist/components/CommentThread.d.ts +8 -0
- package/dist/components/CommentThread.js +21 -0
- package/dist/components/CommentThread.mjs +6 -0
- package/dist/components/DataTableWithToolbar.d.mts +51 -0
- package/dist/components/DataTableWithToolbar.d.ts +51 -0
- package/dist/components/DataTableWithToolbar.js +24 -0
- package/dist/components/DataTableWithToolbar.mjs +9 -0
- package/dist/components/DonutChart.js +5 -5
- package/dist/components/DonutChart.mjs +3 -3
- package/dist/components/Dropdown.js +4 -4
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/DropdownItem.js +4 -4
- package/dist/components/DropdownItem.mjs +3 -3
- package/dist/components/FormItem.js +2 -2
- package/dist/components/FormItem.mjs +1 -1
- package/dist/components/FormWizard.d.mts +10 -0
- package/dist/components/FormWizard.d.ts +10 -0
- package/dist/components/FormWizard.js +19 -0
- package/dist/components/FormWizard.mjs +4 -0
- package/dist/components/LineChart.js +4 -4
- package/dist/components/LineChart.mjs +2 -2
- package/dist/components/NotificationCenter.d.mts +8 -0
- package/dist/components/NotificationCenter.d.ts +8 -0
- package/dist/components/NotificationCenter.js +23 -0
- package/dist/components/NotificationCenter.mjs +8 -0
- package/dist/components/PieChart.js +4 -4
- package/dist/components/PieChart.mjs +2 -2
- package/dist/components/RadarChart.js +4 -4
- package/dist/components/RadarChart.mjs +2 -2
- package/dist/components/ScatterChart.js +4 -4
- package/dist/components/ScatterChart.mjs +2 -2
- package/dist/components/Table.d.mts +1 -1
- package/dist/components/Table.d.ts +1 -1
- package/dist/components/Table.js +2 -2
- package/dist/components/Table.mjs +1 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +197 -167
- package/dist/index.mjs +49 -43
- package/package.json +2 -2
- package/dist/{chunk-ZYF5GI2Q.js → chunk-4PTI6ZUK.js} +1 -1
- package/dist/{chunk-LIJLFLYE.js → chunk-4TWHENPT.js} +1 -1
- package/dist/{chunk-67WZRMD6.js → chunk-6E5UKM6O.js} +1 -1
- package/dist/{chunk-AFFSBNYB.mjs → chunk-AITVDDCE.mjs} +1 -1
- package/dist/{chunk-324UKFG2.mjs → chunk-IL2Y5RCX.mjs} +1 -1
- package/dist/{chunk-7SOL3UJ2.js → chunk-L63N3LCG.js} +1 -1
- package/dist/{chunk-E6GLWHRL.mjs → chunk-LZNG2HGC.mjs} +1 -1
- package/dist/{chunk-2VXA4YOP.js → chunk-N32MAX4A.js} +1 -1
- package/dist/{chunk-RKBNIEGF.mjs → chunk-PT4WLSTJ.mjs} +1 -1
- package/dist/{chunk-LWW2LXCP.js → chunk-SIB4EHB6.js} +1 -1
- package/dist/{chunk-2WLSB7K2.mjs → chunk-WYTHTJN3.mjs} +1 -1
- package/dist/{chunk-5QKBBGIA.mjs → chunk-YER7IQF4.mjs} +1 -1
- package/dist/{chunk-7IKJBQQV.mjs → chunk-YGOTPK2W.mjs} +1 -1
- package/dist/{chunk-KKHKQP6Z.js → chunk-ZUUG3WOL.js} +1 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Timeline } from './chunk-LADCWARG.mjs';
|
|
2
|
+
import { Link } from './chunk-WSJO2PIE.mjs';
|
|
3
|
+
import { Loading } from './chunk-PUDU34R4.mjs';
|
|
4
|
+
import { Tag } from './chunk-DIZNY6N4.mjs';
|
|
5
|
+
import { Text } from './chunk-6YDIBMCM.mjs';
|
|
6
|
+
import { Card } from './chunk-VD3IK5XT.mjs';
|
|
7
|
+
import { Avatar } from './chunk-V2HVHLBY.mjs';
|
|
8
|
+
import { useMemo } from 'react';
|
|
9
|
+
import { buildActivityGroups, classNames, toActivityTimelineItems, formatActivityTime } from '@expcat/tigercat-core';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var renderAction = (item, action, index) => {
|
|
13
|
+
const key = action.key ?? `${item.id}-action-${index}`;
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Link,
|
|
16
|
+
{
|
|
17
|
+
size: "sm",
|
|
18
|
+
variant: "primary",
|
|
19
|
+
href: action.href,
|
|
20
|
+
target: action.target,
|
|
21
|
+
disabled: action.disabled,
|
|
22
|
+
onClick: () => action.onClick?.(item, action),
|
|
23
|
+
children: action.label
|
|
24
|
+
},
|
|
25
|
+
key
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
var ActivityFeed = ({
|
|
29
|
+
items = [],
|
|
30
|
+
groups,
|
|
31
|
+
groupBy,
|
|
32
|
+
groupOrder,
|
|
33
|
+
loading = false,
|
|
34
|
+
loadingText = "\u52A0\u8F7D\u4E2D...",
|
|
35
|
+
emptyText = "\u6682\u65E0\u52A8\u6001",
|
|
36
|
+
showAvatar = true,
|
|
37
|
+
showTime = true,
|
|
38
|
+
showGroupTitle = true,
|
|
39
|
+
renderItem,
|
|
40
|
+
renderGroupHeader,
|
|
41
|
+
className,
|
|
42
|
+
...props
|
|
43
|
+
}) => {
|
|
44
|
+
const resolvedGroups = useMemo(
|
|
45
|
+
() => buildActivityGroups(items, groups, groupBy, groupOrder),
|
|
46
|
+
[items, groups, groupBy, groupOrder]
|
|
47
|
+
);
|
|
48
|
+
const wrapperClasses = classNames(
|
|
49
|
+
"tiger-activity-feed",
|
|
50
|
+
"flex",
|
|
51
|
+
"flex-col",
|
|
52
|
+
"gap-6",
|
|
53
|
+
"w-full",
|
|
54
|
+
className
|
|
55
|
+
);
|
|
56
|
+
const renderDefaultItem = (item, index, group) => {
|
|
57
|
+
if (renderItem) return renderItem(item, index, group);
|
|
58
|
+
const titleText = item.title ?? (typeof item.content === "string" || typeof item.content === "number" ? String(item.content) : "");
|
|
59
|
+
const descriptionText = item.description;
|
|
60
|
+
const timeText = showTime ? formatActivityTime(item.time) : "";
|
|
61
|
+
const actionNodes = item.actions?.map(
|
|
62
|
+
(action, actionIndex) => renderAction(item, action, actionIndex)
|
|
63
|
+
);
|
|
64
|
+
return /* @__PURE__ */ jsx("div", { className: "tiger-activity-item", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3 items-start", children: [
|
|
65
|
+
showAvatar && item.user ? /* @__PURE__ */ jsx(Avatar, { size: "sm", src: item.user.avatar, text: item.user.name, className: "shrink-0" }) : null,
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
67
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 mb-1", children: [
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
69
|
+
titleText ? /* @__PURE__ */ jsx(Text, { tag: "div", size: "sm", weight: "medium", className: "truncate", children: titleText }) : null,
|
|
70
|
+
item.status ? /* @__PURE__ */ jsx(Tag, { variant: item.status.variant ?? "default", size: "sm", className: "shrink-0", children: item.status.label }) : null
|
|
71
|
+
] }),
|
|
72
|
+
timeText ? /* @__PURE__ */ jsx(Text, { tag: "div", size: "xs", color: "muted", className: "shrink-0 whitespace-nowrap", children: timeText }) : null
|
|
73
|
+
] }),
|
|
74
|
+
descriptionText ? /* @__PURE__ */ jsx(Text, { tag: "div", size: "sm", color: "muted", className: "mb-2 break-words", children: descriptionText }) : null,
|
|
75
|
+
actionNodes?.length ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: actionNodes }) : null
|
|
76
|
+
] })
|
|
77
|
+
] }) });
|
|
78
|
+
};
|
|
79
|
+
if (loading) {
|
|
80
|
+
return /* @__PURE__ */ jsx("div", { className: wrapperClasses, ...props, "data-tiger-activity-feed": true, children: /* @__PURE__ */ jsx(Card, { variant: "bordered", size: "sm", className: "tiger-activity-feed-loading", children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ jsx(Loading, { text: loadingText }) }) }) });
|
|
81
|
+
}
|
|
82
|
+
if (resolvedGroups.length === 0) {
|
|
83
|
+
return /* @__PURE__ */ jsx("div", { className: wrapperClasses, ...props, "data-tiger-activity-feed": true, children: /* @__PURE__ */ jsx(Card, { variant: "bordered", size: "sm", className: "tiger-activity-feed-empty", children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-6", children: /* @__PURE__ */ jsx(Text, { tag: "div", size: "sm", color: "muted", children: emptyText }) }) }) });
|
|
84
|
+
}
|
|
85
|
+
return /* @__PURE__ */ jsx("div", { className: wrapperClasses, ...props, "data-tiger-activity-feed": true, children: resolvedGroups.map((group, groupIndex) => {
|
|
86
|
+
const headerNode = renderGroupHeader?.(group);
|
|
87
|
+
const groupTitle = group.title;
|
|
88
|
+
const timelineItems = toActivityTimelineItems(group.items);
|
|
89
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
90
|
+
showGroupTitle && groupTitle ? headerNode ?? /* @__PURE__ */ jsx(Text, { tag: "div", size: "sm", weight: "medium", color: "muted", children: groupTitle }) : null,
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Timeline,
|
|
93
|
+
{
|
|
94
|
+
items: timelineItems,
|
|
95
|
+
renderItem: (timelineItem, index) => {
|
|
96
|
+
const activity = timelineItem.activity;
|
|
97
|
+
if (!activity) return null;
|
|
98
|
+
return renderDefaultItem(activity, index, group);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] }, group.key ?? groupIndex);
|
|
103
|
+
}) });
|
|
104
|
+
};
|
|
105
|
+
var ActivityFeed_default = ActivityFeed;
|
|
106
|
+
|
|
107
|
+
export { ActivityFeed, ActivityFeed_default };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCIL2AC3F_js = require('./chunk-CIL2AC3F.js');
|
|
4
|
+
var chunkR7MS42PL_js = require('./chunk-R7MS42PL.js');
|
|
5
|
+
var chunkA3DJSVTE_js = require('./chunk-A3DJSVTE.js');
|
|
6
|
+
var chunkTZ26HQAW_js = require('./chunk-TZ26HQAW.js');
|
|
7
|
+
var react = require('react');
|
|
8
|
+
var tigercatCore = require('@expcat/tigercat-core');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
|
|
11
|
+
var ChatWindow = ({
|
|
12
|
+
messages = [],
|
|
13
|
+
value,
|
|
14
|
+
defaultValue = "",
|
|
15
|
+
placeholder = "\u8BF7\u8F93\u5165\u6D88\u606F",
|
|
16
|
+
disabled = false,
|
|
17
|
+
maxLength,
|
|
18
|
+
emptyText = "\u6682\u65E0\u6D88\u606F",
|
|
19
|
+
sendText = "\u53D1\u9001",
|
|
20
|
+
messageListAriaLabel,
|
|
21
|
+
inputAriaLabel,
|
|
22
|
+
sendAriaLabel,
|
|
23
|
+
statusText,
|
|
24
|
+
statusVariant = "info",
|
|
25
|
+
showAvatar = true,
|
|
26
|
+
showName = true,
|
|
27
|
+
showTime = false,
|
|
28
|
+
inputType = "textarea",
|
|
29
|
+
inputRows = 3,
|
|
30
|
+
sendOnEnter = true,
|
|
31
|
+
allowShiftEnter = true,
|
|
32
|
+
allowEmpty = false,
|
|
33
|
+
clearOnSend = true,
|
|
34
|
+
statusVariant: _sv,
|
|
35
|
+
onChange,
|
|
36
|
+
onSend,
|
|
37
|
+
renderMessage,
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}) => {
|
|
41
|
+
const [innerValue, setInnerValue] = react.useState(value ?? defaultValue);
|
|
42
|
+
react.useEffect(() => {
|
|
43
|
+
if (value !== void 0) {
|
|
44
|
+
setInnerValue(value);
|
|
45
|
+
}
|
|
46
|
+
}, [value]);
|
|
47
|
+
const inputValue = value !== void 0 ? value : innerValue;
|
|
48
|
+
const wrapperClasses = react.useMemo(
|
|
49
|
+
() => tigercatCore.classNames(
|
|
50
|
+
"tiger-chat-window flex flex-col w-full rounded-lg border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)]",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
[className]
|
|
54
|
+
);
|
|
55
|
+
const canSend = react.useMemo(() => {
|
|
56
|
+
if (disabled) return false;
|
|
57
|
+
if (allowEmpty) return true;
|
|
58
|
+
const raw = String(inputValue ?? "");
|
|
59
|
+
return raw.trim().length > 0;
|
|
60
|
+
}, [allowEmpty, disabled, inputValue]);
|
|
61
|
+
const handleValueChange = react.useCallback(
|
|
62
|
+
(nextValue) => {
|
|
63
|
+
if (value === void 0) {
|
|
64
|
+
setInnerValue(nextValue);
|
|
65
|
+
}
|
|
66
|
+
onChange?.(nextValue);
|
|
67
|
+
},
|
|
68
|
+
[onChange, value]
|
|
69
|
+
);
|
|
70
|
+
const handleSend = react.useCallback(() => {
|
|
71
|
+
if (!canSend) return;
|
|
72
|
+
const payload = String(inputValue ?? "");
|
|
73
|
+
onSend?.(payload);
|
|
74
|
+
if (clearOnSend) {
|
|
75
|
+
if (value === void 0) {
|
|
76
|
+
setInnerValue("");
|
|
77
|
+
}
|
|
78
|
+
onChange?.("");
|
|
79
|
+
}
|
|
80
|
+
}, [canSend, clearOnSend, inputValue, onSend, onChange, value]);
|
|
81
|
+
const handleKeyDown = react.useCallback(
|
|
82
|
+
(event) => {
|
|
83
|
+
if (!sendOnEnter) return;
|
|
84
|
+
if (event.key !== "Enter") return;
|
|
85
|
+
if (inputType === "textarea" && allowShiftEnter && event.shiftKey) return;
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
handleSend();
|
|
88
|
+
},
|
|
89
|
+
[allowShiftEnter, handleSend, inputType, sendOnEnter]
|
|
90
|
+
);
|
|
91
|
+
const renderMessageItem = react.useCallback(
|
|
92
|
+
(message, index) => {
|
|
93
|
+
const isSelf = message.direction === "self";
|
|
94
|
+
const statusInfo = message.status ? tigercatCore.getChatMessageStatusInfo(message.status) : void 0;
|
|
95
|
+
const timeText = showTime ? tigercatCore.formatChatTime(message.time) : "";
|
|
96
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
className: tigercatCore.classNames(
|
|
100
|
+
"flex gap-3 items-start",
|
|
101
|
+
isSelf ? "flex-row-reverse" : "justify-start"
|
|
102
|
+
),
|
|
103
|
+
"data-tiger-chat-message": true,
|
|
104
|
+
role: "listitem",
|
|
105
|
+
children: [
|
|
106
|
+
showAvatar && message.user ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
|
+
chunkTZ26HQAW_js.Avatar,
|
|
108
|
+
{
|
|
109
|
+
size: "sm",
|
|
110
|
+
src: message.user.avatar,
|
|
111
|
+
text: message.user.name,
|
|
112
|
+
className: "flex-shrink-0"
|
|
113
|
+
}
|
|
114
|
+
) : null,
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.classNames("flex flex-col max-w-[75%]", isSelf && "items-end"), children: [
|
|
116
|
+
showName && message.user?.name && /* @__PURE__ */ jsxRuntime.jsx(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: tigercatCore.classNames(
|
|
120
|
+
"text-xs mb-1 text-[var(--tiger-text-muted,#6b7280)]",
|
|
121
|
+
isSelf && "text-right"
|
|
122
|
+
),
|
|
123
|
+
children: message.user.name
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
className: tigercatCore.classNames(
|
|
130
|
+
"rounded-lg px-3 py-2 text-sm break-words",
|
|
131
|
+
isSelf ? "bg-[var(--tiger-primary,#2563eb)] text-white rounded-tr-none" : "bg-[var(--tiger-surface-muted,#f3f4f6)] text-[var(--tiger-text,#111827)] rounded-tl-none"
|
|
132
|
+
),
|
|
133
|
+
"data-tiger-chat-bubble": true,
|
|
134
|
+
children: renderMessage?.(message, index) ?? message.content
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
statusInfo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.classNames("text-xs mt-1", statusInfo.className), children: message.statusText || statusInfo.text }),
|
|
138
|
+
timeText && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs mt-1 text-[var(--tiger-text-muted,#6b7280)]", children: timeText })
|
|
139
|
+
] })
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
message.id ?? index
|
|
143
|
+
);
|
|
144
|
+
},
|
|
145
|
+
[renderMessage, showAvatar, showName, showTime]
|
|
146
|
+
);
|
|
147
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClasses, "data-tiger-chat-window": true, ...props, children: [
|
|
148
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
className: "flex-1 overflow-auto p-4 space-y-3",
|
|
152
|
+
role: "log",
|
|
153
|
+
"aria-live": "polite",
|
|
154
|
+
"aria-relevant": "additions text",
|
|
155
|
+
"aria-label": messageListAriaLabel ?? "\u6D88\u606F\u5217\u8868",
|
|
156
|
+
children: messages.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full flex items-center justify-center text-[var(--tiger-text-muted,#6b7280)]", children: emptyText }) : messages.map(renderMessageItem)
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
statusText && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-1.5 border-t border-[var(--tiger-border,#e5e7eb)] text-xs italic text-[var(--tiger-text-muted,#6b7280)]", children: statusText }),
|
|
160
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-3 px-4 py-3 border-t border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] rounded-b-lg", children: [
|
|
161
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: inputType === "input" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
162
|
+
chunkCIL2AC3F_js.Input,
|
|
163
|
+
{
|
|
164
|
+
value: inputValue,
|
|
165
|
+
placeholder,
|
|
166
|
+
disabled,
|
|
167
|
+
maxLength,
|
|
168
|
+
"aria-label": inputAriaLabel ?? placeholder ?? "\u6D88\u606F\u8F93\u5165",
|
|
169
|
+
onChange: (event) => handleValueChange(event.currentTarget.value),
|
|
170
|
+
onKeyDown: handleKeyDown
|
|
171
|
+
}
|
|
172
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
173
|
+
chunkR7MS42PL_js.Textarea,
|
|
174
|
+
{
|
|
175
|
+
value: inputValue,
|
|
176
|
+
placeholder,
|
|
177
|
+
disabled,
|
|
178
|
+
maxLength,
|
|
179
|
+
rows: inputRows,
|
|
180
|
+
"aria-label": inputAriaLabel ?? placeholder ?? "\u6D88\u606F\u8F93\u5165",
|
|
181
|
+
onChange: (event) => handleValueChange(event.currentTarget.value),
|
|
182
|
+
onKeyDown: handleKeyDown
|
|
183
|
+
}
|
|
184
|
+
) }),
|
|
185
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkA3DJSVTE_js.Button, { disabled: !canSend, onClick: handleSend, "aria-label": sendAriaLabel ?? sendText, children: sendText })
|
|
186
|
+
] })
|
|
187
|
+
] });
|
|
188
|
+
};
|
|
189
|
+
var ChatWindow_default = ChatWindow;
|
|
190
|
+
|
|
191
|
+
exports.ChatWindow = ChatWindow;
|
|
192
|
+
exports.ChatWindow_default = ChatWindow_default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActivityFeedProps as ActivityFeedProps$1, ActivityItem, ActivityGroup } from '@expcat/tigercat-core';
|
|
3
|
+
|
|
4
|
+
interface ActivityFeedProps extends Omit<ActivityFeedProps$1, 'renderItem' | 'renderGroupHeader'>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
5
|
+
renderItem?: (item: ActivityItem, index: number, group?: ActivityGroup) => React.ReactNode;
|
|
6
|
+
renderGroupHeader?: (group: ActivityGroup) => React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const ActivityFeed: React.FC<ActivityFeedProps>;
|
|
9
|
+
|
|
10
|
+
export { ActivityFeed, type ActivityFeedProps, ActivityFeed as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActivityFeedProps as ActivityFeedProps$1, ActivityItem, ActivityGroup } from '@expcat/tigercat-core';
|
|
3
|
+
|
|
4
|
+
interface ActivityFeedProps extends Omit<ActivityFeedProps$1, 'renderItem' | 'renderGroupHeader'>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
5
|
+
renderItem?: (item: ActivityItem, index: number, group?: ActivityGroup) => React.ReactNode;
|
|
6
|
+
renderGroupHeader?: (group: ActivityGroup) => React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const ActivityFeed: React.FC<ActivityFeedProps>;
|
|
9
|
+
|
|
10
|
+
export { ActivityFeed, type ActivityFeedProps, ActivityFeed as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var chunk4IO2M3ZJ_js = require('../chunk-4IO2M3ZJ.js');
|
|
6
|
+
require('../chunk-IQINYCU6.js');
|
|
7
|
+
require('../chunk-MKWXJZ3T.js');
|
|
8
|
+
require('../chunk-6MGEGOYJ.js');
|
|
9
|
+
require('../chunk-2TS6X5RA.js');
|
|
10
|
+
require('../chunk-YYGTJKP5.js');
|
|
11
|
+
require('../chunk-VO4WDK4K.js');
|
|
12
|
+
require('../chunk-TZ26HQAW.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Object.defineProperty(exports, "ActivityFeed", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunk4IO2M3ZJ_js.ActivityFeed; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "default", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunk4IO2M3ZJ_js.ActivityFeed_default; }
|
|
23
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ActivityFeed, ActivityFeed_default as default } from '../chunk-WKGCUR7O.mjs';
|
|
2
|
+
import '../chunk-LADCWARG.mjs';
|
|
3
|
+
import '../chunk-WSJO2PIE.mjs';
|
|
4
|
+
import '../chunk-PUDU34R4.mjs';
|
|
5
|
+
import '../chunk-DIZNY6N4.mjs';
|
|
6
|
+
import '../chunk-6YDIBMCM.mjs';
|
|
7
|
+
import '../chunk-VD3IK5XT.mjs';
|
|
8
|
+
import '../chunk-V2HVHLBY.mjs';
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var chunk6E5UKM6O_js = require('../chunk-6E5UKM6O.js');
|
|
6
6
|
require('../chunk-KQZ4F7FZ.js');
|
|
7
|
+
require('../chunk-DUWAV47E.js');
|
|
7
8
|
require('../chunk-3QFHVAZT.js');
|
|
8
9
|
require('../chunk-6PBNFLM7.js');
|
|
9
10
|
require('../chunk-AX5XRD2Q.js');
|
|
10
11
|
require('../chunk-M375I56K.js');
|
|
11
12
|
require('../chunk-E5GD3H7L.js');
|
|
12
|
-
require('../chunk-DUWAV47E.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "AreaChart", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk6E5UKM6O_js.AreaChart; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "default", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk6E5UKM6O_js.AreaChart_default; }
|
|
23
23
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { AreaChart, AreaChart_default as default } from '../chunk-
|
|
1
|
+
export { AreaChart, AreaChart_default as default } from '../chunk-PT4WLSTJ.mjs';
|
|
2
2
|
import '../chunk-3CDAG4HD.mjs';
|
|
3
|
+
import '../chunk-IS467WAO.mjs';
|
|
3
4
|
import '../chunk-677VSTPW.mjs';
|
|
4
5
|
import '../chunk-Z6F67MJE.mjs';
|
|
5
6
|
import '../chunk-SDLMB34Y.mjs';
|
|
6
7
|
import '../chunk-LVC43YX2.mjs';
|
|
7
8
|
import '../chunk-RQSQXQN6.mjs';
|
|
8
|
-
import '../chunk-IS467WAO.mjs';
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var chunkL63N3LCG_js = require('../chunk-L63N3LCG.js');
|
|
6
6
|
require('../chunk-KQZ4F7FZ.js');
|
|
7
|
+
require('../chunk-DUWAV47E.js');
|
|
7
8
|
require('../chunk-3QFHVAZT.js');
|
|
8
9
|
require('../chunk-6PBNFLM7.js');
|
|
9
10
|
require('../chunk-AX5XRD2Q.js');
|
|
10
11
|
require('../chunk-M375I56K.js');
|
|
11
12
|
require('../chunk-E5GD3H7L.js');
|
|
12
|
-
require('../chunk-DUWAV47E.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "BarChart", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkL63N3LCG_js.BarChart; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "default", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkL63N3LCG_js.BarChart_default; }
|
|
23
23
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { BarChart, BarChart_default as default } from '../chunk-
|
|
1
|
+
export { BarChart, BarChart_default as default } from '../chunk-AITVDDCE.mjs';
|
|
2
2
|
import '../chunk-3CDAG4HD.mjs';
|
|
3
|
+
import '../chunk-IS467WAO.mjs';
|
|
3
4
|
import '../chunk-677VSTPW.mjs';
|
|
4
5
|
import '../chunk-Z6F67MJE.mjs';
|
|
5
6
|
import '../chunk-SDLMB34Y.mjs';
|
|
6
7
|
import '../chunk-LVC43YX2.mjs';
|
|
7
8
|
import '../chunk-RQSQXQN6.mjs';
|
|
8
|
-
import '../chunk-IS467WAO.mjs';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChatWindowProps as ChatWindowProps$1, ChatMessage } from '@expcat/tigercat-core';
|
|
3
|
+
|
|
4
|
+
interface ChatWindowProps extends ChatWindowProps$1, Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
5
|
+
/**
|
|
6
|
+
* Custom render for message bubble
|
|
7
|
+
*/
|
|
8
|
+
renderMessage?: (message: ChatMessage, index: number) => React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const ChatWindow: React.FC<ChatWindowProps>;
|
|
11
|
+
|
|
12
|
+
export { ChatWindow, type ChatWindowProps, ChatWindow as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChatWindowProps as ChatWindowProps$1, ChatMessage } from '@expcat/tigercat-core';
|
|
3
|
+
|
|
4
|
+
interface ChatWindowProps extends ChatWindowProps$1, Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
5
|
+
/**
|
|
6
|
+
* Custom render for message bubble
|
|
7
|
+
*/
|
|
8
|
+
renderMessage?: (message: ChatMessage, index: number) => React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const ChatWindow: React.FC<ChatWindowProps>;
|
|
11
|
+
|
|
12
|
+
export { ChatWindow, type ChatWindowProps, ChatWindow as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var chunkZN2BZCTI_js = require('../chunk-ZN2BZCTI.js');
|
|
6
|
+
require('../chunk-CIL2AC3F.js');
|
|
7
|
+
require('../chunk-R7MS42PL.js');
|
|
8
|
+
require('../chunk-A3DJSVTE.js');
|
|
9
|
+
require('../chunk-TZ26HQAW.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
Object.defineProperty(exports, "ChatWindow", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkZN2BZCTI_js.ChatWindow; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "default", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkZN2BZCTI_js.ChatWindow_default; }
|
|
20
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommentThreadProps as CommentThreadProps$1 } from '@expcat/tigercat-core';
|
|
3
|
+
|
|
4
|
+
interface CommentThreadProps extends CommentThreadProps$1, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
5
|
+
}
|
|
6
|
+
declare const CommentThread: React.FC<CommentThreadProps>;
|
|
7
|
+
|
|
8
|
+
export { CommentThread, type CommentThreadProps, CommentThread as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommentThreadProps as CommentThreadProps$1 } from '@expcat/tigercat-core';
|
|
3
|
+
|
|
4
|
+
interface CommentThreadProps extends CommentThreadProps$1, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
5
|
+
}
|
|
6
|
+
declare const CommentThread: React.FC<CommentThreadProps>;
|
|
7
|
+
|
|
8
|
+
export { CommentThread, type CommentThreadProps, CommentThread as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var chunkHT2BXCEM_js = require('../chunk-HT2BXCEM.js');
|
|
6
|
+
require('../chunk-R7MS42PL.js');
|
|
7
|
+
require('../chunk-A3DJSVTE.js');
|
|
8
|
+
require('../chunk-2TS6X5RA.js');
|
|
9
|
+
require('../chunk-YYGTJKP5.js');
|
|
10
|
+
require('../chunk-TZ26HQAW.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
Object.defineProperty(exports, "CommentThread", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkHT2BXCEM_js.CommentThread; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "default", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkHT2BXCEM_js.CommentThread_default; }
|
|
21
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TableToolbarProps, TableToolbarFilterValue, TableToolbarAction } from '@expcat/tigercat-core';
|
|
4
|
+
import { TableProps } from './Table.mjs';
|
|
5
|
+
import { PaginationProps } from './Pagination.mjs';
|
|
6
|
+
|
|
7
|
+
interface DataTableWithToolbarProps<T = Record<string, unknown>> extends Omit<TableProps<T>, 'pagination' | 'className' | 'onPageChange'>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'onChange'> {
|
|
8
|
+
/**
|
|
9
|
+
* Toolbar configuration
|
|
10
|
+
*/
|
|
11
|
+
toolbar?: TableToolbarProps;
|
|
12
|
+
/**
|
|
13
|
+
* Search change handler
|
|
14
|
+
*/
|
|
15
|
+
onSearchChange?: (value: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Search submit handler
|
|
18
|
+
*/
|
|
19
|
+
onSearch?: (value: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Filters change handler
|
|
22
|
+
*/
|
|
23
|
+
onFiltersChange?: (filters: Record<string, TableToolbarFilterValue>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Bulk action handler
|
|
26
|
+
*/
|
|
27
|
+
onBulkAction?: (action: TableToolbarAction, selectedKeys: (string | number)[]) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Pagination configuration
|
|
30
|
+
*/
|
|
31
|
+
pagination?: PaginationProps | false;
|
|
32
|
+
/**
|
|
33
|
+
* Page change handler
|
|
34
|
+
*/
|
|
35
|
+
onPageChange?: (current: number, pageSize: number) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Page size change handler
|
|
38
|
+
*/
|
|
39
|
+
onPageSizeChange?: (current: number, pageSize: number) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Wrapper class name
|
|
42
|
+
*/
|
|
43
|
+
className?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Table class name
|
|
46
|
+
*/
|
|
47
|
+
tableClassName?: string;
|
|
48
|
+
}
|
|
49
|
+
declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
export { DataTableWithToolbar, type DataTableWithToolbarProps, DataTableWithToolbar as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TableToolbarProps, TableToolbarFilterValue, TableToolbarAction } from '@expcat/tigercat-core';
|
|
4
|
+
import { TableProps } from './Table.js';
|
|
5
|
+
import { PaginationProps } from './Pagination.js';
|
|
6
|
+
|
|
7
|
+
interface DataTableWithToolbarProps<T = Record<string, unknown>> extends Omit<TableProps<T>, 'pagination' | 'className' | 'onPageChange'>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'onChange'> {
|
|
8
|
+
/**
|
|
9
|
+
* Toolbar configuration
|
|
10
|
+
*/
|
|
11
|
+
toolbar?: TableToolbarProps;
|
|
12
|
+
/**
|
|
13
|
+
* Search change handler
|
|
14
|
+
*/
|
|
15
|
+
onSearchChange?: (value: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Search submit handler
|
|
18
|
+
*/
|
|
19
|
+
onSearch?: (value: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Filters change handler
|
|
22
|
+
*/
|
|
23
|
+
onFiltersChange?: (filters: Record<string, TableToolbarFilterValue>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Bulk action handler
|
|
26
|
+
*/
|
|
27
|
+
onBulkAction?: (action: TableToolbarAction, selectedKeys: (string | number)[]) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Pagination configuration
|
|
30
|
+
*/
|
|
31
|
+
pagination?: PaginationProps | false;
|
|
32
|
+
/**
|
|
33
|
+
* Page change handler
|
|
34
|
+
*/
|
|
35
|
+
onPageChange?: (current: number, pageSize: number) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Page size change handler
|
|
38
|
+
*/
|
|
39
|
+
onPageSizeChange?: (current: number, pageSize: number) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Wrapper class name
|
|
42
|
+
*/
|
|
43
|
+
className?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Table class name
|
|
46
|
+
*/
|
|
47
|
+
tableClassName?: string;
|
|
48
|
+
}
|
|
49
|
+
declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
export { DataTableWithToolbar, type DataTableWithToolbarProps, DataTableWithToolbar as default };
|