@expcat/tigercat-react 1.3.3 → 1.4.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-3SV6J7I5.mjs → chunk-2L7QEOFD.mjs} +34 -25
- package/dist/{chunk-FNJDBFKM.mjs → chunk-2LYV6NBJ.mjs} +6 -1
- package/dist/{chunk-EEWHWEYO.js → chunk-2RBHQBSG.js} +2 -2
- package/dist/{chunk-Y5RQN5BO.mjs → chunk-376X7SDZ.mjs} +2 -2
- package/dist/{chunk-UXUYCWQC.js → chunk-3EDASNTG.js} +5 -5
- package/dist/{chunk-NPTXXUXF.mjs → chunk-3RBRWBUG.mjs} +9 -7
- package/dist/{chunk-PUZDW7NR.js → chunk-4AMSYFYC.js} +134 -20
- package/dist/{chunk-IG75YSX3.mjs → chunk-4MONGWU5.mjs} +4 -6
- package/dist/{chunk-3CJFNG54.mjs → chunk-56CTXEJS.mjs} +1 -1
- package/dist/{chunk-TMON4MPO.js → chunk-5ALMTE35.js} +9 -7
- package/dist/{chunk-MSHCPJIJ.mjs → chunk-6BOSSZM3.mjs} +8 -9
- package/dist/{chunk-SIY6FDKJ.js → chunk-7CHTTM6D.js} +339 -314
- package/dist/{chunk-RF2BA2N6.js → chunk-7PXALKLM.js} +4 -4
- package/dist/{chunk-DLKUDB2R.js → chunk-AF2AEZKM.js} +15 -3
- package/dist/{chunk-FB34UWF7.mjs → chunk-AVLIUHOS.mjs} +101 -40
- package/dist/{chunk-TSJYAEFZ.js → chunk-B63GEB2Y.js} +358 -305
- package/dist/{chunk-CFPKK5WW.js → chunk-BA6TJQZL.js} +12 -12
- package/dist/{chunk-LMTUM3J3.js → chunk-BEM7XG2L.js} +2 -4
- package/dist/{chunk-MB6U72CI.js → chunk-BEZO5IE4.js} +2 -2
- package/dist/{chunk-5OHVTGHS.mjs → chunk-BN4ZKCAI.mjs} +368 -315
- package/dist/{chunk-UHFHOTNI.js → chunk-BRA3PO53.js} +6 -7
- package/dist/{chunk-M7HBWFQO.js → chunk-BROIZ266.js} +11 -1
- package/dist/{chunk-SDZOVRVR.mjs → chunk-CAQPYJFA.mjs} +350 -325
- package/dist/{chunk-BFAZZUD6.js → chunk-CC5GFX6F.js} +5 -22
- package/dist/{chunk-LQT6ZGME.mjs → chunk-CME2IFUT.mjs} +15 -3
- package/dist/{chunk-KQ5I7PRM.js → chunk-CNNEUJR2.js} +28 -14
- package/dist/{chunk-EF5ZTNHX.js → chunk-D5MQBUP2.js} +16 -4
- package/dist/{chunk-RQXY2MGX.mjs → chunk-D7UR526A.mjs} +231 -184
- package/dist/{chunk-CBYJXDW4.js → chunk-DBMC6FPU.js} +16 -4
- package/dist/{chunk-WQ4FOHOU.mjs → chunk-DEIVWO2D.mjs} +3 -5
- package/dist/{chunk-7QZ4XT2P.mjs → chunk-DVEK5SO6.mjs} +3 -8
- package/dist/{chunk-TC6JLEGZ.js → chunk-EJKOUI26.js} +24 -7
- package/dist/{chunk-4GITZKAH.mjs → chunk-EPJ6W4VI.mjs} +14 -2
- package/dist/{chunk-KYP7U6FK.js → chunk-FZHBVHQ6.js} +34 -25
- package/dist/{chunk-WVVXZKNI.js → chunk-GDPU5MYA.js} +3 -8
- package/dist/{chunk-2GQCFTD7.mjs → chunk-H4MPPCTB.mjs} +23 -4
- package/dist/{chunk-YOAYDEWW.mjs → chunk-HHMYERHY.mjs} +3 -20
- package/dist/{chunk-LRPPXU74.mjs → chunk-I7FEGKX2.mjs} +19 -5
- package/dist/{chunk-F6IXIH6B.mjs → chunk-IZGXDHPB.mjs} +24 -5
- package/dist/{chunk-GQFVVAEF.js → chunk-J6OZWT3P.js} +5 -5
- package/dist/{chunk-IGAMV6ML.mjs → chunk-KDXKF6B2.mjs} +1 -1
- package/dist/{chunk-A42OLED6.mjs → chunk-KED5S2WG.mjs} +13 -2
- package/dist/{chunk-BJQIYELW.mjs → chunk-KGMVRIYC.mjs} +5 -5
- package/dist/{chunk-6GYT3EZD.mjs → chunk-KXT2TP6A.mjs} +3 -4
- package/dist/{chunk-BBLVRLXT.js → chunk-KYNWNTGO.js} +230 -146
- package/dist/{chunk-M73NMNZX.js → chunk-L24PPXLV.js} +17 -5
- package/dist/chunk-L3WPA2RP.js +25 -0
- package/dist/{chunk-V4JIZN3E.mjs → chunk-L6KSO66F.mjs} +4 -12
- package/dist/{chunk-4LX5UGPQ.js → chunk-LJRCEB7F.js} +168 -121
- package/dist/{chunk-F7H4ALKN.js → chunk-LZG24TDB.js} +8 -9
- package/dist/{chunk-ZYJTHGQW.js → chunk-M3FVPPMM.js} +9 -13
- package/dist/{chunk-GN3TSQWW.mjs → chunk-M6YXUNOU.mjs} +2 -2
- package/dist/{chunk-I373B74W.js → chunk-MC26ORSN.js} +102 -41
- package/dist/{chunk-5HFHHFQS.mjs → chunk-MTIGGMHG.mjs} +17 -5
- package/dist/{chunk-DKT2EYVM.mjs → chunk-MV2JQ6XQ.mjs} +3 -6
- package/dist/{chunk-HR5GBE3P.js → chunk-NDGA3N6H.js} +19 -7
- package/dist/{chunk-BO6QGXMN.mjs → chunk-NEZ445D4.mjs} +9 -9
- package/dist/{chunk-4U5HSR2H.js → chunk-NVI2P7VH.js} +3 -4
- package/dist/{chunk-NVEIVIAW.mjs → chunk-OFRKYQOZ.mjs} +133 -19
- package/dist/{chunk-AW5M3EL4.js → chunk-OS6M3IZF.js} +62 -12
- package/dist/{chunk-3ZNZLGQO.mjs → chunk-OXQOKKTP.mjs} +6 -7
- package/dist/{chunk-NMEVQPOD.js → chunk-PHAJXRGE.js} +2 -4
- package/dist/{chunk-WG3YS2QV.js → chunk-PT5T5F4H.js} +13 -2
- package/dist/{chunk-WNLUUD5N.mjs → chunk-QIL24WZD.mjs} +8 -12
- package/dist/{chunk-ZFMMAYSX.js → chunk-QLATA4UB.js} +4 -6
- package/dist/{chunk-KIYNHQGW.mjs → chunk-RVLV63SI.mjs} +41 -20
- package/dist/{chunk-3QPCQH62.mjs → chunk-RYNLPRUM.mjs} +1 -1
- package/dist/{chunk-6GIJ7NFV.mjs → chunk-SDZKL3IB.mjs} +3 -5
- package/dist/{chunk-G5USITWF.js → chunk-SH4BZYXO.js} +27 -8
- package/dist/{chunk-L5AMVEQL.mjs → chunk-SLEXEH7R.mjs} +60 -10
- package/dist/{chunk-JLRRXRZO.js → chunk-SQONS5PH.js} +4 -7
- package/dist/chunk-SQTOVSDU.mjs +692 -0
- package/dist/{chunk-3ZQMHXRY.js → chunk-TEYL5X56.js} +39 -18
- package/dist/{chunk-KGSDDVRC.mjs → chunk-TNTOSFGN.mjs} +4 -4
- package/dist/{chunk-CY5GRTAX.js → chunk-UAM3RQY4.js} +24 -5
- package/dist/{chunk-XRNKHQTL.js → chunk-UEAXYZSE.js} +3 -2
- package/dist/{chunk-7ISEWLA3.js → chunk-UKQMF3JV.js} +21 -6
- package/dist/{chunk-ITVLIR7T.mjs → chunk-ULWT6W6M.mjs} +13 -20
- package/dist/{chunk-M5GSLKUX.mjs → chunk-VAIWWELW.mjs} +15 -3
- package/dist/{chunk-4SO4LANY.js → chunk-VC26SAXB.js} +340 -274
- package/dist/{chunk-SKMZTW3K.js → chunk-WCTNQYXO.js} +16 -23
- package/dist/{chunk-KXNWY2Q7.mjs → chunk-WFWEMXO7.mjs} +241 -157
- package/dist/chunk-WHYHLUXG.mjs +25 -0
- package/dist/{chunk-ONTRGV5T.js → chunk-WZUADPYB.js} +6 -14
- package/dist/{chunk-N4PP3ENO.js → chunk-XTQUPDRI.js} +2 -2
- package/dist/{chunk-XATXFVKR.mjs → chunk-Y7K27DVV.mjs} +4 -3
- package/dist/{chunk-WI4N5DD3.mjs → chunk-YH57D4AV.mjs} +16 -4
- package/dist/{chunk-3MRP3XYI.js → chunk-YRVAF2ID.js} +7 -2
- package/dist/{chunk-5XE5VBDS.mjs → chunk-YSGM22AH.mjs} +11 -1
- package/dist/{chunk-6TR7JB6C.js → chunk-ZDNQGS4O.js} +4 -4
- package/dist/{chunk-CHBUNQIJ.mjs → chunk-ZQSMJS2Q.mjs} +23 -6
- package/dist/{chunk-QQFLRNI3.mjs → chunk-ZRZB3C5J.mjs} +18 -3
- package/dist/components/ActivityFeed.js +4 -3
- package/dist/components/ActivityFeed.mjs +3 -2
- package/dist/components/Cascader.d.mts +3 -1
- package/dist/components/Cascader.d.ts +3 -1
- package/dist/components/Cascader.js +3 -2
- package/dist/components/Cascader.mjs +2 -1
- package/dist/components/ChatWindow.js +5 -5
- package/dist/components/ChatWindow.mjs +4 -4
- package/dist/components/Checkbox.js +4 -4
- package/dist/components/Checkbox.mjs +3 -3
- package/dist/components/CheckboxGroup.js +3 -3
- package/dist/components/CheckboxGroup.mjs +2 -2
- package/dist/components/CommentThread.js +4 -4
- package/dist/components/CommentThread.mjs +3 -3
- package/dist/components/CropUpload.js +4 -4
- package/dist/components/CropUpload.mjs +3 -3
- package/dist/components/DataTableWithToolbar.d.mts +2 -2
- package/dist/components/DataTableWithToolbar.d.ts +2 -2
- package/dist/components/DataTableWithToolbar.js +11 -11
- package/dist/components/DataTableWithToolbar.mjs +10 -10
- package/dist/components/DatePicker.d.mts +1 -0
- package/dist/components/DatePicker.d.ts +1 -0
- package/dist/components/DatePicker.js +3 -2
- package/dist/components/DatePicker.mjs +2 -1
- package/dist/components/Drawer.js +3 -3
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/FileManager.d.mts +2 -1
- package/dist/components/FileManager.d.ts +2 -1
- package/dist/components/FileManager.js +3 -2
- package/dist/components/FileManager.mjs +2 -1
- package/dist/components/Form.js +3 -2
- package/dist/components/Form.mjs +2 -1
- package/dist/components/FormItem.js +4 -3
- package/dist/components/FormItem.mjs +3 -2
- package/dist/components/FormWizard.js +4 -4
- package/dist/components/FormWizard.mjs +3 -3
- package/dist/components/Image.js +4 -4
- package/dist/components/Image.mjs +3 -3
- package/dist/components/ImageGroup.js +3 -3
- package/dist/components/ImageGroup.mjs +2 -2
- package/dist/components/ImagePreview.js +2 -2
- package/dist/components/ImagePreview.mjs +1 -1
- package/dist/components/ImageViewer.d.mts +1 -1
- package/dist/components/ImageViewer.d.ts +1 -1
- package/dist/components/ImageViewer.js +2 -2
- package/dist/components/ImageViewer.mjs +1 -1
- package/dist/components/InfiniteScroll.d.mts +2 -0
- package/dist/components/InfiniteScroll.d.ts +2 -0
- package/dist/components/InfiniteScroll.js +3 -2
- package/dist/components/InfiniteScroll.mjs +2 -1
- package/dist/components/Input.js +3 -2
- package/dist/components/Input.mjs +2 -1
- package/dist/components/InputNumber.js +3 -2
- package/dist/components/InputNumber.mjs +2 -1
- package/dist/components/List.d.mts +6 -2
- package/dist/components/List.d.ts +6 -2
- package/dist/components/List.js +3 -2
- package/dist/components/List.mjs +2 -1
- package/dist/components/Loading.js +3 -2
- package/dist/components/Loading.mjs +2 -1
- package/dist/components/MarkdownEditor.js +3 -3
- package/dist/components/MarkdownEditor.mjs +2 -2
- package/dist/components/Mentions.js +2 -2
- package/dist/components/Mentions.mjs +1 -1
- package/dist/components/Menu.d.mts +8 -80
- package/dist/components/Menu.d.ts +8 -80
- package/dist/components/Menu.js +2 -2
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/MenuItem.d.mts +6 -2
- package/dist/components/MenuItem.d.ts +6 -2
- package/dist/components/MenuItem.js +2 -2
- package/dist/components/MenuItem.mjs +1 -1
- package/dist/components/MenuItemGroup.d.mts +6 -2
- package/dist/components/MenuItemGroup.d.ts +6 -2
- package/dist/components/MenuItemGroup.js +2 -2
- package/dist/components/MenuItemGroup.mjs +1 -1
- package/dist/components/Message.js +2 -2
- package/dist/components/Message.mjs +1 -1
- package/dist/components/Modal.js +3 -3
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/Notification.js +2 -2
- package/dist/components/Notification.mjs +1 -1
- package/dist/components/NotificationCenter.js +5 -4
- package/dist/components/NotificationCenter.mjs +4 -3
- package/dist/components/NumberKeyboard.js +3 -2
- package/dist/components/NumberKeyboard.mjs +2 -1
- package/dist/components/Radio.js +4 -4
- package/dist/components/Radio.mjs +3 -3
- package/dist/components/RadioGroup.js +3 -3
- package/dist/components/RadioGroup.mjs +2 -2
- package/dist/components/RichTextEditor.js +3 -3
- package/dist/components/RichTextEditor.mjs +2 -2
- package/dist/components/Select.d.mts +3 -1
- package/dist/components/Select.d.ts +3 -1
- package/dist/components/Select.js +3 -2
- package/dist/components/Select.mjs +2 -1
- package/dist/components/Signature.d.mts +1 -0
- package/dist/components/Signature.d.ts +1 -0
- package/dist/components/Signature.js +3 -2
- package/dist/components/Signature.mjs +2 -1
- package/dist/components/Spotlight.js +4 -2
- package/dist/components/Spotlight.mjs +3 -1
- package/dist/components/Steps.js +2 -2
- package/dist/components/Steps.mjs +1 -1
- package/dist/components/StepsItem.js +2 -2
- package/dist/components/StepsItem.mjs +1 -1
- package/dist/components/SubMenu.d.mts +6 -2
- package/dist/components/SubMenu.d.ts +6 -2
- package/dist/components/SubMenu.js +2 -2
- package/dist/components/SubMenu.mjs +1 -1
- package/dist/components/Table.d.mts +2 -2
- package/dist/components/Table.d.ts +2 -2
- package/dist/components/Table.js +9 -9
- package/dist/components/Table.mjs +8 -8
- package/dist/components/Textarea.js +3 -3
- package/dist/components/Textarea.mjs +2 -2
- package/dist/components/TimePicker.d.mts +1 -0
- package/dist/components/TimePicker.d.ts +1 -0
- package/dist/components/TimePicker.js +4 -2
- package/dist/components/TimePicker.mjs +3 -1
- package/dist/components/Tour.js +3 -2
- package/dist/components/Tour.mjs +2 -1
- package/dist/components/Transfer.d.mts +3 -1
- package/dist/components/Transfer.d.ts +3 -1
- package/dist/components/Transfer.js +3 -2
- package/dist/components/Transfer.mjs +2 -1
- package/dist/components/Tree.d.mts +3 -1
- package/dist/components/Tree.d.ts +3 -1
- package/dist/components/Tree.js +3 -2
- package/dist/components/Tree.mjs +2 -1
- package/dist/components/TreeSelect.d.mts +3 -1
- package/dist/components/TreeSelect.d.ts +3 -1
- package/dist/components/TreeSelect.js +3 -2
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/components/Upload.js +3 -2
- package/dist/components/Upload.mjs +2 -1
- package/dist/components/VirtualTable.d.mts +3 -2
- package/dist/components/VirtualTable.d.ts +3 -2
- package/dist/components/VirtualTable.js +3 -2
- package/dist/components/VirtualTable.mjs +2 -1
- package/dist/index.d.mts +33 -7
- package/dist/index.d.ts +33 -7
- package/dist/index.js +54 -54
- package/dist/index.mjs +53 -53
- package/dist/{types-CHmCMNEM.d.ts → types-0oVwMXtR.d.mts} +1 -1
- package/dist/{types-CHmCMNEM.d.mts → types-0oVwMXtR.d.ts} +1 -1
- package/dist/types-DaC4a0Ny.d.mts +80 -0
- package/dist/types-DaC4a0Ny.d.ts +80 -0
- package/package.json +2 -2
- package/dist/chunk-UKGQ7256.js +0 -12
- package/dist/chunk-UQMPEMY7.mjs +0 -12
- package/dist/chunk-VNVGSPBI.mjs +0 -626
- package/dist/{chunk-OZD75CLT.js → chunk-ANBNSUSR.js} +3 -3
- package/dist/{chunk-I2AUOICV.mjs → chunk-M3MOSUZO.mjs} +3 -3
- package/dist/{chunk-UMZ3PMUJ.js → chunk-SXHCMZ6U.js} +2 -2
- package/dist/{chunk-BWDQZSAB.mjs → chunk-WTSG7QXK.mjs} +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useControlledState
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WHYHLUXG.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/RichTextEditor.tsx
|
|
6
6
|
import { useRef, useState, useCallback, useEffect, useMemo } from "react";
|
|
@@ -37,18 +37,11 @@ var RichTextEditor = ({
|
|
|
37
37
|
}) => {
|
|
38
38
|
const editorRef = useRef(null);
|
|
39
39
|
const engineRef = useRef(null);
|
|
40
|
-
const [currentContent,
|
|
40
|
+
const [currentContent, setContent] = useControlledState(value, defaultValue, onChange);
|
|
41
|
+
const isControlled = value !== void 0;
|
|
41
42
|
const [activeFormats, setActiveFormats] = useState(/* @__PURE__ */ new Set());
|
|
42
43
|
const toolbarItems = toolbar ?? defaultToolbar;
|
|
43
44
|
const empty = isContentEmpty(currentContent);
|
|
44
|
-
const onChangeRef = useRef(onChange);
|
|
45
|
-
const setInternalValueRef = useRef(setInternalValue);
|
|
46
|
-
const isControlledRef = useRef(isControlled);
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
onChangeRef.current = onChange;
|
|
49
|
-
setInternalValueRef.current = setInternalValue;
|
|
50
|
-
isControlledRef.current = isControlled;
|
|
51
|
-
}, [onChange, setInternalValue, isControlled]);
|
|
52
45
|
useEffect(() => {
|
|
53
46
|
if (!editorRef.current) return;
|
|
54
47
|
const factory = engine ?? builtinRichTextEngine;
|
|
@@ -60,8 +53,7 @@ var RichTextEditor = ({
|
|
|
60
53
|
placeholder,
|
|
61
54
|
toolbar: toolbarItems,
|
|
62
55
|
notifyChange(html) {
|
|
63
|
-
|
|
64
|
-
onChangeRef.current?.(html);
|
|
56
|
+
setContent(html);
|
|
65
57
|
},
|
|
66
58
|
notifyActiveFormats(next) {
|
|
67
59
|
setActiveFormats(next);
|
|
@@ -4,23 +4,21 @@
|
|
|
4
4
|
var _chunkSTTQ5LXXjs = require('./chunk-STTQ5LXX.js');
|
|
5
5
|
|
|
6
6
|
// src/components/Menu.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
7
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
17
8
|
|
|
18
9
|
|
|
19
10
|
|
|
20
11
|
|
|
12
|
+
var _tigercatcore = require('@expcat/tigercat-core');
|
|
21
13
|
|
|
14
|
+
// src/components/Menu/context.ts
|
|
22
15
|
|
|
16
|
+
var MenuContext = _react.createContext.call(void 0, null);
|
|
17
|
+
function useMenuContext() {
|
|
18
|
+
return _react.useContext.call(void 0, MenuContext);
|
|
19
|
+
}
|
|
23
20
|
|
|
21
|
+
// src/components/Menu/state.ts
|
|
24
22
|
|
|
25
23
|
|
|
26
24
|
|
|
@@ -30,52 +28,31 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
|
30
28
|
|
|
31
29
|
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
theme = "light",
|
|
59
|
-
selectedKeys: controlledSelectedKeys,
|
|
60
|
-
defaultSelectedKeys = [],
|
|
61
|
-
openKeys: controlledOpenKeys,
|
|
62
|
-
defaultOpenKeys = [],
|
|
63
|
-
collapsed = false,
|
|
64
|
-
multiple = true,
|
|
65
|
-
inlineIndent = 24,
|
|
66
|
-
popupPortal = false,
|
|
67
|
-
className,
|
|
68
|
-
style,
|
|
69
|
-
onSelect,
|
|
70
|
-
onOpenChange,
|
|
71
|
-
onSearch,
|
|
72
|
-
searchable = false,
|
|
73
|
-
searchValue: controlledSearchValue,
|
|
74
|
-
defaultSearchValue = "",
|
|
75
|
-
searchPlaceholder = "Search menu",
|
|
76
|
-
emptyText = "No menu items found",
|
|
77
|
-
children
|
|
78
|
-
}) => {
|
|
31
|
+
function useMenuRootState(props) {
|
|
32
|
+
const {
|
|
33
|
+
items,
|
|
34
|
+
mode = "vertical",
|
|
35
|
+
theme = "light",
|
|
36
|
+
selectedKeys: controlledSelectedKeys,
|
|
37
|
+
defaultSelectedKeys = [],
|
|
38
|
+
openKeys: controlledOpenKeys,
|
|
39
|
+
defaultOpenKeys = [],
|
|
40
|
+
collapsed = false,
|
|
41
|
+
multiple = true,
|
|
42
|
+
inlineIndent = 24,
|
|
43
|
+
popupPortal = false,
|
|
44
|
+
className,
|
|
45
|
+
style,
|
|
46
|
+
onSelect,
|
|
47
|
+
onOpenChange,
|
|
48
|
+
onSearch,
|
|
49
|
+
searchable = false,
|
|
50
|
+
searchValue: controlledSearchValue,
|
|
51
|
+
defaultSearchValue = "",
|
|
52
|
+
searchPlaceholder = "Search menu",
|
|
53
|
+
emptyText = "No menu items found"
|
|
54
|
+
} = props;
|
|
55
|
+
const children = props.children;
|
|
79
56
|
const menuRef = _react.useRef.call(void 0, null);
|
|
80
57
|
const resolvedMode = collapsed && mode === "inline" ? "vertical" : mode;
|
|
81
58
|
const [internalSelectedKeys, setInternalSelectedKeys] = _react.useState.call(void 0, defaultSelectedKeys);
|
|
@@ -146,57 +123,41 @@ var Menu = ({
|
|
|
146
123
|
() => _tigercatcore.filterMenuItems.call(void 0, _nullishCoalesce(items, () => ( [])), searchValue),
|
|
147
124
|
[items, searchValue]
|
|
148
125
|
);
|
|
149
|
-
function renderDataItem(item) {
|
|
150
|
-
if (item.children && item.children.length > 0) {
|
|
151
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
152
|
-
SubMenu,
|
|
153
|
-
{
|
|
154
|
-
itemKey: item.key,
|
|
155
|
-
title: item.label,
|
|
156
|
-
icon: item.icon,
|
|
157
|
-
disabled: item.disabled,
|
|
158
|
-
children: item.children.map(renderDataItem)
|
|
159
|
-
},
|
|
160
|
-
item.key
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MenuItem, { itemKey: item.key, icon: item.icon, disabled: item.disabled, children: item.label }, item.key);
|
|
164
|
-
}
|
|
165
|
-
const dataChildren = filteredItems.map(renderDataItem);
|
|
166
|
-
const hasSlotChildren = _react2.default.Children.count(children) > 0;
|
|
167
|
-
const emptyChild = items && items.length > 0 && dataChildren.length === 0 && !hasSlotChildren ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { role: "none", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _tigercatcore.menuSearchEmptyClasses, children: emptyText }) }) : null;
|
|
168
126
|
_react.useEffect.call(void 0, () => {
|
|
169
127
|
if (menuRef.current) _tigercatcore.initRovingTabIndex.call(void 0, menuRef.current);
|
|
170
128
|
}, [resolvedMode, collapsed, selectedKeys, openKeys, filteredItems]);
|
|
171
|
-
return
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
129
|
+
return {
|
|
130
|
+
menuRef,
|
|
131
|
+
menuClasses,
|
|
132
|
+
style,
|
|
133
|
+
resolvedMode,
|
|
134
|
+
mode,
|
|
135
|
+
contextValue,
|
|
136
|
+
searchable,
|
|
137
|
+
searchValue,
|
|
138
|
+
searchPlaceholder,
|
|
139
|
+
emptyText,
|
|
140
|
+
handleSearchInput,
|
|
141
|
+
filteredItems,
|
|
142
|
+
items,
|
|
143
|
+
children
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// src/components/Menu/menu-item.tsx
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
200
161
|
var MenuItem = ({
|
|
201
162
|
itemKey,
|
|
202
163
|
disabled = false,
|
|
@@ -228,9 +189,7 @@ var MenuItem = ({
|
|
|
228
189
|
const current = event.currentTarget;
|
|
229
190
|
const rootMenu = current.closest('ul[role="menu"]');
|
|
230
191
|
const isRoot = _optionalChain([rootMenu, 'optionalAccess', _4 => _4.dataset, 'access', _5 => _5.tigerMenuRoot]) === "true";
|
|
231
|
-
const
|
|
232
|
-
const nextKey = isHorizontalRoot ? "ArrowRight" : "ArrowDown";
|
|
233
|
-
const prevKey = isHorizontalRoot ? "ArrowLeft" : "ArrowUp";
|
|
192
|
+
const { nextKey, prevKey } = _tigercatcore.getMenuNavigationKeys.call(void 0, menuContext.mode, isRoot);
|
|
234
193
|
if (event.key === nextKey) {
|
|
235
194
|
event.preventDefault();
|
|
236
195
|
_tigercatcore.moveFocusInMenu.call(void 0, current, 1);
|
|
@@ -299,6 +258,51 @@ var MenuItem = ({
|
|
|
299
258
|
}
|
|
300
259
|
) });
|
|
301
260
|
};
|
|
261
|
+
|
|
262
|
+
// src/components/Menu/submenu.tsx
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
// src/components/Menu/icons.tsx
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
var ExpandIcon = ({ expanded }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
291
|
+
"svg",
|
|
292
|
+
{
|
|
293
|
+
className: _tigercatcore.getSubMenuExpandIconClasses.call(void 0, expanded),
|
|
294
|
+
width: "12",
|
|
295
|
+
height: "12",
|
|
296
|
+
viewBox: "0 0 12 12",
|
|
297
|
+
fill: "currentColor",
|
|
298
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M6 9L1.5 4.5L2.205 3.795L6 7.59L9.795 3.795L10.5 4.5L6 9Z" })
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
// src/components/Menu/menu-item-group.tsx
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
302
306
|
function isComponentNamed(elementType, name) {
|
|
303
307
|
if (typeof elementType !== "function" && typeof elementType !== "object") return false;
|
|
304
308
|
const maybeFn = elementType;
|
|
@@ -329,17 +333,9 @@ var MenuItemGroup = ({
|
|
|
329
333
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { role: "group", className, children: enhancedChildren })
|
|
330
334
|
] });
|
|
331
335
|
};
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
className: _tigercatcore.getSubMenuExpandIconClasses.call(void 0, expanded),
|
|
336
|
-
width: "12",
|
|
337
|
-
height: "12",
|
|
338
|
-
viewBox: "0 0 12 12",
|
|
339
|
-
fill: "currentColor",
|
|
340
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M6 9L1.5 4.5L2.205 3.795L6 7.59L9.795 3.795L10.5 4.5L6 9Z" })
|
|
341
|
-
}
|
|
342
|
-
);
|
|
336
|
+
|
|
337
|
+
// src/components/Menu/submenu.tsx
|
|
338
|
+
|
|
343
339
|
var SubMenu = ({
|
|
344
340
|
itemKey,
|
|
345
341
|
title = "",
|
|
@@ -471,9 +467,7 @@ var SubMenu = ({
|
|
|
471
467
|
const current = event.currentTarget;
|
|
472
468
|
const rootMenu = current.closest('ul[role="menu"]');
|
|
473
469
|
const isRoot = _optionalChain([rootMenu, 'optionalAccess', _14 => _14.dataset, 'access', _15 => _15.tigerMenuRoot]) === "true";
|
|
474
|
-
const
|
|
475
|
-
const nextKey = isHorizontalRoot ? "ArrowRight" : "ArrowDown";
|
|
476
|
-
const prevKey = isHorizontalRoot ? "ArrowLeft" : "ArrowUp";
|
|
470
|
+
const { nextKey, prevKey } = _tigercatcore.getMenuNavigationKeys.call(void 0, menuContext.mode, isRoot);
|
|
477
471
|
if (event.key === nextKey) {
|
|
478
472
|
event.preventDefault();
|
|
479
473
|
_tigercatcore.moveFocusInMenu.call(void 0, current, 1);
|
|
@@ -662,10 +656,63 @@ var SubMenu = ({
|
|
|
662
656
|
);
|
|
663
657
|
};
|
|
664
658
|
|
|
659
|
+
// src/components/Menu.tsx
|
|
660
|
+
|
|
661
|
+
var Menu = (props) => {
|
|
662
|
+
const ctx = useMenuRootState(props);
|
|
663
|
+
function renderDataItem(item) {
|
|
664
|
+
if (item.children && item.children.length > 0) {
|
|
665
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
666
|
+
SubMenu,
|
|
667
|
+
{
|
|
668
|
+
itemKey: item.key,
|
|
669
|
+
title: item.label,
|
|
670
|
+
icon: item.icon,
|
|
671
|
+
disabled: item.disabled,
|
|
672
|
+
children: item.children.map(renderDataItem)
|
|
673
|
+
},
|
|
674
|
+
item.key
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MenuItem, { itemKey: item.key, icon: item.icon, disabled: item.disabled, children: item.label }, item.key);
|
|
678
|
+
}
|
|
679
|
+
const dataChildren = ctx.filteredItems.map(renderDataItem);
|
|
680
|
+
const hasSlotChildren = _react2.default.Children.count(ctx.children) > 0;
|
|
681
|
+
const emptyChild = ctx.items && ctx.items.length > 0 && dataChildren.length === 0 && !hasSlotChildren ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { role: "none", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _tigercatcore.menuSearchEmptyClasses, children: ctx.emptyText }) }) : null;
|
|
682
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MenuContext.Provider, { value: ctx.contextValue, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
683
|
+
"ul",
|
|
684
|
+
{
|
|
685
|
+
ref: ctx.menuRef,
|
|
686
|
+
className: ctx.menuClasses,
|
|
687
|
+
style: ctx.style,
|
|
688
|
+
role: "menu",
|
|
689
|
+
"data-tiger-menu-root": "true",
|
|
690
|
+
"data-tiger-menu-mode": ctx.resolvedMode,
|
|
691
|
+
"data-tiger-menu-requested-mode": ctx.mode,
|
|
692
|
+
children: [
|
|
693
|
+
ctx.searchable && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { role: "none", className: _tigercatcore.menuSearchFieldClasses, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
694
|
+
"input",
|
|
695
|
+
{
|
|
696
|
+
type: "search",
|
|
697
|
+
value: ctx.searchValue,
|
|
698
|
+
placeholder: ctx.searchPlaceholder,
|
|
699
|
+
"aria-label": ctx.searchPlaceholder,
|
|
700
|
+
className: _tigercatcore.menuSearchInputClasses,
|
|
701
|
+
onChange: ctx.handleSearchInput
|
|
702
|
+
}
|
|
703
|
+
) }),
|
|
704
|
+
dataChildren,
|
|
705
|
+
ctx.children,
|
|
706
|
+
emptyChild
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
) });
|
|
710
|
+
};
|
|
711
|
+
|
|
665
712
|
|
|
666
713
|
|
|
667
714
|
|
|
668
715
|
|
|
669
716
|
|
|
670
717
|
|
|
671
|
-
exports.useMenuContext = useMenuContext; exports.
|
|
718
|
+
exports.useMenuContext = useMenuContext; exports.MenuItem = MenuItem; exports.MenuItemGroup = MenuItemGroup; exports.SubMenu = SubMenu; exports.Menu = Menu;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSQONS5PHjs = require('./chunk-SQONS5PH.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkL3WPA2RPjs = require('./chunk-L3WPA2RP.js');
|
|
4
7
|
|
|
5
8
|
// src/components/Checkbox.tsx
|
|
6
9
|
var _react = require('react');
|
|
@@ -22,12 +25,11 @@ var Checkbox = ({
|
|
|
22
25
|
className,
|
|
23
26
|
...props
|
|
24
27
|
}) => {
|
|
25
|
-
const groupContext =
|
|
26
|
-
const [
|
|
27
|
-
const isControlled = controlledChecked !== void 0;
|
|
28
|
+
const groupContext = _chunkSQONS5PHjs.useCheckboxGroup.call(void 0, );
|
|
29
|
+
const [checkedState, setChecked] = _chunkL3WPA2RPjs.useControlledState.call(void 0, controlledChecked, defaultChecked, onChange);
|
|
28
30
|
const effectiveSize = propSize || _optionalChain([groupContext, 'optionalAccess', _ => _.size]) || "md";
|
|
29
31
|
const effectiveDisabled = propDisabled || _optionalChain([groupContext, 'optionalAccess', _2 => _2.disabled]) || false;
|
|
30
|
-
const checked = groupContext && value !== void 0 ? groupContext.value.includes(value) :
|
|
32
|
+
const checked = groupContext && value !== void 0 ? groupContext.value.includes(value) : checkedState;
|
|
31
33
|
const checkboxRef = _react.useRef.call(void 0, null);
|
|
32
34
|
_react.useEffect.call(void 0, () => {
|
|
33
35
|
if (checkboxRef.current) {
|
|
@@ -40,10 +42,7 @@ var Checkbox = ({
|
|
|
40
42
|
if (groupContext && value !== void 0) {
|
|
41
43
|
groupContext.updateValue(value, newValue);
|
|
42
44
|
} else {
|
|
43
|
-
|
|
44
|
-
setInternalChecked(newValue);
|
|
45
|
-
}
|
|
46
|
-
_optionalChain([onChange, 'optionalCall', _3 => _3(newValue, event)]);
|
|
45
|
+
setChecked(newValue, event);
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
48
|
const checkboxClasses = _tigercatcore.getCheckboxClasses.call(void 0, effectiveSize, effectiveDisabled);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkL3WPA2RPjs = require('./chunk-L3WPA2RP.js');
|
|
4
|
+
|
|
5
|
+
// src/components/Input.tsx
|
|
2
6
|
var _react = require('react');
|
|
3
7
|
|
|
4
8
|
|
|
@@ -51,7 +55,7 @@ var Input = ({
|
|
|
51
55
|
const inputRef = _react.useRef.call(void 0, null);
|
|
52
56
|
const reactId = _react.useId.call(void 0, );
|
|
53
57
|
const errorMsgId = `tiger-input-error-${reactId}`;
|
|
54
|
-
const [
|
|
58
|
+
const [inputValue, setInputValue] = _chunkL3WPA2RPjs.useControlledState.call(void 0, value, _nullishCoalesce(defaultValue, () => ( "")));
|
|
55
59
|
const [passwordVisible, setPasswordVisible] = _react.useState.call(void 0, false);
|
|
56
60
|
_react.useEffect.call(void 0, () => {
|
|
57
61
|
if (status === "error" && wrapperRef.current) {
|
|
@@ -64,25 +68,17 @@ var Input = ({
|
|
|
64
68
|
const handleAnimationEnd = _react.useCallback.call(void 0, () => {
|
|
65
69
|
_optionalChain([wrapperRef, 'access', _ => _.current, 'optionalAccess', _2 => _2.classList, 'access', _3 => _3.remove, 'call', _4 => _4(_tigercatcore.SHAKE_CLASS)]);
|
|
66
70
|
}, []);
|
|
67
|
-
const isControlled = value !== void 0;
|
|
68
|
-
const inputValue = isControlled ? value : internalValue;
|
|
69
71
|
const currentValStr = String(inputValue);
|
|
70
72
|
const handleInput = (event) => {
|
|
71
|
-
|
|
72
|
-
setInternalValue(_tigercatcore.parseInputValue.call(void 0, event.currentTarget, type));
|
|
73
|
-
}
|
|
73
|
+
setInputValue(_tigercatcore.parseInputValue.call(void 0, event.currentTarget, type));
|
|
74
74
|
_optionalChain([onInput, 'optionalCall', _5 => _5(event)]);
|
|
75
75
|
};
|
|
76
76
|
const handleChange = (event) => {
|
|
77
|
-
|
|
78
|
-
setInternalValue(_tigercatcore.parseInputValue.call(void 0, event.currentTarget, type));
|
|
79
|
-
}
|
|
77
|
+
setInputValue(_tigercatcore.parseInputValue.call(void 0, event.currentTarget, type));
|
|
80
78
|
_optionalChain([onChange, 'optionalCall', _6 => _6(event)]);
|
|
81
79
|
};
|
|
82
80
|
const handleClear = () => {
|
|
83
|
-
|
|
84
|
-
setInternalValue("");
|
|
85
|
-
}
|
|
81
|
+
setInputValue("");
|
|
86
82
|
_optionalChain([onClear, 'optionalCall', _7 => _7()]);
|
|
87
83
|
_optionalChain([inputRef, 'access', _8 => _8.current, 'optionalAccess', _9 => _9.focus, 'call', _10 => _10()]);
|
|
88
84
|
};
|