@expcat/tigercat-react 2.1.3 → 2.2.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/README.md +13 -19
- package/dist/{chunk-65CDWNRJ.mjs → chunk-2IOF3EC7.mjs} +1 -1
- package/dist/{chunk-5I7FKHZO.mjs → chunk-2MKDIXBP.mjs} +1 -1
- package/dist/chunk-2MV3F7WP.mjs +56 -0
- package/dist/{chunk-WLCRBIZO.mjs → chunk-2W4SH2IG.mjs} +1 -1
- package/dist/{chunk-YLXEMZVI.mjs → chunk-3C62ULJT.mjs} +1 -1
- package/dist/{chunk-6IJFLGCN.mjs → chunk-3QXXNK5X.mjs} +1 -1
- package/dist/{chunk-KVXGNUIE.mjs → chunk-4IVRLBKW.mjs} +1 -1
- package/dist/{chunk-YCVORYEO.mjs → chunk-532OVXLV.mjs} +3 -1
- package/dist/{chunk-R7J37DKJ.mjs → chunk-5TQFSORK.mjs} +2 -2
- package/dist/{chunk-ZATZSMQY.mjs → chunk-6L7RWLOU.mjs} +1 -1
- package/dist/{chunk-T5VXIYWF.mjs → chunk-6T5AEQJV.mjs} +2 -2
- package/dist/{chunk-R2VBVZIH.mjs → chunk-75SQCTLC.mjs} +4 -4
- package/dist/{chunk-U7V7ZWJ6.mjs → chunk-7QM2ZC52.mjs} +1 -1
- package/dist/{chunk-M7TSPEXC.mjs → chunk-A2PQJEII.mjs} +1 -1
- package/dist/{chunk-5P3OFNH3.mjs → chunk-ACHXTII7.mjs} +1 -1
- package/dist/{chunk-EJY3Y2XU.mjs → chunk-AHQR57Z4.mjs} +2 -2
- package/dist/{chunk-2N6WZ5Z5.mjs → chunk-BNC4MMVG.mjs} +1 -1
- package/dist/{chunk-I4P4T6LL.mjs → chunk-BVSR27AF.mjs} +1 -1
- package/dist/{chunk-2STETY2J.mjs → chunk-CCFKRKGJ.mjs} +12 -6
- package/dist/{chunk-N53N6H54.mjs → chunk-CQGDJU2H.mjs} +2 -2
- package/dist/{chunk-GRB667BG.mjs → chunk-DDSY5FPV.mjs} +1 -1
- package/dist/{chunk-OIMP63RE.mjs → chunk-DJLVNYZD.mjs} +1 -1
- package/dist/{chunk-HZGTQGSM.mjs → chunk-DNRLMEKE.mjs} +11 -4
- package/dist/{chunk-PZ4LAI6G.mjs → chunk-EK7R3MIN.mjs} +1 -1
- package/dist/{chunk-RTKPLZ5A.mjs → chunk-EVO4YVSD.mjs} +1 -1
- package/dist/chunk-F4XF5CGQ.mjs +72 -0
- package/dist/{chunk-GMHJWSQB.mjs → chunk-FTLA6FRU.mjs} +2 -2
- package/dist/chunk-FZQUUTWN.mjs +145 -0
- package/dist/{chunk-AFVKH2Z3.mjs → chunk-G4Y25JES.mjs} +1 -1
- package/dist/{chunk-CJSB5NOK.mjs → chunk-H3UEVWOO.mjs} +1 -1
- package/dist/{chunk-CX7QZXU5.mjs → chunk-HEVB53MU.mjs} +1 -1
- package/dist/{chunk-5QTYD4XG.mjs → chunk-HKPRHDW4.mjs} +1 -1
- package/dist/{chunk-7KVHHNUI.mjs → chunk-ION7IDAW.mjs} +1 -1
- package/dist/{chunk-CCTBNDCX.mjs → chunk-IWXG4346.mjs} +1 -1
- package/dist/{chunk-WW6MFKTJ.mjs → chunk-IXMQQ6PV.mjs} +3 -3
- package/dist/{chunk-IPI45RUK.mjs → chunk-JX2WKSVM.mjs} +1 -1
- package/dist/{chunk-PTKQJPLM.mjs → chunk-KDXNJN6C.mjs} +1 -1
- package/dist/{chunk-WKZZ4IQK.mjs → chunk-KEFHL7CJ.mjs} +1 -1
- package/dist/{chunk-XBDLXTF7.mjs → chunk-KJHPPPB2.mjs} +1 -1
- package/dist/{chunk-PLEAZRIC.mjs → chunk-LKTM4NU4.mjs} +1 -1
- package/dist/{chunk-2FFAUB47.mjs → chunk-MF6LOOXR.mjs} +2 -2
- package/dist/{chunk-KJB2OIG7.mjs → chunk-MMDVFCCL.mjs} +3 -3
- package/dist/{chunk-25BKSXTX.mjs → chunk-NMRCBGFP.mjs} +1 -1
- package/dist/{chunk-NPGU6VYD.mjs → chunk-OU2AV7DY.mjs} +1 -1
- package/dist/{chunk-6D2VLITE.mjs → chunk-OZ4WH3GE.mjs} +1 -1
- package/dist/{chunk-A6PNUVY6.mjs → chunk-PBF5TEF4.mjs} +2 -2
- package/dist/{chunk-JML6CK44.mjs → chunk-PQPO7XSV.mjs} +1 -1
- package/dist/{chunk-TVVLCER6.mjs → chunk-QCRTRRBD.mjs} +179 -163
- package/dist/chunk-REHHFHZ3.mjs +67 -0
- package/dist/{chunk-XI6KQAHW.mjs → chunk-RJ2FJXHT.mjs} +5 -6
- package/dist/{chunk-XKB7ECPU.mjs → chunk-S37KEELR.mjs} +1 -1
- package/dist/{chunk-RNKUEEIX.mjs → chunk-S5GHNXGQ.mjs} +4 -4
- package/dist/{chunk-OES5DL3S.mjs → chunk-SCN6UULA.mjs} +1 -1
- package/dist/{chunk-OYQ6HTLQ.mjs → chunk-SGKPZW57.mjs} +1 -1
- package/dist/{chunk-WN6ZHQTI.mjs → chunk-SIBNSFVR.mjs} +10 -4
- package/dist/{chunk-C4UZFBFV.mjs → chunk-SOVB7HJF.mjs} +1 -1
- package/dist/{chunk-3WP4PGHF.mjs → chunk-TFHQODGK.mjs} +7 -1
- package/dist/{chunk-IR45LOEZ.mjs → chunk-UGKTSPS4.mjs} +38 -4
- package/dist/{chunk-GJRGMIB3.mjs → chunk-UVI5JN47.mjs} +1 -1
- package/dist/{chunk-UAFA5GOL.mjs → chunk-VE3PZFFT.mjs} +2 -1
- package/dist/{chunk-XXU5VQV5.mjs → chunk-VGWFHVJ7.mjs} +1 -1
- package/dist/{chunk-BNCUJLRV.mjs → chunk-VW6RNQK4.mjs} +1 -1
- package/dist/{chunk-IZC77KAN.mjs → chunk-WWDZAWTS.mjs} +1 -1
- package/dist/{chunk-ZGXC47M5.mjs → chunk-YDIEWFBM.mjs} +1 -1
- package/dist/{chunk-53RDSFKZ.mjs → chunk-YUFKPLCK.mjs} +1 -1
- package/dist/{chunk-WSN4Z4MC.mjs → chunk-Z3AD5DZX.mjs} +1 -1
- package/dist/{chunk-6NCG4SLX.mjs → chunk-ZZJVJUO4.mjs} +1 -1
- package/dist/components/ActivityFeed.mjs +4 -4
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/AreaChart.mjs +3 -3
- package/dist/components/AutoComplete.mjs +2 -2
- package/dist/components/BackTop.mjs +1 -1
- package/dist/components/BarChart.mjs +3 -3
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Cascader.mjs +2 -2
- package/dist/components/ChartTooltip.mjs +2 -2
- package/dist/components/Code.mjs +1 -1
- package/dist/components/ColorPicker.mjs +2 -2
- package/dist/components/CommentThread.mjs +2 -2
- package/dist/components/ContextMenu.mjs +2 -2
- package/dist/components/CropUpload.mjs +4 -4
- package/dist/components/DataExport.mjs +3 -3
- package/dist/components/DataTableWithToolbar.mjs +7 -7
- package/dist/components/DatePicker.mjs +3 -3
- package/dist/components/DonutChart.mjs +4 -4
- package/dist/components/Drag.d.mts +17 -0
- package/dist/components/Drag.mjs +9 -0
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/FloatButton.mjs +2 -2
- package/dist/components/Footer.mjs +1 -1
- package/dist/components/FormItem.mjs +2 -2
- package/dist/components/FullscreenButton.d.mts +8 -0
- package/dist/components/FullscreenButton.mjs +10 -0
- package/dist/components/FunnelChart.mjs +3 -3
- package/dist/components/GaugeChart.mjs +3 -3
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Image.mjs +5 -5
- package/dist/components/ImageCropper.mjs +1 -1
- package/dist/components/ImageGroup.mjs +3 -3
- package/dist/components/ImagePreview.mjs +2 -2
- package/dist/components/ImageViewer.mjs +3 -3
- package/dist/components/LineChart.mjs +3 -3
- package/dist/components/List.mjs +3 -3
- package/dist/components/Loading.mjs +2 -2
- package/dist/components/Mentions.mjs +2 -2
- package/dist/components/Menu.mjs +2 -2
- package/dist/components/Message.mjs +2 -2
- package/dist/components/MessageContainer.mjs +2 -2
- package/dist/components/MessageRoot.mjs +1 -1
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/NavigationMenu.mjs +2 -2
- package/dist/components/Notification.mjs +2 -2
- package/dist/components/NotificationCenter.mjs +5 -5
- package/dist/components/NotificationContainer.mjs +2 -2
- package/dist/components/NotificationRoot.mjs +1 -1
- package/dist/components/NumberKeyboard.mjs +2 -2
- package/dist/components/PieChart.mjs +3 -3
- package/dist/components/Popconfirm.mjs +3 -3
- package/dist/components/Popover.mjs +3 -3
- package/dist/components/RadarChart.mjs +3 -3
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/ScatterChart.mjs +3 -3
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Select.mjs +2 -2
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/SplitButton.mjs +3 -3
- package/dist/components/Spotlight.mjs +2 -2
- package/dist/components/SunburstChart.mjs +3 -3
- package/dist/components/Table.mjs +4 -4
- package/dist/components/Text.d.mts +5 -1
- package/dist/components/Text.mjs +2 -1
- package/dist/components/TimePicker.mjs +2 -2
- package/dist/components/Tooltip.mjs +3 -3
- package/dist/components/Tour.mjs +2 -2
- package/dist/components/TreeMapChart.mjs +3 -3
- package/dist/components/TreeSelect.mjs +2 -2
- package/dist/components/Upload.mjs +3 -3
- package/dist/hooks/useFullscreen.d.mts +13 -0
- package/dist/hooks/useFullscreen.mjs +6 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.mjs +43 -0
- package/package.json +17 -2
- package/dist/chunk-VDBLI5Y3.mjs +0 -33
- /package/dist/{chunk-HHRU7TK3.mjs → chunk-GF7W2FTZ.mjs} +0 -0
- /package/dist/{chunk-XJHC6JEC.mjs → chunk-P44HJQNB.mjs} +0 -0
package/README.md
CHANGED
|
@@ -35,25 +35,12 @@ function App() {
|
|
|
35
35
|
|
|
36
36
|
## Components
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
| -------------- | ----- | ------------------------------------------------------------- |
|
|
45
|
-
| **Basic** | 30 | Button, Alert, Avatar, Badge, Icon, Tag, Text, Result, QRCode |
|
|
46
|
-
| **Form** | 31 | Input, Select, DatePicker, Form, Upload, InputOTP, TagsInput |
|
|
47
|
-
| **Layout** | 19 | Card, Row/Col, Layout, List, Descriptions, Skeleton, Space |
|
|
48
|
-
| **Navigation** | 33 | Menu, Tabs, Breadcrumb, Pagination, Steps, Dropdown, Tree |
|
|
49
|
-
| **Feedback** | 13 | Modal, Drawer, Message, Popover, Tooltip, Progress, Tour |
|
|
50
|
-
| **Data** | 7 | Table, Calendar, Collapse, Timeline, DataExport |
|
|
51
|
-
| **Charts** | 20 | BarChart, LineChart, PieChart, RadarChart, GaugeChart, Gantt |
|
|
52
|
-
| **Advanced** | 12 | VirtualTable, VirtualList, RichTextEditor, CodeEditor |
|
|
53
|
-
| **Composite** | 7 | DataTableWithToolbar, ChatWindow, FormWizard, TaskBoard |
|
|
54
|
-
|
|
55
|
-
`Message` and `notification` are also available as imperative command APIs from
|
|
56
|
-
the package root; `notification` is a command API, not a component.
|
|
38
|
+
Sampler: Button, Avatar, Badge, Input, Select, DatePicker, Form, Card, Layout, Menu, Tabs, Modal, Drawer, Table, BarChart, LineChart, VirtualTable, RichTextEditor, DataTableWithToolbar, ChatWindow. The generated catalog with import subpaths is
|
|
39
|
+
[component-index.md](https://github.com/expcat/Tigercat/blob/main/skills/tigercat/references/component-index.md).
|
|
40
|
+
|
|
41
|
+
`Message`, `notification`, and `LoadingBar` are root command APIs;
|
|
42
|
+
[command-apis.md](https://github.com/expcat/Tigercat/blob/main/skills/tigercat/references/command-apis.md).
|
|
43
|
+
`notification` is not a component.
|
|
57
44
|
|
|
58
45
|
## Hooks
|
|
59
46
|
|
|
@@ -63,6 +50,13 @@ the package root; `notification` is a command API, not a component.
|
|
|
63
50
|
`useBreadcrumbContext` and `useStepsContext`. Signatures are listed in
|
|
64
51
|
[api-summary.md](https://github.com/expcat/Tigercat/blob/main/skills/tigercat/references/shared/api-summary.md).
|
|
65
52
|
|
|
53
|
+
## Next
|
|
54
|
+
|
|
55
|
+
- Install, compatibility, and MCP client config:
|
|
56
|
+
[root README](https://github.com/expcat/Tigercat/blob/main/README.md)
|
|
57
|
+
- Agent docs:
|
|
58
|
+
[SKILL.md](https://github.com/expcat/Tigercat/blob/main/skills/tigercat/SKILL.md)
|
|
59
|
+
|
|
66
60
|
## License
|
|
67
61
|
|
|
68
62
|
[MIT](https://opensource.org/licenses/MIT)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// src/hooks/useFullscreen.ts
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import {
|
|
4
|
+
exitElementFullscreen,
|
|
5
|
+
getFullscreenElement,
|
|
6
|
+
isElementFullscreen,
|
|
7
|
+
isFullscreenSupported,
|
|
8
|
+
requestElementFullscreen,
|
|
9
|
+
resolveFullscreenTarget,
|
|
10
|
+
subscribeFullscreenChange
|
|
11
|
+
} from "@expcat/tigercat-core";
|
|
12
|
+
function useFullscreen(options = {}) {
|
|
13
|
+
const optionsRef = useRef(options);
|
|
14
|
+
optionsRef.current = options;
|
|
15
|
+
const [supported] = useState(() => isFullscreenSupported());
|
|
16
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
17
|
+
const sync = useCallback(() => {
|
|
18
|
+
const target = resolveFullscreenTarget(optionsRef.current.target);
|
|
19
|
+
const next = isElementFullscreen(target);
|
|
20
|
+
setIsFullscreen(next);
|
|
21
|
+
optionsRef.current.onChange?.(next);
|
|
22
|
+
}, []);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
sync();
|
|
25
|
+
return subscribeFullscreenChange(sync);
|
|
26
|
+
}, [sync]);
|
|
27
|
+
const enter = useCallback(async () => {
|
|
28
|
+
const target = resolveFullscreenTarget(optionsRef.current.target);
|
|
29
|
+
if (!target) return;
|
|
30
|
+
if (isElementFullscreen(target)) return;
|
|
31
|
+
try {
|
|
32
|
+
await requestElementFullscreen(target);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
const err = error instanceof Error ? error : new Error("Fullscreen request failed");
|
|
35
|
+
optionsRef.current.onError?.(err);
|
|
36
|
+
}
|
|
37
|
+
}, []);
|
|
38
|
+
const exit = useCallback(async () => {
|
|
39
|
+
if (!getFullscreenElement()) return;
|
|
40
|
+
try {
|
|
41
|
+
await exitElementFullscreen();
|
|
42
|
+
} catch (error) {
|
|
43
|
+
const err = error instanceof Error ? error : new Error("Fullscreen exit failed");
|
|
44
|
+
optionsRef.current.onError?.(err);
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
const toggle = useCallback(async () => {
|
|
48
|
+
if (isFullscreen) await exit();
|
|
49
|
+
else await enter();
|
|
50
|
+
}, [enter, exit, isFullscreen]);
|
|
51
|
+
return { isFullscreen, supported, enter, exit, toggle };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
useFullscreen
|
|
56
|
+
};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Dropdown,
|
|
3
3
|
DropdownItem,
|
|
4
4
|
DropdownMenu
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-H3UEVWOO.mjs";
|
|
6
6
|
import {
|
|
7
7
|
Button
|
|
8
8
|
} from "./chunk-WFLXJOFU.mjs";
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
getSplitButtonRootClasses,
|
|
20
20
|
getSplitButtonTriggerClasses,
|
|
21
21
|
resolveLocaleText,
|
|
22
|
+
splitButtonDropdownClasses,
|
|
22
23
|
resolveSplitButtonSize,
|
|
23
24
|
resolveSplitButtonTriggerAriaLabel,
|
|
24
25
|
resolveSplitButtonVariant
|
|
@@ -139,6 +140,7 @@ var SplitButton = forwardRef(function SplitButton2({
|
|
|
139
140
|
hasMenu ? /* @__PURE__ */ jsx(
|
|
140
141
|
Dropdown,
|
|
141
142
|
{
|
|
143
|
+
className: splitButtonDropdownClasses,
|
|
142
144
|
trigger: "click",
|
|
143
145
|
showArrow: false,
|
|
144
146
|
asChild: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePopup
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S37KEELR.mjs";
|
|
4
4
|
import {
|
|
5
5
|
composeRefs,
|
|
6
6
|
renderOverlayTrigger
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
renderOverlayPortal,
|
|
13
13
|
useFocusTrap
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OU2AV7DY.mjs";
|
|
15
15
|
import {
|
|
16
16
|
useTigerConfig
|
|
17
17
|
} from "./chunk-RUIFGSVN.mjs";
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "./chunk-WQMOFDAY.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Loading
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VW6RNQK4.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Tag
|
|
12
12
|
} from "./chunk-FVA5VKN2.mjs";
|
|
13
13
|
import {
|
|
14
14
|
Text
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FZQUUTWN.mjs";
|
|
16
16
|
import {
|
|
17
17
|
Card
|
|
18
18
|
} from "./chunk-WCIUNNIN.mjs";
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import {
|
|
4
4
|
classNames,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getLayoutFooterClasses,
|
|
6
|
+
injectLayoutGridStyles
|
|
7
7
|
} from "@expcat/tigercat-core";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
var Footer = forwardRef(function Footer2({ className, height, style, as = "footer", children, ...props }, ref) {
|
|
9
|
+
var Footer = forwardRef(function Footer2({ className, height, size = "default", style, as = "footer", children, ...props }, ref) {
|
|
10
10
|
injectLayoutGridStyles();
|
|
11
|
-
const footerClasses = classNames(
|
|
11
|
+
const footerClasses = classNames(getLayoutFooterClasses(size), className);
|
|
12
12
|
const footerStyle = height ? { ...style, height } : style;
|
|
13
13
|
const Tag = as;
|
|
14
14
|
return /* @__PURE__ */ jsx(Tag, { ref, className: footerClasses, style: footerStyle, ...props, children });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Calendar
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UGKTSPS4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useInputGroupContext
|
|
6
6
|
} from "./chunk-2AVQQGL2.mjs";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
renderOverlayPortal,
|
|
15
15
|
useAnchoredOverlay,
|
|
16
16
|
useFocusTrap
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OU2AV7DY.mjs";
|
|
18
18
|
import {
|
|
19
19
|
useTigerConfig
|
|
20
20
|
} from "./chunk-RUIFGSVN.mjs";
|
|
@@ -299,7 +299,7 @@ var Slider = forwardRef(function Slider2({
|
|
|
299
299
|
{
|
|
300
300
|
...divProps,
|
|
301
301
|
ref: setRootRef,
|
|
302
|
-
className: getSliderRootClasses(effectiveDisabled, className),
|
|
302
|
+
className: getSliderRootClasses(effectiveDisabled, className, tooltip),
|
|
303
303
|
"data-status": status === "default" ? void 0 : status,
|
|
304
304
|
children: [
|
|
305
305
|
/* @__PURE__ */ jsx("div", { className: sliderHitAreaClasses, onPointerDown: handleTrackPointerDown, children: /* @__PURE__ */ jsxs("div", { ref: trackRef, className: trackClasses, onPointerDown: handleTrackPointerDown, children: [
|
|
@@ -65,13 +65,18 @@ var ScrollSpy = forwardRef(function ScrollSpy2({
|
|
|
65
65
|
const flatItems = useMemo(() => flattenScrollSpyItems(items), [items]);
|
|
66
66
|
const activeKeyRef = useRef(currentActiveKey);
|
|
67
67
|
activeKeyRef.current = currentActiveKey;
|
|
68
|
-
const
|
|
68
|
+
const hostRef = useRef(null);
|
|
69
|
+
const setHostRef = (node) => {
|
|
70
|
+
hostRef.current = node;
|
|
71
|
+
if (typeof ref === "function") ref(node);
|
|
72
|
+
else if (ref) ref.current = node;
|
|
73
|
+
};
|
|
74
|
+
const resolvedContainer = resolveScrollSpyContainer(getContainer, hostRef.current);
|
|
69
75
|
const containerKey = resolvedContainer === window ? "window" : resolvedContainer;
|
|
70
76
|
const getContainerRef = useRef(getContainer);
|
|
71
77
|
getContainerRef.current = getContainer;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
);
|
|
78
|
+
const resolveContainer = () => resolveScrollSpyContainer(getContainerRef.current, hostRef.current);
|
|
79
|
+
const scrollLockRef = useRef(createProgrammaticScrollLock(() => resolveContainer()));
|
|
75
80
|
const emitActive = useCallback(
|
|
76
81
|
(item, source) => {
|
|
77
82
|
const nextKeyString = getScrollSpyKeyString(item.key);
|
|
@@ -85,6 +90,7 @@ var ScrollSpy = forwardRef(function ScrollSpy2({
|
|
|
85
90
|
useEffect(() => {
|
|
86
91
|
return createScrollSpyObserver(items, {
|
|
87
92
|
container: getContainerRef.current,
|
|
93
|
+
from: hostRef.current,
|
|
88
94
|
offsetTop: offset,
|
|
89
95
|
bounds,
|
|
90
96
|
onChange: (item) => {
|
|
@@ -110,7 +116,7 @@ var ScrollSpy = forwardRef(function ScrollSpy2({
|
|
|
110
116
|
onClick?.(item, event);
|
|
111
117
|
emitActive(item, "click");
|
|
112
118
|
scrollLockRef.current.lock();
|
|
113
|
-
activateScrollSpyClick(item,
|
|
119
|
+
activateScrollSpyClick(item, resolveContainer(), offset);
|
|
114
120
|
},
|
|
115
121
|
[emitActive, offset, onClick]
|
|
116
122
|
);
|
|
@@ -144,7 +150,7 @@ var ScrollSpy = forwardRef(function ScrollSpy2({
|
|
|
144
150
|
"nav",
|
|
145
151
|
{
|
|
146
152
|
...rest,
|
|
147
|
-
ref,
|
|
153
|
+
ref: setHostRef,
|
|
148
154
|
className: classNames(getScrollSpyRootClasses(sticky, className)),
|
|
149
155
|
style: getScrollSpyRootStyle(sticky, offset, style),
|
|
150
156
|
"aria-label": ariaLabel ?? labels.ariaLabel,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePopup
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S37KEELR.mjs";
|
|
4
4
|
import {
|
|
5
5
|
composeRefs,
|
|
6
6
|
renderOverlayTrigger
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
renderOverlayPortal,
|
|
10
10
|
useFocusTrap
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OU2AV7DY.mjs";
|
|
12
12
|
|
|
13
13
|
// src/components/Popover.tsx
|
|
14
14
|
import { forwardRef, useEffect, useId, useMemo } from "react";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
renderOverlayPortal,
|
|
12
12
|
useAnchoredOverlay
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OU2AV7DY.mjs";
|
|
14
14
|
import {
|
|
15
15
|
useTigerConfig
|
|
16
16
|
} from "./chunk-RUIFGSVN.mjs";
|
|
@@ -50,7 +50,9 @@ import {
|
|
|
50
50
|
reconcileSearchOpenKeys,
|
|
51
51
|
resolveMenuCollapsed,
|
|
52
52
|
resolveMenuMode,
|
|
53
|
+
resolveMenuSearchQuery,
|
|
53
54
|
resolveSearchFilter,
|
|
55
|
+
shouldShowMenuSearch,
|
|
54
56
|
warnControlledSearchOpenKeys
|
|
55
57
|
} from "@expcat/tigercat-core";
|
|
56
58
|
|
|
@@ -201,9 +203,14 @@ function useMenuRootState(props) {
|
|
|
201
203
|
},
|
|
202
204
|
[setSearchValue]
|
|
203
205
|
);
|
|
206
|
+
const showSearch = shouldShowMenuSearch(searchable, collapsed);
|
|
204
207
|
const { filtered: filteredItems, expandKeys } = useMemo(
|
|
205
|
-
() => resolveSearchFilter({
|
|
206
|
-
|
|
208
|
+
() => resolveSearchFilter({
|
|
209
|
+
items,
|
|
210
|
+
query: resolveMenuSearchQuery(searchable, collapsed, searchValue),
|
|
211
|
+
filterMode
|
|
212
|
+
}),
|
|
213
|
+
[items, searchValue, filterMode, searchable, collapsed]
|
|
207
214
|
);
|
|
208
215
|
useEffect(() => {
|
|
209
216
|
const current = openKeysRef.current;
|
|
@@ -285,7 +292,7 @@ function useMenuRootState(props) {
|
|
|
285
292
|
resolvedMode,
|
|
286
293
|
mode,
|
|
287
294
|
contextValue,
|
|
288
|
-
searchable,
|
|
295
|
+
searchable: showSearch,
|
|
289
296
|
searchValue,
|
|
290
297
|
searchPlaceholder: searchPlaceholder ?? locale?.common?.searchPlaceholder ?? "Search",
|
|
291
298
|
emptyText: emptyText ?? locale?.common?.emptyText ?? "No data",
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDrag
|
|
3
|
+
} from "./chunk-REJVXLW5.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Drag.tsx
|
|
6
|
+
import React from "react";
|
|
7
|
+
import {
|
|
8
|
+
classNames,
|
|
9
|
+
reorderSequence
|
|
10
|
+
} from "@expcat/tigercat-core";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
function Drag({
|
|
13
|
+
items = [],
|
|
14
|
+
onItemsChange,
|
|
15
|
+
config,
|
|
16
|
+
containerId,
|
|
17
|
+
onDragStart,
|
|
18
|
+
onDragOver,
|
|
19
|
+
onDrop,
|
|
20
|
+
onDragEnd,
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
renderItem
|
|
24
|
+
}) {
|
|
25
|
+
const itemsRef = React.useRef(items);
|
|
26
|
+
itemsRef.current = items;
|
|
27
|
+
const onItemsChangeRef = React.useRef(onItemsChange);
|
|
28
|
+
onItemsChangeRef.current = onItemsChange;
|
|
29
|
+
const onDropRef = React.useRef(onDrop);
|
|
30
|
+
onDropRef.current = onDrop;
|
|
31
|
+
const drag = useDrag({
|
|
32
|
+
config,
|
|
33
|
+
containerId,
|
|
34
|
+
onDragStart,
|
|
35
|
+
onDragOver,
|
|
36
|
+
onDragEnd,
|
|
37
|
+
onDrop: (event) => {
|
|
38
|
+
onDropRef.current?.(event);
|
|
39
|
+
if (event.fromIndex === event.toIndex) return;
|
|
40
|
+
const next = reorderSequence(itemsRef.current, event.fromIndex, event.toIndex).map(
|
|
41
|
+
(item, index) => ({ ...item, index })
|
|
42
|
+
);
|
|
43
|
+
onItemsChangeRef.current?.(next);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const render = children ?? renderItem;
|
|
47
|
+
const zoneProps = drag.getDropZoneProps();
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
"ul",
|
|
50
|
+
{
|
|
51
|
+
...zoneProps,
|
|
52
|
+
className: classNames("m-0 list-none p-0", className),
|
|
53
|
+
"data-tiger-drag": "",
|
|
54
|
+
role: "list",
|
|
55
|
+
children: items.map((item) => {
|
|
56
|
+
const itemProps = drag.getDragItemProps(item);
|
|
57
|
+
const node = render?.(item, {
|
|
58
|
+
dragItemProps: itemProps,
|
|
59
|
+
isDragging: drag.draggedItem?.id === item.id
|
|
60
|
+
});
|
|
61
|
+
return /* @__PURE__ */ jsx(React.Fragment, { children: node ?? /* @__PURE__ */ jsx("li", { ...itemProps, role: "listitem", children: String(item.id) }) }, item.id);
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
Drag.displayName = "Drag";
|
|
67
|
+
var Drag_default = Drag;
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
Drag,
|
|
71
|
+
Drag_default
|
|
72
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Select
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A2PQJEII.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Radio
|
|
6
6
|
} from "./chunk-4KZETZUH.mjs";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-HAG7TGPS.mjs";
|
|
19
19
|
import {
|
|
20
20
|
Loading
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VW6RNQK4.mjs";
|
|
22
22
|
import {
|
|
23
23
|
Button
|
|
24
24
|
} from "./chunk-WFLXJOFU.mjs";
|