@expcat/tigercat-react 2.0.0-rc.2 → 2.0.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-IZYFETUS.mjs → chunk-3RY6M4AK.mjs} +1 -1
- package/dist/chunk-C6QK5MJT.mjs +292 -0
- package/dist/{chunk-44CQTGAN.mjs → chunk-E7OTDBI6.mjs} +2 -2
- package/dist/{chunk-DJ4PSDQS.mjs → chunk-FYINJRYN.mjs} +2 -2
- package/dist/{chunk-KFPQ6DIH.mjs → chunk-GV4F6X3C.mjs} +29 -25
- package/dist/{chunk-K6GJMKJR.mjs → chunk-HELLYIX2.mjs} +1 -1
- package/dist/{chunk-POP3TS4Q.mjs → chunk-NBQ3Q6DD.mjs} +56 -28
- package/dist/{chunk-3O2WHF3U.mjs → chunk-NCHUEGUW.mjs} +2 -2
- package/dist/{chunk-VD55SSP7.mjs → chunk-PD6Q36OO.mjs} +14 -6
- package/dist/{chunk-HXD7KMRP.mjs → chunk-UCBW5RJN.mjs} +31 -2
- package/dist/{chunk-5IHOOP5A.mjs → chunk-UD4DTVJZ.mjs} +64 -79
- package/dist/{chunk-A6JNS35U.mjs → chunk-UT5BV2VO.mjs} +2 -2
- package/dist/{chunk-N6JNLJIN.mjs → chunk-YCKY72BW.mjs} +5 -1
- package/dist/components/ActivityFeed.mjs +1 -1
- package/dist/components/AreaChart.mjs +1 -1
- package/dist/components/BarChart.mjs +1 -1
- package/dist/components/CommentThread.mjs +1 -1
- package/dist/components/CropUpload.mjs +2 -2
- package/dist/components/DataTableWithToolbar.mjs +2 -2
- package/dist/components/ImageCropper.mjs +1 -1
- package/dist/components/LineChart.mjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/ScatterChart.mjs +1 -1
- package/dist/components/Table.mjs +1 -1
- package/dist/components/Upload.mjs +1 -1
- package/dist/components/VirtualTable.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/package.json +2 -2
- package/dist/chunk-XIVU7TWX.mjs +0 -305
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-YSIXURBW.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/Upload.tsx
|
|
9
|
-
import { useRef, useState, useCallback, useMemo } from "react";
|
|
9
|
+
import { useRef, useState, useCallback, useEffect, useMemo } from "react";
|
|
10
10
|
import {
|
|
11
11
|
classNames,
|
|
12
12
|
icon20ViewBox,
|
|
@@ -78,8 +78,30 @@ var Upload = ({
|
|
|
78
78
|
[mergedLocale, labelsOverrides]
|
|
79
79
|
);
|
|
80
80
|
const inputRef = useRef(null);
|
|
81
|
+
const objectUrlsRef = useRef(/* @__PURE__ */ new Map());
|
|
81
82
|
const [isDragging, setIsDragging] = useState(false);
|
|
82
83
|
const [fileList, setFileList] = useControlledState(controlledFileList, []);
|
|
84
|
+
const revokeUnusedObjectUrls = useCallback((files) => {
|
|
85
|
+
const activeFiles = new Set(
|
|
86
|
+
files.flatMap((file) => file.file && !file.url ? [file.file] : [])
|
|
87
|
+
);
|
|
88
|
+
objectUrlsRef.current.forEach((url, file) => {
|
|
89
|
+
if (!activeFiles.has(file)) {
|
|
90
|
+
URL.revokeObjectURL(url);
|
|
91
|
+
objectUrlsRef.current.delete(file);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}, []);
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
revokeUnusedObjectUrls(fileList);
|
|
97
|
+
}, [fileList, revokeUnusedObjectUrls]);
|
|
98
|
+
useEffect(
|
|
99
|
+
() => () => {
|
|
100
|
+
objectUrlsRef.current.forEach((url) => URL.revokeObjectURL(url));
|
|
101
|
+
objectUrlsRef.current.clear();
|
|
102
|
+
},
|
|
103
|
+
[]
|
|
104
|
+
);
|
|
83
105
|
const updateFileList = useCallback(
|
|
84
106
|
(newFileList) => {
|
|
85
107
|
setFileList(newFileList);
|
|
@@ -391,7 +413,14 @@ var Upload = ({
|
|
|
391
413
|
] }, file.uid);
|
|
392
414
|
};
|
|
393
415
|
const renderPictureCard = (file) => {
|
|
394
|
-
|
|
416
|
+
let imageUrl = file.url ?? "";
|
|
417
|
+
if (!imageUrl && file.file && typeof URL !== "undefined" && typeof URL.createObjectURL === "function") {
|
|
418
|
+
imageUrl = objectUrlsRef.current.get(file.file) ?? "";
|
|
419
|
+
if (!imageUrl) {
|
|
420
|
+
imageUrl = URL.createObjectURL(file.file);
|
|
421
|
+
objectUrlsRef.current.set(file.file, imageUrl);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
395
424
|
return /* @__PURE__ */ jsxs("div", { className: getPictureCardClasses(file.status), children: [
|
|
396
425
|
imageUrl && /* @__PURE__ */ jsx("img", { src: imageUrl, alt: file.name, className: "w-full h-full object-cover" }),
|
|
397
426
|
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0 bg-black/0 hover:bg-black/50 transition-all flex items-center justify-center space-x-2 opacity-0 hover:opacity-100", children: [
|
|
@@ -22,6 +22,31 @@ import {
|
|
|
22
22
|
clipCommentTreeDepth,
|
|
23
23
|
formatCommentTime
|
|
24
24
|
} from "@expcat/tigercat-core";
|
|
25
|
+
|
|
26
|
+
// ../core/src/internal/comment-thread-styles.ts
|
|
27
|
+
var buttonBaseClasses = "tiger-motion-aware px-2 py-0.5 h-auto min-h-0 text-xs rounded-[var(--tiger-radius-md,0.5rem)] [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
28
|
+
var commentThreadActionButtonClasses = `${buttonBaseClasses} text-[var(--tiger-text-muted,#6b7280)] font-medium flex items-center gap-1.5`;
|
|
29
|
+
var commentThreadPrimaryButtonClasses = `${buttonBaseClasses} text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary-hover,#1d4ed8)] font-semibold hover:bg-[var(--tiger-outline-bg-hover,#eff6ff)]`;
|
|
30
|
+
var commentThreadLikeButtonClasses = "hover:text-[var(--tiger-primary,#2563eb)] hover:bg-[var(--tiger-outline-bg-hover,#eff6ff)]";
|
|
31
|
+
var commentThreadLikedButtonClasses = "text-[var(--tiger-primary,#2563eb)] bg-[var(--tiger-outline-bg-hover,#eff6ff)] font-semibold border-[var(--tiger-primary,#2563eb)]/40";
|
|
32
|
+
var commentThreadReplyButtonClasses = "hover:text-[var(--tiger-success,#16a34a)] hover:bg-[var(--tiger-surface-muted,#f9fafb)]";
|
|
33
|
+
var commentThreadNeutralButtonClasses = "hover:text-[var(--tiger-text,#111827)] hover:bg-[var(--tiger-surface-muted,#f3f4f6)]";
|
|
34
|
+
var commentThreadLikeIconClasses = "tiger-motion-aware w-3.5 h-3.5 transition-transform active:scale-125";
|
|
35
|
+
var commentThreadDividerClasses = "border-b border-[var(--tiger-border,#e5e7eb)]";
|
|
36
|
+
var commentThreadAvatarClasses = "tiger-motion-aware shrink-0 mt-0.5 ring-1 ring-[var(--tiger-border,#e5e7eb)] shadow-sm [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))] hover:scale-105";
|
|
37
|
+
var commentThreadAuthorClasses = "tiger-motion-aware text-[var(--tiger-text,#111827)] hover:text-[var(--tiger-primary,#2563eb)] transition-colors cursor-pointer";
|
|
38
|
+
var commentThreadUserTitleClasses = "bg-[var(--tiger-surface-muted,#f3f4f6)] px-1.5 py-0.5 rounded text-[var(--tiger-text-muted,#6b7280)] font-medium";
|
|
39
|
+
var commentThreadTimeClasses = "ml-auto text-[var(--tiger-text-muted,#6b7280)] font-normal";
|
|
40
|
+
var commentThreadContentClasses = "text-sm text-[var(--tiger-text-secondary,#4b5563)] leading-relaxed break-words mt-2 mb-3 pr-2";
|
|
41
|
+
var commentThreadReplyEditorClasses = "tiger-motion-aware mt-3 space-y-3 bg-[var(--tiger-surface-muted,#f9fafb)] border border-[var(--tiger-border,#e5e7eb)] p-4 rounded-[var(--tiger-radius-lg,0.75rem)] shadow-sm [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
42
|
+
var commentThreadReplyTextareaClasses = "tiger-motion-aware bg-[var(--tiger-surface,#ffffff)] border-[var(--tiger-border,#d1d5db)] focus:ring-2 focus:ring-[var(--tiger-primary,#2563eb)]/20 focus:border-[var(--tiger-primary,#2563eb)] rounded-[var(--tiger-radius-md,0.5rem)] shadow-inner [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
43
|
+
var commentThreadCancelButtonClasses = "tiger-motion-aware px-3 py-1.5 text-xs text-[var(--tiger-text-muted,#6b7280)] hover:text-[var(--tiger-text,#111827)] rounded-[var(--tiger-radius-md,0.5rem)] transition-colors";
|
|
44
|
+
var commentThreadSubmitButtonClasses = "tiger-motion-aware px-3 py-1.5 text-xs font-semibold shadow-sm hover:shadow rounded-[var(--tiger-radius-md,0.5rem)] [transition:var(--tiger-transition-base,all_200ms_cubic-bezier(0.4,0,0.2,1))]";
|
|
45
|
+
var commentThreadRepliesClasses = "tiger-motion-aware mt-4 ml-1 pl-4 border-l-2 border-[var(--tiger-border,#e5e7eb)] hover:border-[var(--tiger-primary,#2563eb)]/40 space-y-4 transition-colors";
|
|
46
|
+
var commentThreadEmptyClasses = "tiger-motion-aware flex flex-col items-center justify-center border border-dashed border-[var(--tiger-border,#d1d5db)] rounded-[var(--tiger-radius-lg,0.75rem)] py-12 px-4 bg-[var(--tiger-surface-muted,#f9fafb)] transition-colors";
|
|
47
|
+
var commentThreadEmptyIconClasses = "w-10 h-10 text-[var(--tiger-text-muted,#9ca3af)] mb-3";
|
|
48
|
+
|
|
49
|
+
// src/components/CommentThread.tsx
|
|
25
50
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
51
|
var CommentThread = ({
|
|
27
52
|
nodes,
|
|
@@ -95,9 +120,6 @@ var CommentThread = ({
|
|
|
95
120
|
updateExpandedKeys(next);
|
|
96
121
|
}
|
|
97
122
|
};
|
|
98
|
-
const BTN_BASE = "px-2 py-0.5 h-auto min-h-0 text-xs rounded-md transition-all duration-200 ease-out";
|
|
99
|
-
const ACTION_BTN = `${BTN_BASE} text-gray-500 dark:text-gray-400 font-medium flex items-center gap-1.5`;
|
|
100
|
-
const PRIMARY_BTN = `${BTN_BASE} text-[var(--tiger-primary,#2563eb)] hover:text-[var(--tiger-primary-hover,#1d4ed8)] dark:text-blue-400 dark:hover:text-blue-300 font-semibold hover:bg-[var(--tiger-primary,#2563eb)]/10 dark:hover:bg-blue-400/10`;
|
|
101
123
|
const renderNode = (node, depth, isLast) => {
|
|
102
124
|
const children = node.children ?? [];
|
|
103
125
|
const hasChildren = children.length > 0;
|
|
@@ -118,9 +140,9 @@ var CommentThread = ({
|
|
|
118
140
|
size: "sm",
|
|
119
141
|
variant: "ghost",
|
|
120
142
|
className: classNames(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
node.liked &&
|
|
143
|
+
commentThreadActionButtonClasses,
|
|
144
|
+
commentThreadLikeButtonClasses,
|
|
145
|
+
node.liked && commentThreadLikedButtonClasses
|
|
124
146
|
),
|
|
125
147
|
onClick: () => onLike?.(node, !node.liked),
|
|
126
148
|
children: [
|
|
@@ -128,7 +150,7 @@ var CommentThread = ({
|
|
|
128
150
|
"svg",
|
|
129
151
|
{
|
|
130
152
|
className: classNames(
|
|
131
|
-
|
|
153
|
+
commentThreadLikeIconClasses,
|
|
132
154
|
node.liked ? "fill-current" : "stroke-current fill-none"
|
|
133
155
|
),
|
|
134
156
|
viewBox: "0 0 24 24",
|
|
@@ -157,10 +179,7 @@ var CommentThread = ({
|
|
|
157
179
|
{
|
|
158
180
|
size: "sm",
|
|
159
181
|
variant: "ghost",
|
|
160
|
-
className: classNames(
|
|
161
|
-
ACTION_BTN,
|
|
162
|
-
"hover:text-emerald-600 hover:bg-emerald-50/50 dark:hover:text-emerald-400 dark:hover:bg-emerald-950/20"
|
|
163
|
-
),
|
|
182
|
+
className: classNames(commentThreadActionButtonClasses, commentThreadReplyButtonClasses),
|
|
164
183
|
onClick: () => {
|
|
165
184
|
setReplyingTo((prev) => prev === node.id ? null : node.id);
|
|
166
185
|
setReplyValue("");
|
|
@@ -199,8 +218,8 @@ var CommentThread = ({
|
|
|
199
218
|
size: "sm",
|
|
200
219
|
variant: "ghost",
|
|
201
220
|
className: classNames(
|
|
202
|
-
|
|
203
|
-
|
|
221
|
+
commentThreadActionButtonClasses,
|
|
222
|
+
commentThreadNeutralButtonClasses
|
|
204
223
|
),
|
|
205
224
|
onClick: () => onMore?.(node),
|
|
206
225
|
children: [
|
|
@@ -238,7 +257,10 @@ var CommentThread = ({
|
|
|
238
257
|
{
|
|
239
258
|
size: "sm",
|
|
240
259
|
variant: action.variant ?? "ghost",
|
|
241
|
-
className: classNames(
|
|
260
|
+
className: classNames(
|
|
261
|
+
commentThreadActionButtonClasses,
|
|
262
|
+
commentThreadNeutralButtonClasses
|
|
263
|
+
),
|
|
242
264
|
disabled: action.disabled,
|
|
243
265
|
onClick: () => {
|
|
244
266
|
action.onClick?.(node, action);
|
|
@@ -257,7 +279,7 @@ var CommentThread = ({
|
|
|
257
279
|
className: classNames(
|
|
258
280
|
"tiger-comment-thread-item",
|
|
259
281
|
depth === 1 && "py-5",
|
|
260
|
-
depth === 1 && !isLast && showDivider &&
|
|
282
|
+
depth === 1 && !isLast && showDivider && commentThreadDividerClasses
|
|
261
283
|
),
|
|
262
284
|
children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
263
285
|
showAvatar && node.user ? /* @__PURE__ */ jsx(
|
|
@@ -266,31 +288,13 @@ var CommentThread = ({
|
|
|
266
288
|
size: depth === 1 ? "md" : "sm",
|
|
267
289
|
src: node.user.avatar,
|
|
268
290
|
text: node.user.name,
|
|
269
|
-
className:
|
|
291
|
+
className: commentThreadAvatarClasses
|
|
270
292
|
}
|
|
271
293
|
) : null,
|
|
272
294
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
273
295
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
274
|
-
node.user?.name ? /* @__PURE__ */ jsx(
|
|
275
|
-
|
|
276
|
-
{
|
|
277
|
-
tag: "span",
|
|
278
|
-
size: "sm",
|
|
279
|
-
weight: "bold",
|
|
280
|
-
className: "text-gray-900 dark:text-gray-100 hover:text-blue-600 dark:hover:text-blue-400 transition-colors cursor-pointer",
|
|
281
|
-
children: node.user.name
|
|
282
|
-
}
|
|
283
|
-
) : null,
|
|
284
|
-
node.user?.title ? /* @__PURE__ */ jsx(
|
|
285
|
-
Text,
|
|
286
|
-
{
|
|
287
|
-
tag: "span",
|
|
288
|
-
size: "xs",
|
|
289
|
-
color: "muted",
|
|
290
|
-
className: "bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-gray-500 dark:text-gray-400 font-medium",
|
|
291
|
-
children: node.user.title
|
|
292
|
-
}
|
|
293
|
-
) : null,
|
|
296
|
+
node.user?.name ? /* @__PURE__ */ jsx(Text, { tag: "span", size: "sm", weight: "bold", className: commentThreadAuthorClasses, children: node.user.name }) : null,
|
|
297
|
+
node.user?.title ? /* @__PURE__ */ jsx(Text, { tag: "span", size: "xs", color: "muted", className: commentThreadUserTitleClasses, children: node.user.title }) : null,
|
|
294
298
|
node.tag ? /* @__PURE__ */ jsx(
|
|
295
299
|
Tag,
|
|
296
300
|
{
|
|
@@ -310,27 +314,18 @@ var CommentThread = ({
|
|
|
310
314
|
},
|
|
311
315
|
`${node.id}-tag-${index}`
|
|
312
316
|
)),
|
|
313
|
-
node.time ? /* @__PURE__ */ jsx(
|
|
314
|
-
Text,
|
|
315
|
-
{
|
|
316
|
-
tag: "span",
|
|
317
|
-
size: "xs",
|
|
318
|
-
color: "muted",
|
|
319
|
-
className: "ml-auto text-gray-400 dark:text-gray-500 font-normal",
|
|
320
|
-
children: formatCommentTime(node.time)
|
|
321
|
-
}
|
|
322
|
-
) : null
|
|
317
|
+
node.time ? /* @__PURE__ */ jsx(Text, { tag: "span", size: "xs", color: "muted", className: commentThreadTimeClasses, children: formatCommentTime(node.time) }) : null
|
|
323
318
|
] }),
|
|
324
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
319
|
+
/* @__PURE__ */ jsx("div", { className: commentThreadContentClasses, children: node.content }),
|
|
325
320
|
actions.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: actions }) : null,
|
|
326
|
-
replyingTo === node.id ? /* @__PURE__ */ jsxs("div", { className:
|
|
321
|
+
replyingTo === node.id ? /* @__PURE__ */ jsxs("div", { className: commentThreadReplyEditorClasses, children: [
|
|
327
322
|
/* @__PURE__ */ jsx(
|
|
328
323
|
Textarea,
|
|
329
324
|
{
|
|
330
325
|
rows: 3,
|
|
331
326
|
value: replyValue,
|
|
332
327
|
placeholder: replyPlaceholder,
|
|
333
|
-
className:
|
|
328
|
+
className: commentThreadReplyTextareaClasses,
|
|
334
329
|
onChange: (event) => setReplyValue(event.target.value)
|
|
335
330
|
}
|
|
336
331
|
),
|
|
@@ -340,7 +335,7 @@ var CommentThread = ({
|
|
|
340
335
|
{
|
|
341
336
|
size: "sm",
|
|
342
337
|
variant: "ghost",
|
|
343
|
-
className:
|
|
338
|
+
className: commentThreadCancelButtonClasses,
|
|
344
339
|
onClick: () => {
|
|
345
340
|
setReplyingTo(null);
|
|
346
341
|
setReplyValue("");
|
|
@@ -353,7 +348,7 @@ var CommentThread = ({
|
|
|
353
348
|
{
|
|
354
349
|
size: "sm",
|
|
355
350
|
variant: "primary",
|
|
356
|
-
className:
|
|
351
|
+
className: commentThreadSubmitButtonClasses,
|
|
357
352
|
onClick: () => handleReplySubmit(node),
|
|
358
353
|
children: replyButtonText
|
|
359
354
|
}
|
|
@@ -365,38 +360,28 @@ var CommentThread = ({
|
|
|
365
360
|
{
|
|
366
361
|
size: "sm",
|
|
367
362
|
variant: "ghost",
|
|
368
|
-
className: classNames(
|
|
369
|
-
"mt-2 font-semibold hover:bg-[var(--tiger-primary,#2563eb)]/10 dark:hover:bg-blue-400/10 transition-colors",
|
|
370
|
-
PRIMARY_BTN
|
|
371
|
-
),
|
|
363
|
+
className: classNames("mt-2 font-semibold", commentThreadPrimaryButtonClasses),
|
|
372
364
|
"aria-expanded": isExpanded,
|
|
373
365
|
"aria-controls": repliesId,
|
|
374
366
|
onClick: () => toggleExpanded(node.id),
|
|
375
367
|
children: isExpanded ? "\u25BE \u6536\u8D77\u56DE\u590D" : `\u25B8 \u5C55\u5F00 ${children.length} \u6761\u56DE\u590D`
|
|
376
368
|
}
|
|
377
369
|
) : null,
|
|
378
|
-
showReplies ? /* @__PURE__ */ jsxs(
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
onClick: () => handleLoadMore(node),
|
|
394
|
-
children: loadMoreText
|
|
395
|
-
}
|
|
396
|
-
) : null
|
|
397
|
-
]
|
|
398
|
-
}
|
|
399
|
-
) : null
|
|
370
|
+
showReplies ? /* @__PURE__ */ jsxs("div", { id: repliesId, className: commentThreadRepliesClasses, children: [
|
|
371
|
+
visibleChildren.map(
|
|
372
|
+
(child, index) => renderNode(child, depth + 1, index === visibleChildren.length - 1)
|
|
373
|
+
),
|
|
374
|
+
showLoadMoreBtn ? /* @__PURE__ */ jsx(
|
|
375
|
+
Button,
|
|
376
|
+
{
|
|
377
|
+
size: "sm",
|
|
378
|
+
variant: "ghost",
|
|
379
|
+
className: commentThreadPrimaryButtonClasses,
|
|
380
|
+
onClick: () => handleLoadMore(node),
|
|
381
|
+
children: loadMoreText
|
|
382
|
+
}
|
|
383
|
+
) : null
|
|
384
|
+
] }) : null
|
|
400
385
|
] })
|
|
401
386
|
] })
|
|
402
387
|
},
|
|
@@ -411,11 +396,11 @@ var CommentThread = ({
|
|
|
411
396
|
"data-tiger-comment-thread": true,
|
|
412
397
|
"aria-label": divProps["aria-label"] ?? (divProps["aria-labelledby"] ? void 0 : "\u8BC4\u8BBA\u7EBF\u7A0B"),
|
|
413
398
|
...divProps,
|
|
414
|
-
children: resolvedNodes.length === 0 ? /* @__PURE__ */ jsxs("div", { className:
|
|
399
|
+
children: resolvedNodes.length === 0 ? /* @__PURE__ */ jsxs("div", { className: commentThreadEmptyClasses, children: [
|
|
415
400
|
/* @__PURE__ */ jsx(
|
|
416
401
|
"svg",
|
|
417
402
|
{
|
|
418
|
-
className:
|
|
403
|
+
className: commentThreadEmptyIconClasses,
|
|
419
404
|
fill: "none",
|
|
420
405
|
viewBox: "0 0 24 24",
|
|
421
406
|
stroke: "currentColor",
|
|
@@ -348,12 +348,12 @@ var BarChart = ({
|
|
|
348
348
|
}
|
|
349
349
|
);
|
|
350
350
|
if (!showLegend) {
|
|
351
|
-
return /* @__PURE__ */ jsxs("div", { className: "inline-block
|
|
351
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames("relative", responsive ? "block w-full min-w-0" : "inline-block"), children: [
|
|
352
352
|
chart,
|
|
353
353
|
tooltip
|
|
354
354
|
] });
|
|
355
355
|
}
|
|
356
|
-
return /* @__PURE__ */ jsxs("div", { className: wrapperClasses, children: [
|
|
356
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames(wrapperClasses, responsive && "w-full min-w-0"), children: [
|
|
357
357
|
chart,
|
|
358
358
|
/* @__PURE__ */ jsx(
|
|
359
359
|
ChartLegend,
|
|
@@ -1202,6 +1202,7 @@ function Table({
|
|
|
1202
1202
|
[autoVirtual, dataSource.length, virtual, virtualThreshold]
|
|
1203
1203
|
);
|
|
1204
1204
|
const effectiveVirtual = virtualRecommendation.enabled;
|
|
1205
|
+
const shouldObserveGeometry = effectiveVirtual || columnLockable || ctx.displayColumns.some((column) => column.fixed === "left" || column.fixed === "right");
|
|
1205
1206
|
const [virtualScrollTop, setVirtualScrollTop] = useState2(0);
|
|
1206
1207
|
const virtualWindow = useMemo2(
|
|
1207
1208
|
() => effectiveVirtual ? getTableVirtualWindow(
|
|
@@ -1224,6 +1225,9 @@ function Table({
|
|
|
1224
1225
|
} : void 0;
|
|
1225
1226
|
}, [effectiveVirtual, maxHeight, virtualHeight]);
|
|
1226
1227
|
useEffect2(() => {
|
|
1228
|
+
if (!shouldObserveGeometry) {
|
|
1229
|
+
return void 0;
|
|
1230
|
+
}
|
|
1227
1231
|
const wrapper = wrapperRef.current;
|
|
1228
1232
|
if (!wrapper) {
|
|
1229
1233
|
return void 0;
|
|
@@ -1240,7 +1244,7 @@ function Table({
|
|
|
1240
1244
|
});
|
|
1241
1245
|
controller.observe(wrapper, tableRef.current);
|
|
1242
1246
|
return () => controller.disconnect();
|
|
1243
|
-
}, [ctx.displayColumns.length, ctx.paginatedData.length]);
|
|
1247
|
+
}, [shouldObserveGeometry, ctx.displayColumns.length, ctx.paginatedData.length]);
|
|
1244
1248
|
return /* @__PURE__ */ jsxs4(
|
|
1245
1249
|
"div",
|
|
1246
1250
|
{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CropUpload
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-3RY6M4AK.mjs";
|
|
4
4
|
import "../chunk-K7MYQISG.mjs";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-PD6Q36OO.mjs";
|
|
6
6
|
import "../chunk-5TE7KLE5.mjs";
|
|
7
7
|
import "../chunk-ZJWUBR2X.mjs";
|
|
8
8
|
import "../chunk-SEWNVIHH.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataTableWithToolbar,
|
|
3
3
|
DataTableWithToolbar_default
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-HELLYIX2.mjs";
|
|
5
|
+
import "../chunk-YCKY72BW.mjs";
|
|
6
6
|
import "../chunk-PAN256RW.mjs";
|
|
7
7
|
import "../chunk-QWUDJC6K.mjs";
|
|
8
8
|
import "../chunk-IIWUQK2P.mjs";
|
package/dist/index.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expcat/tigercat-react",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "React components for Tigercat UI library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Yizhe Wang",
|
|
@@ -782,7 +782,7 @@
|
|
|
782
782
|
"access": "public"
|
|
783
783
|
},
|
|
784
784
|
"dependencies": {
|
|
785
|
-
"@expcat/tigercat-core": "2.0.0
|
|
785
|
+
"@expcat/tigercat-core": "2.0.0"
|
|
786
786
|
},
|
|
787
787
|
"devDependencies": {
|
|
788
788
|
"@types/node": "^26.1.1",
|