@expcat/tigercat-react 2.0.19 → 2.1.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 +25 -16
- package/dist/chunk-246DAUEF.mjs +181 -0
- package/dist/{chunk-PU3JY6RE.mjs → chunk-2JMI7TCM.mjs} +1 -1
- package/dist/chunk-2YBLMVDT.mjs +428 -0
- package/dist/chunk-2YOP55OF.mjs +639 -0
- package/dist/{chunk-25D5TXZH.mjs → chunk-32MCQMBJ.mjs} +8 -6
- package/dist/chunk-3HHEVMHE.mjs +180 -0
- package/dist/{chunk-HSBN5MLS.mjs → chunk-3LACOSJQ.mjs} +1 -1
- package/dist/{chunk-F6WV53BS.mjs → chunk-3LDDXHW2.mjs} +28 -11
- package/dist/{chunk-IXQAECFP.mjs → chunk-3QNIFKVF.mjs} +12 -14
- package/dist/{chunk-UD4DTVJZ.mjs → chunk-4C2X5PZO.mjs} +57 -25
- package/dist/chunk-5JETWHLJ.mjs +28 -0
- package/dist/{chunk-VA6PZWOH.mjs → chunk-5SEMRHBD.mjs} +14 -6
- package/dist/{chunk-EKILTLUO.mjs → chunk-72CJNKDY.mjs} +1 -1
- package/dist/{chunk-XE4YFBOZ.mjs → chunk-AUD3VOLO.mjs} +1 -1
- package/dist/{chunk-UT5BV2VO.mjs → chunk-AYFKHWJS.mjs} +16 -10
- package/dist/{chunk-RPSHILHD.mjs → chunk-BXAH2GH3.mjs} +8 -2
- package/dist/{chunk-EW5EO7VE.mjs → chunk-BYD7EAWK.mjs} +1 -1
- package/dist/{chunk-BOGOQ44C.mjs → chunk-CQOLQAB5.mjs} +105 -90
- package/dist/{chunk-L55UK45A.mjs → chunk-CRIEUKMD.mjs} +5 -2
- package/dist/{chunk-DKNVSQSV.mjs → chunk-CUAXRBKO.mjs} +12 -0
- package/dist/{chunk-E7OTDBI6.mjs → chunk-DECUASRW.mjs} +17 -19
- package/dist/{chunk-XMTEMBQV.mjs → chunk-EAAWB3CK.mjs} +16 -13
- package/dist/{chunk-D33BIMGK.mjs → chunk-EG7EMDKK.mjs} +12 -2
- package/dist/chunk-EW43YBPV.mjs +457 -0
- package/dist/{chunk-HOYBHB7B.mjs → chunk-FNK2VWPP.mjs} +1 -1
- package/dist/{chunk-RJPNBYK5.mjs → chunk-FQS24AUH.mjs} +12 -3
- package/dist/{chunk-LADKKOJT.mjs → chunk-GBEDWXLL.mjs} +16 -10
- package/dist/chunk-GR3Y3XWP.mjs +47 -0
- package/dist/{chunk-2ENQZECC.mjs → chunk-HAXRHSCN.mjs} +4 -3
- package/dist/{chunk-K4GIKSZE.mjs → chunk-I2BENK5X.mjs} +2 -1
- package/dist/chunk-IGBQGR6G.mjs +234 -0
- package/dist/chunk-J76R2S62.mjs +161 -0
- package/dist/{chunk-DNOPEJ5I.mjs → chunk-JZZPLKTW.mjs} +7 -4
- package/dist/{chunk-7KCQMXJA.mjs → chunk-KDURW5AS.mjs} +4 -3
- package/dist/{chunk-TFMEHUVZ.mjs → chunk-KKN7KLTB.mjs} +0 -1
- package/dist/{chunk-6MGQAJ62.mjs → chunk-KL6YJIZ3.mjs} +24 -7
- package/dist/chunk-KRDHM5KB.mjs +259 -0
- package/dist/{chunk-HHIW7V7B.mjs → chunk-M6ZPTGBV.mjs} +2 -10
- package/dist/chunk-MFPVVGNA.mjs +248 -0
- package/dist/{chunk-PXRZ6CKY.mjs → chunk-MJVSZ2UJ.mjs} +46 -16
- package/dist/{chunk-LZKBDQE4.mjs → chunk-MYI3FPG4.mjs} +23 -4
- package/dist/{chunk-OIGEBCAS.mjs → chunk-NADODEZX.mjs} +69 -1
- package/dist/{chunk-KMP5CVNK.mjs → chunk-NJWTZ5MO.mjs} +57 -45
- package/dist/chunk-NLGLBTSM.mjs +138 -0
- package/dist/chunk-NT7GW2FD.mjs +40 -0
- package/dist/{chunk-773LH7BK.mjs → chunk-O6VYD4E4.mjs} +24 -2
- package/dist/{chunk-G7D4QV7A.mjs → chunk-O7TV5OKS.mjs} +33 -6
- package/dist/{chunk-DPWRXXXW.mjs → chunk-OJ6SHHOZ.mjs} +3 -3
- package/dist/chunk-OKYMTHFQ.mjs +279 -0
- package/dist/{chunk-UYJJLHVA.mjs → chunk-PMQJ6AYT.mjs} +23 -21
- package/dist/chunk-PY2VUNEJ.mjs +494 -0
- package/dist/{chunk-BEJZPJIK.mjs → chunk-QOAOOD53.mjs} +10 -4
- package/dist/{chunk-2WGEHH5A.mjs → chunk-QU3QXUTC.mjs} +49 -23
- package/dist/{chunk-V6P7ZK6O.mjs → chunk-QXSUG7SN.mjs} +3 -3
- package/dist/{chunk-FYINJRYN.mjs → chunk-R7YZ6FKP.mjs} +27 -16
- package/dist/{chunk-YI6YWH66.mjs → chunk-RE5ZLA5D.mjs} +6 -6
- package/dist/{chunk-UCBW5RJN.mjs → chunk-RGVU4EMA.mjs} +11 -6
- package/dist/{chunk-IBSOUQGB.mjs → chunk-RRGPDFDI.mjs} +7 -4
- package/dist/{chunk-ZH5ZBLAN.mjs → chunk-RUQ3F3MV.mjs} +34 -7
- package/dist/chunk-SEOG5AGS.mjs +72 -0
- package/dist/{chunk-PGD5RPKF.mjs → chunk-SVIJ2UZA.mjs} +2 -1
- package/dist/chunk-SXWEFZOF.mjs +766 -0
- package/dist/{chunk-NCHUEGUW.mjs → chunk-TEVEXDY2.mjs} +27 -16
- package/dist/{chunk-DJOFM2VO.mjs → chunk-TO6MZFNQ.mjs} +52 -40
- package/dist/chunk-TQ6RIFWR.mjs +135 -0
- package/dist/chunk-U4M3DC2P.mjs +48 -0
- package/dist/{chunk-ZCGIZOMT.mjs → chunk-V7HJ5HLC.mjs} +6 -10
- package/dist/{chunk-SIDDYP3O.mjs → chunk-VJWSKJLJ.mjs} +1 -1
- package/dist/{chunk-ZG56T75O.mjs → chunk-WTHWLCRL.mjs} +51 -11
- package/dist/{chunk-KP6DEYWB.mjs → chunk-X4L3W7RQ.mjs} +1 -1
- package/dist/{chunk-ZMRTETN2.mjs → chunk-X6C6MNG5.mjs} +4 -3
- package/dist/chunk-XT43B7ZI.mjs +58 -0
- package/dist/{chunk-OGG2TQDG.mjs → chunk-XVHTJQ4T.mjs} +12 -1
- package/dist/{chunk-QJE3MZBO.mjs → chunk-Y6UH3EKE.mjs} +1 -1
- package/dist/chunk-YJ5T4XZN.mjs +81 -0
- package/dist/{chunk-VVNFXJMN.mjs → chunk-YNDPQVEK.mjs} +8 -1
- package/dist/{chunk-QGZ32NFQ.mjs → chunk-Z23KOLNU.mjs} +4 -3
- package/dist/{chunk-5CKMYMTS.mjs → chunk-ZATZRXMW.mjs} +27 -8
- package/dist/components/ActivityFeed.mjs +3 -3
- package/dist/components/Affix.mjs +1 -1
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/AreaChart.mjs +5 -4
- package/dist/components/AspectRatio.d.mts +10 -0
- package/dist/components/AspectRatio.mjs +8 -0
- package/dist/components/AutoComplete.mjs +1 -1
- package/dist/components/BarChart.mjs +5 -4
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Cascader.mjs +1 -1
- package/dist/components/ChartCanvas.mjs +1 -1
- package/dist/components/ChatWindow.mjs +4 -4
- package/dist/components/Code.mjs +3 -1
- package/dist/components/CollapsePanel.mjs +1 -1
- package/dist/components/ColorPicker.mjs +1 -1
- package/dist/components/CommentThread.mjs +2 -2
- package/dist/components/ContextMenu.d.mts +36 -0
- package/dist/components/ContextMenu.mjs +17 -0
- package/dist/components/DataExport.mjs +2 -2
- package/dist/components/DataTableWithToolbar.mjs +7 -7
- package/dist/components/DonutChart.mjs +4 -4
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/FileManager.mjs +2 -1
- package/dist/components/FloatButton.mjs +1 -1
- package/dist/components/FormItem.mjs +1 -1
- package/dist/components/FormWizard.mjs +1 -1
- package/dist/components/FunnelChart.mjs +3 -3
- package/dist/components/Gantt.d.mts +3 -1
- package/dist/components/Gantt.mjs +2 -2
- package/dist/components/GaugeChart.mjs +2 -2
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Highlight.d.mts +11 -0
- package/dist/components/Highlight.mjs +8 -0
- package/dist/components/Image.mjs +4 -4
- package/dist/components/ImageCompare.d.mts +15 -0
- package/dist/components/ImageCompare.mjs +8 -0
- package/dist/components/ImageGroup.mjs +2 -2
- package/dist/components/ImagePreview.mjs +1 -1
- package/dist/components/Input.mjs +1 -1
- package/dist/components/InputNumber.d.mts +1 -1
- package/dist/components/InputNumber.mjs +1 -1
- package/dist/components/InputOTP.d.mts +33 -0
- package/dist/components/InputOTP.mjs +12 -0
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/Kbd.d.mts +10 -0
- package/dist/components/Kbd.mjs +8 -0
- package/dist/components/LineChart.mjs +5 -4
- package/dist/components/List.mjs +2 -2
- package/dist/components/Loading.mjs +1 -1
- package/dist/components/LoadingBar.d.mts +8 -0
- package/dist/components/LoadingBar.mjs +138 -0
- package/dist/components/LoadingBarContainer.d.mts +8 -0
- package/dist/components/LoadingBarContainer.mjs +8 -0
- package/dist/components/LoadingBarRoot.d.mts +6 -0
- package/dist/components/LoadingBarRoot.mjs +6 -0
- package/dist/components/Marquee.d.mts +10 -0
- package/dist/components/Marquee.mjs +8 -0
- package/dist/components/MaskInput.d.mts +37 -0
- package/dist/components/MaskInput.mjs +10 -0
- package/dist/components/Masonry.d.mts +10 -0
- package/dist/components/Masonry.mjs +8 -0
- package/dist/components/NavigationMenu.d.mts +84 -0
- package/dist/components/NavigationMenu.mjs +23 -0
- package/dist/components/NotificationCenter.mjs +4 -4
- package/dist/components/OrgChart.mjs +2 -2
- package/dist/components/PageHeader.d.mts +34 -0
- package/dist/components/PageHeader.mjs +11 -0
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/PieChart.mjs +3 -3
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/QRCode.d.mts +2 -2
- package/dist/components/QRCode.mjs +1 -1
- package/dist/components/RadarChart.mjs +4 -4
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/ScatterChart.mjs +5 -4
- package/dist/components/ScrollArea.d.mts +10 -0
- package/dist/components/ScrollArea.mjs +8 -0
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Signature.mjs +1 -1
- package/dist/components/SplitButton.d.mts +38 -0
- package/dist/components/SplitButton.mjs +12 -0
- package/dist/components/Splitter.mjs +1 -1
- package/dist/components/Stepper.d.mts +2 -0
- package/dist/components/Stepper.mjs +2 -1
- package/dist/components/SunburstChart.mjs +3 -3
- package/dist/components/Switch.d.mts +5 -1
- package/dist/components/Switch.mjs +2 -1
- package/dist/components/Table.mjs +2 -2
- package/dist/components/TagsInput.d.mts +41 -0
- package/dist/components/TagsInput.mjs +13 -0
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/Textarea.mjs +1 -1
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/components/Tour.mjs +1 -1
- package/dist/components/TreeMapChart.mjs +3 -3
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/components/Upload.mjs +1 -1
- package/dist/hooks/useChartInteraction.d.mts +5 -0
- package/dist/hooks/useChartInteraction.mjs +1 -1
- package/dist/index.d.mts +17 -1
- package/dist/index.mjs +406 -0
- package/package.json +117 -2
- package/dist/chunk-7AFRHC7P.mjs +0 -312
- package/dist/chunk-CB4SK5AU.mjs +0 -235
- package/dist/chunk-KPACLRQH.mjs +0 -55
- package/dist/chunk-YIB6ZXZF.mjs +0 -386
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useResponsiveChartSize
|
|
3
|
+
} from "./chunk-5JETWHLJ.mjs";
|
|
1
4
|
import {
|
|
2
5
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JZZPLKTW.mjs";
|
|
7
|
+
import {
|
|
8
|
+
ChartSeries
|
|
9
|
+
} from "./chunk-SDLMB34Y.mjs";
|
|
4
10
|
import {
|
|
5
11
|
ChartTooltip
|
|
6
12
|
} from "./chunk-YORCCCQX.mjs";
|
|
@@ -9,16 +15,13 @@ import {
|
|
|
9
15
|
} from "./chunk-RQSQXQN6.mjs";
|
|
10
16
|
import {
|
|
11
17
|
ChartCanvas
|
|
12
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CUAXRBKO.mjs";
|
|
13
19
|
import {
|
|
14
20
|
ChartGrid
|
|
15
21
|
} from "./chunk-677VSTPW.mjs";
|
|
16
22
|
import {
|
|
17
23
|
ChartLegend
|
|
18
24
|
} from "./chunk-F2ITBDUS.mjs";
|
|
19
|
-
import {
|
|
20
|
-
ChartSeries
|
|
21
|
-
} from "./chunk-SDLMB34Y.mjs";
|
|
22
25
|
|
|
23
26
|
// src/components/LineChart.tsx
|
|
24
27
|
import { useId, useMemo, useState, useCallback } from "react";
|
|
@@ -29,7 +32,6 @@ import {
|
|
|
29
32
|
createLinePath,
|
|
30
33
|
createPointScale,
|
|
31
34
|
getChartElementOpacity,
|
|
32
|
-
getChartInnerRect,
|
|
33
35
|
getStableChartGradientPrefix,
|
|
34
36
|
getNumberExtent,
|
|
35
37
|
linePointTransitionClasses,
|
|
@@ -109,9 +111,11 @@ var LineChart = ({
|
|
|
109
111
|
() => getStableChartGradientPrefix("line", gradientId),
|
|
110
112
|
[gradientId]
|
|
111
113
|
);
|
|
112
|
-
const innerRect =
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
const { innerRect, onResolvedSizeChange } = useResponsiveChartSize(
|
|
115
|
+
width,
|
|
116
|
+
height,
|
|
117
|
+
padding,
|
|
118
|
+
responsive
|
|
115
119
|
);
|
|
116
120
|
const resolvedSeries = useMemo(
|
|
117
121
|
() => resolveSeriesData(series, data, {
|
|
@@ -133,6 +137,7 @@ var LineChart = ({
|
|
|
133
137
|
wrapperClasses
|
|
134
138
|
} = useChartInteraction({
|
|
135
139
|
hoverable,
|
|
140
|
+
showTooltip,
|
|
136
141
|
hoveredIndexProp,
|
|
137
142
|
selectable,
|
|
138
143
|
selectedIndexProp,
|
|
@@ -255,17 +260,21 @@ var LineChart = ({
|
|
|
255
260
|
(seriesIndex, pointIndex, event) => {
|
|
256
261
|
setHoveredPointInfo({ seriesIndex, pointIndex });
|
|
257
262
|
setTooltipPosition({ x: event.clientX, y: event.clientY });
|
|
258
|
-
|
|
263
|
+
if (hoverable) {
|
|
264
|
+
onPointHover?.(seriesIndex, pointIndex, resolvedSeries[seriesIndex]?.data[pointIndex]);
|
|
265
|
+
}
|
|
259
266
|
},
|
|
260
|
-
[onPointHover, resolvedSeries]
|
|
267
|
+
[hoverable, onPointHover, resolvedSeries]
|
|
261
268
|
);
|
|
262
269
|
const handlePointMouseMove = useCallback((event) => {
|
|
263
270
|
setTooltipPosition({ x: event.clientX, y: event.clientY });
|
|
264
271
|
}, []);
|
|
265
272
|
const handlePointMouseLeave = useCallback(() => {
|
|
266
273
|
setHoveredPointInfo(null);
|
|
267
|
-
|
|
268
|
-
|
|
274
|
+
if (hoverable) {
|
|
275
|
+
onPointHover?.(null, null, null);
|
|
276
|
+
}
|
|
277
|
+
}, [hoverable, onPointHover]);
|
|
269
278
|
const showPointTooltipFromElement = useCallback(
|
|
270
279
|
(el, seriesIndex, pointIndex) => {
|
|
271
280
|
if (!hoverable) return;
|
|
@@ -293,6 +302,7 @@ var LineChart = ({
|
|
|
293
302
|
[selectable, handleSeriesSelect]
|
|
294
303
|
);
|
|
295
304
|
const pointClickable = selectable || !!onPointClick;
|
|
305
|
+
const trackPointHover = showTooltip || hoverable;
|
|
296
306
|
const chart = /* @__PURE__ */ jsxs(
|
|
297
307
|
ChartCanvas,
|
|
298
308
|
{
|
|
@@ -303,6 +313,7 @@ var LineChart = ({
|
|
|
303
313
|
title,
|
|
304
314
|
desc,
|
|
305
315
|
className: classNames(className),
|
|
316
|
+
onResolvedSizeChange,
|
|
306
317
|
children: [
|
|
307
318
|
(seriesData.some((sd) => sd.showArea) || animated || strokeGradient || pointGradient) && /* @__PURE__ */ jsxs("defs", { children: [
|
|
308
319
|
animated && /* @__PURE__ */ jsx("style", { children: `
|
|
@@ -477,9 +488,9 @@ var LineChart = ({
|
|
|
477
488
|
tabIndex: pointInteractive ? 0 : void 0,
|
|
478
489
|
"data-point-index": point.pointIndex,
|
|
479
490
|
"data-series-key": sd.seriesKey,
|
|
480
|
-
onMouseEnter:
|
|
481
|
-
onMouseMove:
|
|
482
|
-
onMouseLeave:
|
|
491
|
+
onMouseEnter: trackPointHover ? (e) => handlePointMouseEnter(sd.seriesIndex, point.pointIndex, e) : void 0,
|
|
492
|
+
onMouseMove: trackPointHover ? handlePointMouseMove : void 0,
|
|
493
|
+
onMouseLeave: trackPointHover ? handlePointMouseLeave : void 0,
|
|
483
494
|
onClick: pointClickable ? (e) => {
|
|
484
495
|
e.stopPropagation();
|
|
485
496
|
handlePointClick(sd.seriesIndex, point.pointIndex);
|
|
@@ -4,9 +4,11 @@ import {
|
|
|
4
4
|
classNames,
|
|
5
5
|
getSplitterContainerClasses,
|
|
6
6
|
getSplitterGutterClasses,
|
|
7
|
+
getSplitterGutterCssVars,
|
|
7
8
|
getSplitterGutterHandleClasses,
|
|
8
9
|
getPaneStyle,
|
|
9
10
|
resizePanes,
|
|
11
|
+
resolveInitialPaneSizes,
|
|
10
12
|
createDocumentDragSession
|
|
11
13
|
} from "@expcat/tigercat-core";
|
|
12
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -37,20 +39,21 @@ var Splitter = ({
|
|
|
37
39
|
useEffect(() => cleanupDragSession, [cleanupDragSession]);
|
|
38
40
|
useEffect(() => {
|
|
39
41
|
const el = containerRef.current;
|
|
40
|
-
if (!el) return;
|
|
41
42
|
const paneCount2 = React.Children.count(children);
|
|
42
43
|
if (paneCount2 === 0) return;
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
const containerSize = el ? direction === "horizontal" ? el.clientWidth : el.clientHeight : 0;
|
|
45
|
+
const resolved = resolveInitialPaneSizes(
|
|
46
|
+
paneCount2,
|
|
47
|
+
containerSize,
|
|
48
|
+
gutterSize,
|
|
49
|
+
controlledSizes,
|
|
50
|
+
min,
|
|
51
|
+
max
|
|
52
|
+
);
|
|
53
|
+
if (resolved) {
|
|
54
|
+
setPaneSizes(resolved);
|
|
52
55
|
}
|
|
53
|
-
}, [children, direction, gutterSize, controlledSizes]);
|
|
56
|
+
}, [children, direction, gutterSize, controlledSizes, min, max]);
|
|
54
57
|
const paneCount = paneSizes.length;
|
|
55
58
|
const mins = useMemo(() => Array.from({ length: paneCount }, () => min), [paneCount, min]);
|
|
56
59
|
const maxes = useMemo(() => Array.from({ length: paneCount }, () => max), [paneCount, max]);
|
|
@@ -136,35 +139,44 @@ var Splitter = ({
|
|
|
136
139
|
() => classNames(getSplitterContainerClasses(direction, className)),
|
|
137
140
|
[direction, className]
|
|
138
141
|
);
|
|
139
|
-
return /* @__PURE__ */ jsx(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
ref: containerRef,
|
|
146
|
+
className: containerClasses,
|
|
147
|
+
style: { ...style, ...getSplitterGutterCssVars(gutterSize) },
|
|
148
|
+
"data-direction": direction,
|
|
149
|
+
children: childArray.map((child, i) => {
|
|
150
|
+
const size = paneSizes[i];
|
|
151
|
+
const paneStyle = size != null ? getPaneStyle(size, direction) : void 0;
|
|
152
|
+
const isDragging = draggingIndex === i;
|
|
153
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
154
|
+
/* @__PURE__ */ jsx(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
className: "tiger-splitter-pane relative overflow-auto",
|
|
158
|
+
style: paneStyle,
|
|
159
|
+
"data-pane-index": i,
|
|
160
|
+
children: child
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
i < childArray.length - 1 && /* @__PURE__ */ jsx(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
className: getSplitterGutterClasses(direction, !!isDragging, disabled),
|
|
167
|
+
role: "separator",
|
|
168
|
+
"aria-orientation": direction === "horizontal" ? "vertical" : "horizontal",
|
|
169
|
+
tabIndex: disabled ? -1 : 0,
|
|
170
|
+
"data-gutter-index": i,
|
|
171
|
+
onMouseDown: (e) => handleMouseDown(i, e),
|
|
172
|
+
onKeyDown: (e) => handleKeyDown(i, e),
|
|
173
|
+
children: /* @__PURE__ */ jsx("div", { className: getSplitterGutterHandleClasses(direction) })
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
] }, i);
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
);
|
|
168
180
|
};
|
|
169
181
|
var Splitter_default = Splitter;
|
|
170
182
|
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// src/components/Marquee.tsx
|
|
2
|
+
import { forwardRef, useCallback, useState } from "react";
|
|
3
|
+
import {
|
|
4
|
+
getMarqueeContentClasses,
|
|
5
|
+
getMarqueeRootClasses,
|
|
6
|
+
getMarqueeTrackClasses,
|
|
7
|
+
getMarqueeTrackStyle,
|
|
8
|
+
injectMarqueeStyles,
|
|
9
|
+
isMarqueeFocusInside,
|
|
10
|
+
isMarqueePaused,
|
|
11
|
+
resolveMarqueeAriaLabel,
|
|
12
|
+
resolveMarqueeDirection,
|
|
13
|
+
resolveMarqueePauseOnHover,
|
|
14
|
+
resolveMarqueeRepeat
|
|
15
|
+
} from "@expcat/tigercat-core";
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
var Marquee = forwardRef(
|
|
18
|
+
({
|
|
19
|
+
direction,
|
|
20
|
+
duration,
|
|
21
|
+
pauseOnHover,
|
|
22
|
+
gap,
|
|
23
|
+
repeat,
|
|
24
|
+
ariaLabel,
|
|
25
|
+
className,
|
|
26
|
+
style,
|
|
27
|
+
children,
|
|
28
|
+
onMouseEnter,
|
|
29
|
+
onMouseLeave,
|
|
30
|
+
onFocus,
|
|
31
|
+
onBlur,
|
|
32
|
+
...rest
|
|
33
|
+
}, ref) => {
|
|
34
|
+
injectMarqueeStyles();
|
|
35
|
+
const [hovered, setHovered] = useState(false);
|
|
36
|
+
const [focused, setFocused] = useState(false);
|
|
37
|
+
const resolvedDirection = resolveMarqueeDirection(direction);
|
|
38
|
+
const resolvedPauseOnHover = resolveMarqueePauseOnHover(pauseOnHover);
|
|
39
|
+
const copies = resolveMarqueeRepeat(repeat);
|
|
40
|
+
const paused = isMarqueePaused({
|
|
41
|
+
pauseOnHover: resolvedPauseOnHover,
|
|
42
|
+
hovered,
|
|
43
|
+
focused
|
|
44
|
+
});
|
|
45
|
+
const { "aria-label": ariaLabelAttr, ...domProps } = rest;
|
|
46
|
+
const resolvedAriaLabel = resolveMarqueeAriaLabel(
|
|
47
|
+
typeof ariaLabelAttr === "string" ? ariaLabelAttr : ariaLabel
|
|
48
|
+
);
|
|
49
|
+
const handleMouseEnter = useCallback(
|
|
50
|
+
(event) => {
|
|
51
|
+
if (resolvedPauseOnHover) setHovered(true);
|
|
52
|
+
onMouseEnter?.(event);
|
|
53
|
+
},
|
|
54
|
+
[onMouseEnter, resolvedPauseOnHover]
|
|
55
|
+
);
|
|
56
|
+
const handleMouseLeave = useCallback(
|
|
57
|
+
(event) => {
|
|
58
|
+
if (resolvedPauseOnHover) setHovered(false);
|
|
59
|
+
onMouseLeave?.(event);
|
|
60
|
+
},
|
|
61
|
+
[onMouseLeave, resolvedPauseOnHover]
|
|
62
|
+
);
|
|
63
|
+
const handleFocus = useCallback(
|
|
64
|
+
(event) => {
|
|
65
|
+
if (resolvedPauseOnHover) setFocused(true);
|
|
66
|
+
onFocus?.(event);
|
|
67
|
+
},
|
|
68
|
+
[onFocus, resolvedPauseOnHover]
|
|
69
|
+
);
|
|
70
|
+
const handleBlur = useCallback(
|
|
71
|
+
(event) => {
|
|
72
|
+
if (resolvedPauseOnHover && !isMarqueeFocusInside(event.currentTarget, event.relatedTarget)) {
|
|
73
|
+
setFocused(false);
|
|
74
|
+
}
|
|
75
|
+
onBlur?.(event);
|
|
76
|
+
},
|
|
77
|
+
[onBlur, resolvedPauseOnHover]
|
|
78
|
+
);
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
...domProps,
|
|
83
|
+
ref,
|
|
84
|
+
role: "region",
|
|
85
|
+
"aria-label": resolvedAriaLabel,
|
|
86
|
+
"data-marquee": "",
|
|
87
|
+
"data-marquee-direction": resolvedDirection,
|
|
88
|
+
"data-marquee-paused": paused ? "true" : "false",
|
|
89
|
+
"data-marquee-pause-on-hover": resolvedPauseOnHover ? "true" : "false",
|
|
90
|
+
className: getMarqueeRootClasses({
|
|
91
|
+
direction: resolvedDirection,
|
|
92
|
+
pauseOnHover: resolvedPauseOnHover,
|
|
93
|
+
repeat: copies,
|
|
94
|
+
className
|
|
95
|
+
}),
|
|
96
|
+
style,
|
|
97
|
+
onMouseEnter: handleMouseEnter,
|
|
98
|
+
onMouseLeave: handleMouseLeave,
|
|
99
|
+
onFocus: handleFocus,
|
|
100
|
+
onBlur: handleBlur,
|
|
101
|
+
children: /* @__PURE__ */ jsx(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
"data-marquee-track": "",
|
|
105
|
+
className: getMarqueeTrackClasses(resolvedDirection),
|
|
106
|
+
style: getMarqueeTrackStyle({ duration, gap, repeat: copies }),
|
|
107
|
+
children: Array.from({ length: copies }, (_, index) => {
|
|
108
|
+
const clone = index > 0;
|
|
109
|
+
return /* @__PURE__ */ jsx(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
className: getMarqueeContentClasses({
|
|
113
|
+
direction: resolvedDirection,
|
|
114
|
+
clone
|
|
115
|
+
}),
|
|
116
|
+
"data-marquee-content": "",
|
|
117
|
+
...clone ? { "data-marquee-clone": "", "aria-hidden": true } : {},
|
|
118
|
+
children
|
|
119
|
+
},
|
|
120
|
+
clone ? `clone-${index}` : "content"
|
|
121
|
+
);
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
Marquee.displayName = "Marquee";
|
|
130
|
+
var Marquee_default = Marquee;
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
Marquee,
|
|
134
|
+
Marquee_default
|
|
135
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/components/LoadingBarRoot.ts
|
|
2
|
+
var loadingBarModulePromise = null;
|
|
3
|
+
var pendingCommands = [];
|
|
4
|
+
var resolvedApi = null;
|
|
5
|
+
function loadLoadingBarModule() {
|
|
6
|
+
loadingBarModulePromise ??= import("./components/LoadingBar.mjs");
|
|
7
|
+
return loadingBarModulePromise;
|
|
8
|
+
}
|
|
9
|
+
function applyCommand(api, command) {
|
|
10
|
+
if (command.type === "start") {
|
|
11
|
+
api.start(command.options);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
api[command.type]();
|
|
15
|
+
}
|
|
16
|
+
function enqueue(command) {
|
|
17
|
+
if (resolvedApi) {
|
|
18
|
+
applyCommand(resolvedApi, command);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
pendingCommands.push(command);
|
|
22
|
+
void loadLoadingBarModule().then(({ LoadingBar: LoadingBar2 }) => {
|
|
23
|
+
resolvedApi = LoadingBar2;
|
|
24
|
+
const queue = pendingCommands;
|
|
25
|
+
pendingCommands = [];
|
|
26
|
+
for (const item of queue) {
|
|
27
|
+
applyCommand(LoadingBar2, item);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
var LoadingBar = {
|
|
32
|
+
start(options) {
|
|
33
|
+
enqueue({ type: "start", options });
|
|
34
|
+
},
|
|
35
|
+
finish() {
|
|
36
|
+
enqueue({ type: "finish" });
|
|
37
|
+
},
|
|
38
|
+
error() {
|
|
39
|
+
enqueue({ type: "error" });
|
|
40
|
+
},
|
|
41
|
+
clear() {
|
|
42
|
+
enqueue({ type: "clear" });
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
LoadingBar
|
|
48
|
+
};
|
|
@@ -275,14 +275,11 @@ var ImagePreview = ({
|
|
|
275
275
|
},
|
|
276
276
|
[handleNext, handlePrev, touchSwipeThreshold]
|
|
277
277
|
);
|
|
278
|
-
const handleMaskClick = useCallback(
|
|
279
|
-
(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
},
|
|
284
|
-
[maskClosable, handleClose]
|
|
285
|
-
);
|
|
278
|
+
const handleMaskClick = useCallback(() => {
|
|
279
|
+
if (maskClosable) {
|
|
280
|
+
handleClose();
|
|
281
|
+
}
|
|
282
|
+
}, [maskClosable, handleClose]);
|
|
286
283
|
const transform = useMemo(
|
|
287
284
|
() => `${calculateTransform(scale, offsetX, offsetY)} rotate(${rotation}deg)`,
|
|
288
285
|
[scale, offsetX, offsetY, rotation]
|
|
@@ -298,10 +295,9 @@ var ImagePreview = ({
|
|
|
298
295
|
role: "dialog",
|
|
299
296
|
"aria-modal": "true",
|
|
300
297
|
"aria-label": labels.previewDialogAriaLabel,
|
|
301
|
-
onClick: handleMaskClick,
|
|
302
298
|
onWheel: handleWheel,
|
|
303
299
|
children: [
|
|
304
|
-
/* @__PURE__ */ jsx("div", { className: imagePreviewMaskClasses, "aria-hidden": "true" }),
|
|
300
|
+
/* @__PURE__ */ jsx("div", { className: imagePreviewMaskClasses, "aria-hidden": "true", onClick: handleMaskClick }),
|
|
305
301
|
/* @__PURE__ */ jsx(
|
|
306
302
|
"img",
|
|
307
303
|
{
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-HKAZXG74.mjs";
|
|
4
4
|
|
|
5
5
|
// src/utils/use-popup.ts
|
|
6
|
-
import { useCallback, useMemo, useRef, useState } from "react";
|
|
6
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import {
|
|
8
8
|
buildTriggerHandlerMap,
|
|
9
|
+
createFloatingHoverDelayController,
|
|
9
10
|
restoreFocus
|
|
10
11
|
} from "@expcat/tigercat-core";
|
|
11
12
|
function usePopup(options) {
|
|
@@ -33,6 +34,18 @@ function usePopup(options) {
|
|
|
33
34
|
},
|
|
34
35
|
[disabled, isControlled, onOpenChange]
|
|
35
36
|
);
|
|
37
|
+
const setVisibleRef = useRef(setVisible);
|
|
38
|
+
setVisibleRef.current = setVisible;
|
|
39
|
+
const hoverControllerRef = useRef(
|
|
40
|
+
null
|
|
41
|
+
);
|
|
42
|
+
if (hoverControllerRef.current === null) {
|
|
43
|
+
hoverControllerRef.current = createFloatingHoverDelayController({
|
|
44
|
+
show: () => setVisibleRef.current(true),
|
|
45
|
+
hide: () => setVisibleRef.current(false)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const hoverController = hoverControllerRef.current;
|
|
36
49
|
const restoreTriggerFocus = useCallback(() => {
|
|
37
50
|
const trigger2 = triggerRef.current;
|
|
38
51
|
const target = trigger2?.querySelector(
|
|
@@ -43,19 +56,32 @@ function usePopup(options) {
|
|
|
43
56
|
}, 0);
|
|
44
57
|
}, []);
|
|
45
58
|
const closeAndRestoreFocus = useCallback(() => {
|
|
46
|
-
|
|
59
|
+
hoverController.closeNow();
|
|
47
60
|
restoreTriggerFocus();
|
|
48
|
-
}, [
|
|
61
|
+
}, [hoverController, restoreTriggerFocus]);
|
|
62
|
+
const effectiveTrigger = multiTrigger ? trigger : "click";
|
|
49
63
|
const handleToggle = useCallback(() => {
|
|
50
|
-
if (
|
|
51
|
-
|
|
64
|
+
if (disabled) return;
|
|
65
|
+
hoverController.cancel();
|
|
66
|
+
setVisible(!currentVisible);
|
|
67
|
+
}, [disabled, currentVisible, setVisible, hoverController]);
|
|
52
68
|
const handleShow = useCallback(() => {
|
|
53
|
-
if (
|
|
54
|
-
|
|
69
|
+
if (disabled) return;
|
|
70
|
+
if (effectiveTrigger === "hover") {
|
|
71
|
+
hoverController.enter();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
hoverController.cancel();
|
|
75
|
+
setVisible(true);
|
|
76
|
+
}, [disabled, effectiveTrigger, setVisible, hoverController]);
|
|
55
77
|
const handleHide = useCallback(() => {
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
if (disabled) return;
|
|
79
|
+
if (effectiveTrigger === "hover") {
|
|
80
|
+
hoverController.leave();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
hoverController.closeNow();
|
|
84
|
+
}, [disabled, effectiveTrigger, hoverController]);
|
|
59
85
|
const overlay = useAnchoredOverlay({
|
|
60
86
|
enabled: currentVisible,
|
|
61
87
|
referenceRef: triggerRef,
|
|
@@ -69,10 +95,24 @@ function usePopup(options) {
|
|
|
69
95
|
if (reason === "escape") {
|
|
70
96
|
closeAndRestoreFocus();
|
|
71
97
|
} else {
|
|
72
|
-
|
|
98
|
+
hoverController.closeNow();
|
|
73
99
|
}
|
|
74
100
|
}
|
|
75
101
|
});
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (!multiTrigger || effectiveTrigger !== "hover" || !currentVisible) return;
|
|
104
|
+
const el = floatingRef.current;
|
|
105
|
+
if (!el) return;
|
|
106
|
+
const handleEnter = () => hoverController.enter();
|
|
107
|
+
const handleLeave = () => hoverController.leave();
|
|
108
|
+
el.addEventListener("mouseenter", handleEnter);
|
|
109
|
+
el.addEventListener("mouseleave", handleLeave);
|
|
110
|
+
return () => {
|
|
111
|
+
el.removeEventListener("mouseenter", handleEnter);
|
|
112
|
+
el.removeEventListener("mouseleave", handleLeave);
|
|
113
|
+
};
|
|
114
|
+
}, [multiTrigger, effectiveTrigger, currentVisible, hoverController]);
|
|
115
|
+
useEffect(() => () => hoverController.dispose(), [hoverController]);
|
|
76
116
|
const triggerHandlers = useMemo(() => {
|
|
77
117
|
if (!multiTrigger) {
|
|
78
118
|
return { onClick: handleToggle };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JZZPLKTW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ChartTooltip
|
|
6
6
|
} from "./chunk-YORCCCQX.mjs";
|
|
7
7
|
import {
|
|
8
8
|
ChartCanvas
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CUAXRBKO.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ChartLegend
|
|
12
12
|
} from "./chunk-F2ITBDUS.mjs";
|
|
@@ -87,6 +87,7 @@ var TreeMapChart = ({
|
|
|
87
87
|
wrapperClasses
|
|
88
88
|
} = useChartInteraction({
|
|
89
89
|
hoverable,
|
|
90
|
+
showTooltip,
|
|
90
91
|
hoveredIndexProp,
|
|
91
92
|
selectable,
|
|
92
93
|
selectedIndexProp,
|
|
@@ -200,7 +201,7 @@ var TreeMapChart = ({
|
|
|
200
201
|
] })
|
|
201
202
|
}
|
|
202
203
|
);
|
|
203
|
-
const tooltip = showTooltip
|
|
204
|
+
const tooltip = showTooltip ? /* @__PURE__ */ jsx(
|
|
204
205
|
ChartTooltip,
|
|
205
206
|
{
|
|
206
207
|
content: tooltipContent,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// src/components/LoadingBarContainer.tsx
|
|
2
|
+
import {
|
|
3
|
+
DEFAULT_LOADING_BAR_ARIA_LABEL,
|
|
4
|
+
DEFAULT_LOADING_BAR_COLOR,
|
|
5
|
+
DEFAULT_LOADING_BAR_HEIGHT,
|
|
6
|
+
getLoadingBarContainerClasses,
|
|
7
|
+
getLoadingBarFillClasses,
|
|
8
|
+
getLoadingBarFillStyle,
|
|
9
|
+
LOADING_BAR_CONTAINER_ID
|
|
10
|
+
} from "@expcat/tigercat-core";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var LoadingBarContainer = ({
|
|
13
|
+
percentage = 0,
|
|
14
|
+
status = "idle",
|
|
15
|
+
color = DEFAULT_LOADING_BAR_COLOR,
|
|
16
|
+
height = DEFAULT_LOADING_BAR_HEIGHT,
|
|
17
|
+
className,
|
|
18
|
+
style,
|
|
19
|
+
ariaLabel,
|
|
20
|
+
...rest
|
|
21
|
+
}) => {
|
|
22
|
+
const isBusy = status === "loading";
|
|
23
|
+
const resolvedAriaLabel = ariaLabel?.trim() || DEFAULT_LOADING_BAR_ARIA_LABEL;
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
...rest,
|
|
28
|
+
id: LOADING_BAR_CONTAINER_ID,
|
|
29
|
+
className: getLoadingBarContainerClasses(className),
|
|
30
|
+
style: { ...style, height: `${height}px` },
|
|
31
|
+
"data-tiger-loading-bar-container": "",
|
|
32
|
+
"data-tiger-loading-bar-status": status,
|
|
33
|
+
children: /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: getLoadingBarFillClasses(status, color),
|
|
37
|
+
style: getLoadingBarFillStyle(percentage, height),
|
|
38
|
+
role: "progressbar",
|
|
39
|
+
"aria-label": resolvedAriaLabel,
|
|
40
|
+
"aria-valuemin": 0,
|
|
41
|
+
"aria-valuemax": 100,
|
|
42
|
+
"aria-valuenow": Math.round(percentage),
|
|
43
|
+
"aria-busy": isBusy || void 0,
|
|
44
|
+
"aria-live": "polite",
|
|
45
|
+
"aria-atomic": "true",
|
|
46
|
+
"data-tiger-loading-bar": "",
|
|
47
|
+
"data-tiger-loading-bar-status": status
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
var LoadingBarContainer_default = LoadingBarContainer;
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
LoadingBarContainer,
|
|
57
|
+
LoadingBarContainer_default
|
|
58
|
+
};
|