@fangxinyan/lumina 0.7.0 → 0.9.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/Alert.cjs +5 -5
- package/dist/Alert.js +4 -4
- package/dist/AppShell.cjs +8 -8
- package/dist/AppShell.js +4 -4
- package/dist/AutoComplete.cjs +7 -7
- package/dist/AutoComplete.js +6 -6
- package/dist/Avatar.cjs +4 -4
- package/dist/Avatar.js +3 -3
- package/dist/Badge.cjs +4 -4
- package/dist/Badge.js +3 -3
- package/dist/Button.cjs +6 -6
- package/dist/Button.js +4 -4
- package/dist/Calendar.cjs +5 -5
- package/dist/Calendar.js +4 -4
- package/dist/Card.cjs +7 -7
- package/dist/Card.js +6 -6
- package/dist/Cascader.cjs +7 -7
- package/dist/Cascader.js +6 -6
- package/dist/{Checkbox-IHFML4FV.css → Checkbox-YQ43GFUI.css} +7 -0
- package/dist/Checkbox.cjs +5 -5
- package/dist/Checkbox.d.cts +2 -0
- package/dist/Checkbox.d.ts +2 -0
- package/dist/Checkbox.js +4 -4
- package/dist/Collapse.cjs +5 -5
- package/dist/Collapse.js +4 -4
- package/dist/ColorPicker.cjs +7 -7
- package/dist/ColorPicker.js +6 -6
- package/dist/CommandPalette.cjs +7 -7
- package/dist/CommandPalette.js +6 -6
- package/dist/ContextMenu.cjs +4 -4
- package/dist/ContextMenu.js +3 -3
- package/dist/DatePicker.cjs +9 -9
- package/dist/DatePicker.js +8 -8
- package/dist/DateTimePicker.cjs +9 -9
- package/dist/DateTimePicker.js +8 -8
- package/dist/Divider.cjs +4 -4
- package/dist/Divider.js +3 -3
- package/dist/Drawer.cjs +5 -5
- package/dist/Drawer.js +4 -4
- package/dist/Empty.cjs +4 -4
- package/dist/Empty.js +3 -3
- package/dist/Form.cjs +6 -6
- package/dist/Form.js +3 -3
- package/dist/Icon.cjs +51 -51
- package/dist/Icon.js +3 -3
- package/dist/Image.cjs +9 -9
- package/dist/Image.js +5 -5
- package/dist/Input.cjs +7 -7
- package/dist/Input.js +5 -5
- package/dist/InputNumber.cjs +7 -7
- package/dist/InputNumber.js +6 -6
- package/dist/List.cjs +4 -4
- package/dist/List.js +3 -3
- package/dist/Message.cjs +8 -8
- package/dist/Message.js +4 -4
- package/dist/Modal.cjs +6 -6
- package/dist/Modal.js +5 -5
- package/dist/Pagination.cjs +9 -9
- package/dist/Pagination.js +8 -8
- package/dist/Popover.cjs +4 -4
- package/dist/Popover.js +3 -3
- package/dist/Progress.cjs +4 -4
- package/dist/Progress.js +3 -3
- package/dist/Radio.cjs +5 -5
- package/dist/Radio.js +3 -3
- package/dist/{Select-TU37MAHZ.css → Select-QPBB73KA.css} +34 -5
- package/dist/Select.cjs +8 -8
- package/dist/Select.d.cts +16 -1
- package/dist/Select.d.ts +16 -1
- package/dist/Select.js +7 -7
- package/dist/Skeleton.cjs +4 -4
- package/dist/Skeleton.js +3 -3
- package/dist/Slider.cjs +4 -4
- package/dist/Slider.js +3 -3
- package/dist/Spin.cjs +4 -4
- package/dist/Spin.js +3 -3
- package/dist/Splitter.cjs +4 -4
- package/dist/Splitter.d.cts +10 -0
- package/dist/Splitter.d.ts +10 -0
- package/dist/Splitter.js +3 -3
- package/dist/StatusBar.cjs +5 -5
- package/dist/StatusBar.js +3 -3
- package/dist/Surface.cjs +5 -5
- package/dist/Surface.js +3 -3
- package/dist/{Switch-TATU3LPB.css → Switch-3JV3LCPX.css} +3 -0
- package/dist/Switch.cjs +4 -4
- package/dist/Switch.d.cts +2 -0
- package/dist/Switch.d.ts +2 -0
- package/dist/Switch.js +3 -3
- package/dist/{Table-W4HPZ7MZ.css → Table-KB6EEBDJ.css} +28 -1
- package/dist/Table.cjs +12 -12
- package/dist/Table.d.cts +7 -1
- package/dist/Table.d.ts +7 -1
- package/dist/Table.js +11 -11
- package/dist/TablePro.cjs +13 -13
- package/dist/TablePro.js +12 -12
- package/dist/{Tabs-A3IG6UZ6.css → Tabs-FB2AMBWL.css} +14 -0
- package/dist/Tabs.cjs +4 -4
- package/dist/Tabs.d.cts +6 -0
- package/dist/Tabs.d.ts +6 -0
- package/dist/Tabs.js +3 -3
- package/dist/Tag.cjs +5 -5
- package/dist/Tag.js +4 -4
- package/dist/Textarea.cjs +6 -6
- package/dist/Textarea.js +4 -4
- package/dist/Theme.cjs +19 -19
- package/dist/Theme.js +1 -1
- package/dist/ThemePanel.cjs +14 -14
- package/dist/ThemePanel.js +11 -11
- package/dist/TimePicker.cjs +8 -8
- package/dist/TimePicker.js +7 -7
- package/dist/Timeline.cjs +5 -5
- package/dist/Timeline.js +4 -4
- package/dist/Tooltip.cjs +4 -4
- package/dist/Tooltip.js +3 -3
- package/dist/Typography.cjs +9 -9
- package/dist/Typography.js +4 -4
- package/dist/{chunk-LQMOYVQF.js → chunk-2BM65ITV.js} +2 -2
- package/dist/{chunk-UQI4R32R.js → chunk-2COQYOVG.js} +4 -4
- package/dist/{chunk-WMZV7PNO.js → chunk-2NECDEAJ.js} +7 -3
- package/dist/{chunk-I4YPBAQ5.js → chunk-2NXLVPF4.js} +3 -3
- package/dist/{chunk-7QAVPVMW.js → chunk-2V6RQQRI.js} +4 -4
- package/dist/{chunk-ZEYK37VW.cjs → chunk-2XDLXAZT.cjs} +6 -6
- package/dist/{chunk-TYZ6L7E6.cjs → chunk-33YRXHVK.cjs} +6 -6
- package/dist/{chunk-3EMWDDWK.cjs → chunk-3D5RJA7R.cjs} +16 -16
- package/dist/{chunk-VX6MZO4K.cjs → chunk-3J7HOTD6.cjs} +6 -6
- package/dist/{chunk-ARUN2DMD.js → chunk-427CDZDU.js} +2 -2
- package/dist/chunk-4JANYBXO.js +100 -0
- package/dist/{chunk-ZHVR4YPB.cjs → chunk-4LYJRFD2.cjs} +3 -3
- package/dist/{chunk-LG62MPMU.cjs → chunk-4MZW2KBN.cjs} +11 -11
- package/dist/{chunk-F7WUCOBP.cjs → chunk-4ZSFMWLF.cjs} +24 -24
- package/dist/{chunk-FMUHLIHB.cjs → chunk-53I3PWRH.cjs} +3 -3
- package/dist/{chunk-JHM7MN3G.js → chunk-563SQXH7.js} +3 -3
- package/dist/{chunk-DRDDQCDD.js → chunk-5HLNFDV4.js} +1 -1
- package/dist/{chunk-2HIN5NFM.js → chunk-5VLANZAJ.js} +3 -3
- package/dist/{chunk-ALAG4ZUH.js → chunk-6OVWY63D.js} +2 -2
- package/dist/{chunk-434Y2JVW.cjs → chunk-6WEXRX7K.cjs} +7 -7
- package/dist/{chunk-MCDW3VKZ.cjs → chunk-76CTKBXD.cjs} +3 -3
- package/dist/{chunk-VA3JWOAB.cjs → chunk-7IWUBBYX.cjs} +15 -15
- package/dist/{chunk-ENFLP7SN.cjs → chunk-7KA5D37Z.cjs} +40 -30
- package/dist/{chunk-Y2MT6PI6.js → chunk-7NKNQRK6.js} +4 -4
- package/dist/{chunk-EAUB6FEN.js → chunk-7PUYEPLK.js} +4 -4
- package/dist/{chunk-7VLAHOA7.cjs → chunk-7ZMUCSCJ.cjs} +8 -8
- package/dist/{chunk-RPO7657K.js → chunk-A34P5CU7.js} +3 -3
- package/dist/{chunk-FKCPSVC4.cjs → chunk-ADPXWCTK.cjs} +9 -9
- package/dist/{chunk-QDCPVI3S.cjs → chunk-AE5XWZ24.cjs} +14 -14
- package/dist/{chunk-XZXY3XCL.cjs → chunk-AEY76EAH.cjs} +55 -38
- package/dist/{chunk-3EHJ5QI3.js → chunk-AL2PYVVP.js} +99 -49
- package/dist/{chunk-PIJV2FHO.cjs → chunk-AQN3PD24.cjs} +30 -30
- package/dist/{chunk-RMGFRAZ2.cjs → chunk-AR3MT2ZT.cjs} +10 -10
- package/dist/{chunk-3F424R5P.js → chunk-AXZNZ2IH.js} +3 -3
- package/dist/{chunk-HVPUGYBY.js → chunk-BDPJ2BPN.js} +4 -4
- package/dist/{chunk-HQFKXTX6.js → chunk-BOBT7JUB.js} +2 -2
- package/dist/{chunk-O6G3F5L4.js → chunk-CFKAKB2B.js} +5 -5
- package/dist/{chunk-U5YYOOLC.cjs → chunk-CLJLBFNU.cjs} +4 -4
- package/dist/{chunk-HYHBCHFM.cjs → chunk-CNV7R2OZ.cjs} +7 -7
- package/dist/{chunk-ULTDRMGN.js → chunk-CPVUDSIY.js} +6 -6
- package/dist/{chunk-QDY56GGO.js → chunk-D2N7OXMK.js} +2 -2
- package/dist/{chunk-LJVQQEME.js → chunk-DQMG4XPX.js} +6 -6
- package/dist/{chunk-STQDKMS5.cjs → chunk-GFGMGJ5A.cjs} +13 -13
- package/dist/{chunk-BKW5PXEO.js → chunk-GMFOY7RD.js} +5 -5
- package/dist/{chunk-GTFP7HA3.cjs → chunk-GW77XQEF.cjs} +15 -15
- package/dist/{chunk-DU2DSERH.js → chunk-HAIWLYLR.js} +3 -3
- package/dist/{chunk-VVRXNGYL.cjs → chunk-HJGPUE67.cjs} +9 -9
- package/dist/{chunk-JINKQT6H.cjs → chunk-HMN65CDW.cjs} +10 -6
- package/dist/{chunk-MUZQWIMR.cjs → chunk-I2YL5XE4.cjs} +18 -18
- package/dist/{chunk-EE5KXDRK.cjs → chunk-I4GJZLJU.cjs} +6 -6
- package/dist/{chunk-QDMFXRPI.js → chunk-INCTDROH.js} +2 -2
- package/dist/{chunk-2BIOTRQC.js → chunk-ISK2RW7F.js} +2 -2
- package/dist/{chunk-OLYSSZHP.js → chunk-IU6PLLEL.js} +10 -10
- package/dist/{chunk-LOWTSOWT.js → chunk-J7D5CQDK.js} +34 -7
- package/dist/{chunk-EA3NZBCZ.js → chunk-JMYUO7V7.js} +20 -10
- package/dist/{chunk-D7YSY5RZ.cjs → chunk-K3KHQ77L.cjs} +111 -61
- package/dist/{chunk-AURYNA6G.js → chunk-KFCWDFBW.js} +2 -2
- package/dist/{chunk-KCDOC3HS.cjs → chunk-KPBZKHCS.cjs} +8 -6
- package/dist/{chunk-PQOBBASY.js → chunk-L2NEYHYG.js} +2 -2
- package/dist/{chunk-VQEMMJHC.js → chunk-LACXN5CI.js} +2 -2
- package/dist/{chunk-T4RR6NVU.cjs → chunk-M3JYP3V4.cjs} +7 -7
- package/dist/{chunk-FY73C7JK.js → chunk-MEBAE7DB.js} +4 -4
- package/dist/{chunk-5AXNUX3J.js → chunk-MFJHI472.js} +2 -2
- package/dist/{chunk-4SKHRPDH.js → chunk-MKVONDTB.js} +6 -6
- package/dist/{chunk-U7VEPMCX.cjs → chunk-MV56FOAD.cjs} +35 -8
- package/dist/{chunk-LEDESWNL.js → chunk-O6PRE6MZ.js} +5 -3
- package/dist/{chunk-EUTK2ZRJ.cjs → chunk-OBNGHJ3N.cjs} +3 -3
- package/dist/{chunk-62VV5COT.js → chunk-OGMI3TO5.js} +3 -3
- package/dist/{chunk-YAYSXZZZ.cjs → chunk-PYCAGTO7.cjs} +3 -3
- package/dist/{chunk-6DKPJ5LV.cjs → chunk-QI6BJJXM.cjs} +6 -6
- package/dist/{chunk-Y22PTPA7.js → chunk-QK3E6FAQ.js} +5 -5
- package/dist/{chunk-KATJAJUU.js → chunk-QSLXUNLM.js} +6 -4
- package/dist/{chunk-E66PSVBU.cjs → chunk-QTMI4ZA4.cjs} +5 -5
- package/dist/{chunk-LDX6Q6RK.cjs → chunk-RA5BULQ3.cjs} +3 -3
- package/dist/{chunk-BIPOXOHP.cjs → chunk-RWM44VCZ.cjs} +9 -9
- package/dist/{chunk-JKUXA3U6.cjs → chunk-RXITGNPX.cjs} +5 -5
- package/dist/{chunk-YPMQC5HX.js → chunk-RYF5ADJW.js} +3 -3
- package/dist/{chunk-SXLRWYQQ.js → chunk-SXT672KF.js} +5 -5
- package/dist/{chunk-U3SG2YT2.js → chunk-TALNKJQ2.js} +3 -3
- package/dist/{chunk-3IZZBM56.js → chunk-TNQJA5JF.js} +3 -3
- package/dist/{chunk-Q565GDVK.cjs → chunk-TPFY5SKB.cjs} +9 -9
- package/dist/{chunk-RERMZNF3.cjs → chunk-TTRU4TLQ.cjs} +3 -3
- package/dist/{chunk-UE4HFGJ6.js → chunk-TUXF2G2O.js} +4 -4
- package/dist/{chunk-3DKFS44V.js → chunk-TY5LOU3A.js} +3 -3
- package/dist/{chunk-6RQJXSWN.js → chunk-U7V2FOIM.js} +3 -3
- package/dist/{chunk-BJDQVVCG.js → chunk-UCE53RYR.js} +5 -5
- package/dist/{chunk-WROF2PVG.cjs → chunk-UQF7E32V.cjs} +6 -4
- package/dist/{chunk-NRJXZPZR.cjs → chunk-V6BLBIY6.cjs} +17 -17
- package/dist/{chunk-2AUXUZ3Z.cjs → chunk-VDVKY2IX.cjs} +4 -4
- package/dist/{chunk-YKHIIC7M.js → chunk-VLQ6XIAL.js} +2 -2
- package/dist/{chunk-GFKWSDD6.cjs → chunk-VNP5WB6M.cjs} +6 -6
- package/dist/{chunk-56I6ZKGU.cjs → chunk-VTN6YLRJ.cjs} +11 -11
- package/dist/{chunk-YBGMTQ2V.js → chunk-XFJTJVWD.js} +3 -3
- package/dist/{chunk-77HU7JWK.cjs → chunk-XHKSUKKL.cjs} +6 -6
- package/dist/{chunk-K5HGHOG7.js → chunk-Y3WFWA52.js} +2 -2
- package/dist/{chunk-QNQSNVCU.cjs → chunk-YU4LBDBD.cjs} +6 -6
- package/dist/{chunk-QYPA77OI.cjs → chunk-Z6AG7O4B.cjs} +3 -3
- package/dist/{chunk-AUO2YYHB.js → chunk-Z7GKR4LL.js} +4 -4
- package/dist/{chunk-ZYIE3BH7.cjs → chunk-ZBRFGD3I.cjs} +3 -3
- package/dist/{chunk-5CZA33BK.cjs → chunk-ZCAYS4KR.cjs} +8 -8
- package/dist/{chunk-Q5HLC56A.cjs → chunk-ZGZLEJKA.cjs} +4 -4
- package/dist/{chunk-YUJ7Z6N2.cjs → chunk-ZT7ZWAF2.cjs} +13 -13
- package/dist/index.cjs +189 -189
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +52 -52
- package/dist/styles.css +100 -20
- package/dist/{tokens-CEJVVA3G.css → tokens-223RYVVS.css} +14 -14
- package/dist/tokens.css +14 -14
- package/docs/llms/checkbox.md +22 -5
- package/docs/llms/drawer.md +8 -1
- package/docs/llms/select.md +50 -0
- package/docs/llms/splitter.md +12 -1
- package/docs/llms/switch.md +22 -5
- package/docs/llms/tablepro.md +23 -1
- package/docs/llms/tabs.md +21 -0
- package/docs/llms.md +1 -1
- package/package.json +1 -1
- package/dist/chunk-RAK6CENJ.js +0 -83
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVNP5WB6M_cjs = require('./chunk-VNP5WB6M.cjs');
|
|
4
4
|
var chunkFJB3243S_cjs = require('./chunk-FJB3243S.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkGFGMGJ5A_cjs = require('./chunk-GFGMGJ5A.cjs');
|
|
6
6
|
var chunkHSDMJUB6_cjs = require('./chunk-HSDMJUB6.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
require('./tokens-
|
|
7
|
+
var chunkVDVKY2IX_cjs = require('./chunk-VDVKY2IX.cjs');
|
|
8
|
+
var chunkV6BLBIY6_cjs = require('./chunk-V6BLBIY6.cjs');
|
|
9
|
+
var chunkI4GJZLJU_cjs = require('./chunk-I4GJZLJU.cjs');
|
|
10
|
+
require('./tokens-223RYVVS.css');
|
|
11
11
|
require('./shared-NJHRNLRH.css');
|
|
12
|
-
require('./Select-
|
|
12
|
+
require('./Select-QPBB73KA.css');
|
|
13
13
|
var React = require('react');
|
|
14
14
|
var reactDom = require('react-dom');
|
|
15
15
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -36,6 +36,15 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
36
36
|
|
|
37
37
|
var isGroup = (it) => Array.isArray(it.options);
|
|
38
38
|
var flatten = (items) => items.flatMap((it) => isGroup(it) ? it.options : [it]);
|
|
39
|
+
var prioritizePinnedGroups = (items) => {
|
|
40
|
+
const pinnedGroups = [];
|
|
41
|
+
const remainingItems = [];
|
|
42
|
+
items.forEach((item) => {
|
|
43
|
+
if (isGroup(item) && item.pinned) pinnedGroups.push(item);
|
|
44
|
+
else remainingItems.push(item);
|
|
45
|
+
});
|
|
46
|
+
return pinnedGroups.length > 0 ? [...pinnedGroups, ...remainingItems] : items;
|
|
47
|
+
};
|
|
39
48
|
var defaultFilter = (input, opt, optionFilterProp) => {
|
|
40
49
|
const q = input.toLowerCase();
|
|
41
50
|
const propValue = optionFilterProp ? opt[optionFilterProp] : void 0;
|
|
@@ -65,9 +74,11 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
65
74
|
loading,
|
|
66
75
|
emptyContent,
|
|
67
76
|
optionRender,
|
|
77
|
+
optionExtraRender,
|
|
68
78
|
selectedRender,
|
|
69
79
|
listHeight = 260,
|
|
70
80
|
popupStyle,
|
|
81
|
+
getOptionDisabled,
|
|
71
82
|
open: openProp,
|
|
72
83
|
defaultOpen,
|
|
73
84
|
onOpenChange,
|
|
@@ -89,7 +100,8 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
89
100
|
defaultValue: _defaultValue,
|
|
90
101
|
onChange: _selectionChange,
|
|
91
102
|
onClear: _onClear,
|
|
92
|
-
maxTagCount
|
|
103
|
+
maxTagCount,
|
|
104
|
+
maxCount,
|
|
93
105
|
...rest
|
|
94
106
|
} = props;
|
|
95
107
|
const isMulti = multiple === true;
|
|
@@ -108,8 +120,8 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
108
120
|
const [query, setQuery] = React__namespace.useState("");
|
|
109
121
|
const [activeIdx, setActiveIdx] = React__namespace.useState(-1);
|
|
110
122
|
const searchRef = React__namespace.useRef(null);
|
|
111
|
-
const portalContainer =
|
|
112
|
-
const portalTheme =
|
|
123
|
+
const portalContainer = chunkI4GJZLJU_cjs.usePortalContainer();
|
|
124
|
+
const portalTheme = chunkV6BLBIY6_cjs.useComponentPortalTheme([
|
|
113
125
|
"Select",
|
|
114
126
|
"Pagination",
|
|
115
127
|
"Table",
|
|
@@ -163,6 +175,15 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
163
175
|
const singleValue = singleControlled ? props.value : innerSingle;
|
|
164
176
|
const controlledMultiValue = props.value;
|
|
165
177
|
const multiValue = multiControlled ? Array.isArray(controlledMultiValue) ? controlledMultiValue : [] : innerMulti;
|
|
178
|
+
const selectedValues = React__namespace.useMemo(
|
|
179
|
+
() => isMulti ? multiValue : singleValue !== void 0 ? [singleValue] : [],
|
|
180
|
+
[isMulti, multiValue, singleValue]
|
|
181
|
+
);
|
|
182
|
+
const selectionLimit = maxCount !== void 0 && Number.isFinite(maxCount) ? Math.max(0, Math.floor(maxCount)) : void 0;
|
|
183
|
+
const isOptionDisabled = React__namespace.useCallback((option) => {
|
|
184
|
+
const selected = selectedValues.includes(option.value);
|
|
185
|
+
return !!option.disabled || !!getOptionDisabled?.(option, selectedValues) || isMulti && !selected && selectionLimit !== void 0 && selectedValues.length >= selectionLimit;
|
|
186
|
+
}, [getOptionDisabled, isMulti, selectedValues, selectionLimit]);
|
|
166
187
|
React__namespace.useEffect(() => {
|
|
167
188
|
if (!open) return;
|
|
168
189
|
const h = (e) => {
|
|
@@ -180,7 +201,11 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
180
201
|
}
|
|
181
202
|
if (!open) setActiveIdx(-1);
|
|
182
203
|
}, [open, mergedSearchable]);
|
|
183
|
-
const
|
|
204
|
+
const orderedItems = React__namespace.useMemo(
|
|
205
|
+
() => prioritizePinnedGroups(options),
|
|
206
|
+
[options]
|
|
207
|
+
);
|
|
208
|
+
const allFlat = React__namespace.useMemo(() => flatten(orderedItems), [orderedItems]);
|
|
184
209
|
const filteredFlat = React__namespace.useMemo(() => {
|
|
185
210
|
if (!query.trim()) return allFlat;
|
|
186
211
|
if (filterOption === false) return allFlat;
|
|
@@ -188,31 +213,33 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
188
213
|
return allFlat.filter((o) => f(query, o));
|
|
189
214
|
}, [allFlat, query, filterOption, optionFilterProp]);
|
|
190
215
|
const filteredItems = React__namespace.useMemo(() => {
|
|
191
|
-
if (!query.trim())
|
|
192
|
-
|
|
216
|
+
if (!query.trim()) {
|
|
217
|
+
return orderedItems.filter((item) => !isGroup(item) || item.options.length > 0);
|
|
218
|
+
}
|
|
219
|
+
return orderedItems.map((it) => {
|
|
193
220
|
if (!isGroup(it)) {
|
|
194
221
|
return filteredFlat.includes(it) ? it : null;
|
|
195
222
|
}
|
|
196
223
|
const kept = it.options.filter((o) => filteredFlat.includes(o));
|
|
197
|
-
return kept.length ? {
|
|
224
|
+
return kept.length ? { ...it, options: kept } : null;
|
|
198
225
|
}).filter((x) => x !== null);
|
|
199
|
-
}, [
|
|
226
|
+
}, [orderedItems, filteredFlat, query]);
|
|
200
227
|
React__namespace.useEffect(() => {
|
|
201
228
|
setActiveIdx((current) => {
|
|
202
|
-
if (current >= 0 && current < filteredFlat.length && !filteredFlat[current]
|
|
229
|
+
if (current >= 0 && current < filteredFlat.length && !isOptionDisabled(filteredFlat[current])) {
|
|
203
230
|
return current;
|
|
204
231
|
}
|
|
205
|
-
return filteredFlat.findIndex((option) => !option
|
|
232
|
+
return filteredFlat.findIndex((option) => !isOptionDisabled(option));
|
|
206
233
|
});
|
|
207
|
-
}, [filteredFlat]);
|
|
234
|
+
}, [filteredFlat, isOptionDisabled]);
|
|
208
235
|
const pickSingle = (opt) => {
|
|
209
|
-
if (disabled || opt
|
|
236
|
+
if (disabled || isOptionDisabled(opt)) return;
|
|
210
237
|
if (!singleControlled) setInnerSingle(opt.value);
|
|
211
238
|
props.onChange?.(opt.value);
|
|
212
239
|
setOpen(false);
|
|
213
240
|
};
|
|
214
241
|
const toggleMulti = (opt) => {
|
|
215
|
-
if (disabled || opt
|
|
242
|
+
if (disabled || isOptionDisabled(opt)) return;
|
|
216
243
|
const cur = multiValue ?? [];
|
|
217
244
|
const next = cur.includes(opt.value) ? cur.filter((v) => v !== opt.value) : [...cur, opt.value];
|
|
218
245
|
if (!multiControlled) setInnerMulti(next);
|
|
@@ -254,7 +281,7 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
254
281
|
setActiveIdx((i) => {
|
|
255
282
|
for (let step = 1; step <= filteredFlat.length; step++) {
|
|
256
283
|
const next = (Math.max(i, -1) + step) % filteredFlat.length;
|
|
257
|
-
if (!filteredFlat[next]
|
|
284
|
+
if (filteredFlat[next] && !isOptionDisabled(filteredFlat[next])) return next;
|
|
258
285
|
}
|
|
259
286
|
return i;
|
|
260
287
|
});
|
|
@@ -265,7 +292,7 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
265
292
|
setActiveIdx((i) => {
|
|
266
293
|
for (let step = 1; step <= filteredFlat.length; step++) {
|
|
267
294
|
const next = (i - step + filteredFlat.length) % filteredFlat.length;
|
|
268
|
-
if (!filteredFlat[next]
|
|
295
|
+
if (filteredFlat[next] && !isOptionDisabled(filteredFlat[next])) return next;
|
|
269
296
|
}
|
|
270
297
|
return i;
|
|
271
298
|
});
|
|
@@ -274,7 +301,7 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
274
301
|
if (e.key === "Enter") {
|
|
275
302
|
e.preventDefault();
|
|
276
303
|
const opt = filteredFlat[activeIdx];
|
|
277
|
-
if (opt && !opt
|
|
304
|
+
if (opt && !isOptionDisabled(opt)) {
|
|
278
305
|
if (isMulti) toggleMulti(opt);
|
|
279
306
|
else pickSingle(opt);
|
|
280
307
|
}
|
|
@@ -284,15 +311,15 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
284
311
|
const renderTrigger = () => {
|
|
285
312
|
if (isMulti) {
|
|
286
313
|
const selected = (multiValue ?? []).map((v) => allFlat.find((o) => o.value === v)).filter((o) => !!o);
|
|
287
|
-
const max =
|
|
314
|
+
const max = maxTagCount;
|
|
288
315
|
const shown = max != null ? selected.slice(0, max) : selected;
|
|
289
316
|
const overflow = selected.length - shown.length;
|
|
290
317
|
if (selected.length === 0) {
|
|
291
318
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "placeholder", children: placeholder });
|
|
292
319
|
}
|
|
293
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
320
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkV6BLBIY6_cjs.InternalComponentThemePart, { components: "Tag", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "select-tags", children: [
|
|
294
321
|
shown.map((o) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
295
|
-
|
|
322
|
+
chunkVNP5WB6M_cjs.Tag,
|
|
296
323
|
{
|
|
297
324
|
tone: "accent",
|
|
298
325
|
removable: !disabled,
|
|
@@ -307,7 +334,7 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
307
334
|
},
|
|
308
335
|
String(o.value)
|
|
309
336
|
)),
|
|
310
|
-
overflow > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
337
|
+
overflow > 0 && /* @__PURE__ */ jsxRuntime.jsxs(chunkVNP5WB6M_cjs.Tag, { tone: "neutral", children: [
|
|
311
338
|
"+",
|
|
312
339
|
overflow
|
|
313
340
|
] })
|
|
@@ -319,45 +346,73 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
319
346
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "select-value select-value-custom", children: selectedRender(current, { value: current.value, multiple: false }) });
|
|
320
347
|
}
|
|
321
348
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "select-value", children: [
|
|
322
|
-
|
|
349
|
+
chunkVDVKY2IX_cjs.renderIconSlot(current.icon, { size: 14, className: "select-icon" }),
|
|
323
350
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "select-value-label", children: current.label })
|
|
324
351
|
] });
|
|
325
352
|
};
|
|
326
353
|
const hasSelection = isMulti ? multiValue.length > 0 : singleValue != null;
|
|
327
354
|
const showClear = mergedClearable && hasSelection && !disabled;
|
|
328
355
|
let renderIdx = -1;
|
|
329
|
-
const renderOption = (o) => {
|
|
356
|
+
const renderOption = (o, groupPinned = false) => {
|
|
330
357
|
renderIdx += 1;
|
|
331
358
|
const idx = renderIdx;
|
|
332
359
|
const sel = isSelected(o.value);
|
|
333
360
|
const active = idx === activeIdx;
|
|
361
|
+
const optionDisabled = isOptionDisabled(o);
|
|
362
|
+
const renderInfo = {
|
|
363
|
+
index: idx,
|
|
364
|
+
selected: sel,
|
|
365
|
+
active,
|
|
366
|
+
disabled: optionDisabled,
|
|
367
|
+
groupPinned
|
|
368
|
+
};
|
|
369
|
+
const extraContent = optionExtraRender ? optionExtraRender(o, renderInfo) : o.extra;
|
|
370
|
+
const hasExtra = extraContent !== null && extraContent !== void 0 && extraContent !== false;
|
|
334
371
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
335
|
-
"
|
|
372
|
+
"div",
|
|
336
373
|
{
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
disabled: o.disabled,
|
|
343
|
-
className: `menu-item ${sel ? "active" : ""} ${active ? "highlight" : ""}`,
|
|
344
|
-
onMouseEnter: () => setActiveIdx(idx),
|
|
345
|
-
onClick: () => isMulti ? toggleMulti(o) : pickSingle(o),
|
|
374
|
+
role: "presentation",
|
|
375
|
+
className: `menu-item-row ${sel ? "active" : ""} ${active ? "highlight" : ""} ${optionDisabled ? "disabled" : ""}`,
|
|
376
|
+
onMouseEnter: () => {
|
|
377
|
+
if (!optionDisabled) setActiveIdx(idx);
|
|
378
|
+
},
|
|
346
379
|
children: [
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
380
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
381
|
+
"button",
|
|
382
|
+
{
|
|
383
|
+
id: `${listboxId}-option-${idx}`,
|
|
384
|
+
type: "button",
|
|
385
|
+
role: "option",
|
|
386
|
+
"aria-selected": sel,
|
|
387
|
+
"aria-label": getOptionAriaLabel(o),
|
|
388
|
+
disabled: optionDisabled,
|
|
389
|
+
className: `menu-item ${sel ? "active" : ""} ${active ? "highlight" : ""}`,
|
|
390
|
+
onClick: () => isMulti ? toggleMulti(o) : pickSingle(o),
|
|
391
|
+
children: [
|
|
392
|
+
isMulti && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `menu-check ${sel ? "on" : ""}`, "aria-hidden": true, children: sel && /* @__PURE__ */ jsxRuntime.jsx(chunkVDVKY2IX_cjs.Icon, { name: "check", size: 11, stroke: 3 }) }),
|
|
393
|
+
optionRender ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "menu-item-custom", children: optionRender(o, renderInfo) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
394
|
+
chunkVDVKY2IX_cjs.renderIconSlot(o.icon, { size: 14, className: "menu-item-icon" }),
|
|
395
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "menu-item-body", children: [
|
|
396
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "menu-item-label", children: o.label }),
|
|
397
|
+
o.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "menu-item-desc", children: o.description })
|
|
398
|
+
] })
|
|
399
|
+
] }),
|
|
400
|
+
!isMulti && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tick", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVDVKY2IX_cjs.Icon, { name: "check", size: 12, stroke: 3 }) })
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
hasExtra && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "menu-item-extra", children: extraContent })
|
|
356
405
|
]
|
|
357
406
|
},
|
|
358
407
|
String(o.value)
|
|
359
408
|
);
|
|
360
409
|
};
|
|
410
|
+
const renderMenuItems = (items) => items.map(
|
|
411
|
+
(item, groupIndex) => isGroup(item) ? /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
|
412
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "menu-group-label", children: item.label }),
|
|
413
|
+
item.options.map((option) => renderOption(option, !!item.pinned))
|
|
414
|
+
] }, `g-${groupIndex}-${item.pinned ? "pinned" : "regular"}`) : renderOption(item)
|
|
415
|
+
);
|
|
361
416
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
362
417
|
"div",
|
|
363
418
|
{
|
|
@@ -407,7 +462,7 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
407
462
|
"aria-activedescendant": open && activeIdx >= 0 ? `${listboxId}-option-${activeIdx}` : void 0,
|
|
408
463
|
children: [
|
|
409
464
|
renderTrigger(),
|
|
410
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
465
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkVDVKY2IX_cjs.Icon, { name: "chevDown", size: 14, className: "select-caret" })
|
|
411
466
|
]
|
|
412
467
|
}
|
|
413
468
|
),
|
|
@@ -423,7 +478,7 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
423
478
|
event.stopPropagation();
|
|
424
479
|
clearAll();
|
|
425
480
|
},
|
|
426
|
-
children: mergedClearIcon ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
481
|
+
children: mergedClearIcon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkVDVKY2IX_cjs.Icon, { name: "x", size: 12 })
|
|
427
482
|
}
|
|
428
483
|
),
|
|
429
484
|
open && portalContainer && reactDom.createPortal(
|
|
@@ -443,8 +498,8 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
443
498
|
...popupStyle
|
|
444
499
|
},
|
|
445
500
|
children: [
|
|
446
|
-
mergedSearchable && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "menu-search", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
447
|
-
|
|
501
|
+
mergedSearchable && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "menu-search", children: /* @__PURE__ */ jsxRuntime.jsx(chunkV6BLBIY6_cjs.InternalComponentThemePart, { components: "Input", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
502
|
+
chunkGFGMGJ5A_cjs.Input,
|
|
448
503
|
{
|
|
449
504
|
ref: searchRef,
|
|
450
505
|
size: "sm",
|
|
@@ -473,15 +528,10 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
473
528
|
children: loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "menu-state", children: [
|
|
474
529
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "menu-state-ico", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "spinner" }) }),
|
|
475
530
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u52A0\u8F7D\u4E2D..." })
|
|
476
|
-
] }) :
|
|
477
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "menu-state-ico", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
531
|
+
] }) : filteredFlat.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "menu-state", children: [
|
|
532
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "menu-state-ico", children: /* @__PURE__ */ jsxRuntime.jsx(chunkVDVKY2IX_cjs.Icon, { name: "search", size: 16 }) }),
|
|
478
533
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: emptyContent ?? "\u6682\u65E0\u5339\u914D\u9879" })
|
|
479
|
-
] }) : filteredItems
|
|
480
|
-
(it, gi) => isGroup(it) ? /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
|
481
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "menu-group-label", children: it.label }),
|
|
482
|
-
it.options.map(renderOption)
|
|
483
|
-
] }, `g-${gi}`) : renderOption(it)
|
|
484
|
-
)
|
|
534
|
+
] }) : renderMenuItems(filteredItems)
|
|
485
535
|
}
|
|
486
536
|
)
|
|
487
537
|
]
|
|
@@ -495,7 +545,7 @@ var SelectInner = (props, forwardedRef) => {
|
|
|
495
545
|
};
|
|
496
546
|
var SelectBase = React__namespace.forwardRef(SelectInner);
|
|
497
547
|
SelectBase.displayName = "Select";
|
|
498
|
-
var Select =
|
|
548
|
+
var Select = chunkV6BLBIY6_cjs.withComponentTheme(
|
|
499
549
|
SelectBase,
|
|
500
550
|
"Select",
|
|
501
551
|
["select", "input", "tag"]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { withComponentTheme } from './chunk-
|
|
2
|
-
import './tokens-
|
|
1
|
+
import { withComponentTheme } from './chunk-5HLNFDV4.js';
|
|
2
|
+
import './tokens-223RYVVS.css';
|
|
3
3
|
import './shared-NJHRNLRH.css';
|
|
4
4
|
import './Empty-U5CBLCAL.css';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./tokens-
|
|
3
|
+
var chunkVDVKY2IX_cjs = require('./chunk-VDVKY2IX.cjs');
|
|
4
|
+
var chunkV6BLBIY6_cjs = require('./chunk-V6BLBIY6.cjs');
|
|
5
|
+
require('./tokens-223RYVVS.css');
|
|
6
6
|
require('./shared-NJHRNLRH.css');
|
|
7
|
-
require('./Checkbox-
|
|
7
|
+
require('./Checkbox-YQ43GFUI.css');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
|
|
@@ -41,6 +41,7 @@ var CheckboxBase = React__namespace.forwardRef(({
|
|
|
41
41
|
value: formValue,
|
|
42
42
|
required,
|
|
43
43
|
form,
|
|
44
|
+
invalid = false,
|
|
44
45
|
"aria-label": ariaLabel,
|
|
45
46
|
"aria-labelledby": ariaLabelledBy,
|
|
46
47
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -65,6 +66,7 @@ var CheckboxBase = React__namespace.forwardRef(({
|
|
|
65
66
|
value && "checked",
|
|
66
67
|
indeterminate && "indeterminate",
|
|
67
68
|
disabled && "disabled",
|
|
69
|
+
invalid && "invalid",
|
|
68
70
|
className
|
|
69
71
|
].filter(Boolean).join(" ");
|
|
70
72
|
return /* @__PURE__ */ jsxRuntime.jsxs("label", { ref, className: cls, ...rest, children: [
|
|
@@ -90,11 +92,11 @@ var CheckboxBase = React__namespace.forwardRef(({
|
|
|
90
92
|
"aria-checked": indeterminate ? "mixed" : value
|
|
91
93
|
}
|
|
92
94
|
),
|
|
93
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "checkbox-box", children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "checkbox-box", children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(chunkVDVKY2IX_cjs.Icon, { name: "minus", size: 11 }) : value ? /* @__PURE__ */ jsxRuntime.jsx(chunkVDVKY2IX_cjs.Icon, { name: "check", size: 11 }) : null }),
|
|
94
96
|
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "checkbox-label", children: label })
|
|
95
97
|
] });
|
|
96
98
|
});
|
|
97
99
|
CheckboxBase.displayName = "Checkbox";
|
|
98
|
-
var Checkbox =
|
|
100
|
+
var Checkbox = chunkV6BLBIY6_cjs.withComponentTheme(CheckboxBase, "Checkbox", "checkbox");
|
|
99
101
|
|
|
100
102
|
exports.Checkbox = Checkbox;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { withComponentTheme } from './chunk-
|
|
2
|
-
import './tokens-
|
|
1
|
+
import { withComponentTheme } from './chunk-5HLNFDV4.js';
|
|
2
|
+
import './tokens-223RYVVS.css';
|
|
3
3
|
import './shared-NJHRNLRH.css';
|
|
4
4
|
import './Spin-F5YIEENO.css';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { withComponentTheme } from './chunk-
|
|
2
|
-
import './tokens-
|
|
1
|
+
import { withComponentTheme } from './chunk-5HLNFDV4.js';
|
|
2
|
+
import './tokens-223RYVVS.css';
|
|
3
3
|
import './shared-NJHRNLRH.css';
|
|
4
4
|
import './List-6BQIFAIT.css';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./tokens-
|
|
3
|
+
var chunkVDVKY2IX_cjs = require('./chunk-VDVKY2IX.cjs');
|
|
4
|
+
var chunkV6BLBIY6_cjs = require('./chunk-V6BLBIY6.cjs');
|
|
5
|
+
require('./tokens-223RYVVS.css');
|
|
6
6
|
require('./shared-NJHRNLRH.css');
|
|
7
7
|
require('./Button-ILNZUX2N.css');
|
|
8
8
|
var React = require('react');
|
|
@@ -69,21 +69,21 @@ var ButtonBase = React__namespace.forwardRef(
|
|
|
69
69
|
"aria-label": ariaLabel ?? (onlyIcon ? tip ?? (typeof icon === "string" ? icon : void 0) : void 0),
|
|
70
70
|
...rest,
|
|
71
71
|
children: [
|
|
72
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "spinner", "aria-hidden": true }) :
|
|
72
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "spinner", "aria-hidden": true }) : chunkVDVKY2IX_cjs.renderIconSlot(icon, { size: 15, className: "btn-icon-slot" }),
|
|
73
73
|
content,
|
|
74
|
-
|
|
74
|
+
chunkVDVKY2IX_cjs.renderIconSlot(trailingIcon, { size: 15, className: "btn-icon-slot" })
|
|
75
75
|
]
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
ButtonBase.displayName = "Button";
|
|
81
|
-
var Button =
|
|
81
|
+
var Button = chunkV6BLBIY6_cjs.withComponentTheme(ButtonBase, "Button", "button");
|
|
82
82
|
var IconButtonBase = React__namespace.forwardRef(
|
|
83
83
|
({ icon, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx(Button, { ref, icon, iconOnly: true, ...rest })
|
|
84
84
|
);
|
|
85
85
|
IconButtonBase.displayName = "IconButton";
|
|
86
|
-
var IconButton =
|
|
86
|
+
var IconButton = chunkV6BLBIY6_cjs.withComponentTheme(
|
|
87
87
|
IconButtonBase,
|
|
88
88
|
"IconButton",
|
|
89
89
|
"button"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useFloating } from './chunk-3QXP2ZNP.js';
|
|
2
|
-
import { Input } from './chunk-
|
|
2
|
+
import { Input } from './chunk-TUXF2G2O.js';
|
|
3
3
|
import { useOverlayLayer } from './chunk-2A4GYSN4.js';
|
|
4
|
-
import { useComponentPortalTheme, InternalComponentThemePart, withComponentTheme } from './chunk-
|
|
5
|
-
import { usePortalContainer } from './chunk-
|
|
6
|
-
import './tokens-
|
|
4
|
+
import { useComponentPortalTheme, InternalComponentThemePart, withComponentTheme } from './chunk-5HLNFDV4.js';
|
|
5
|
+
import { usePortalContainer } from './chunk-CPVUDSIY.js';
|
|
6
|
+
import './tokens-223RYVVS.css';
|
|
7
7
|
import './shared-NJHRNLRH.css';
|
|
8
8
|
import './ColorPicker-GRZOKR5O.css';
|
|
9
9
|
import * as React from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { withComponentTheme } from './chunk-
|
|
2
|
-
import './tokens-
|
|
1
|
+
import { withComponentTheme } from './chunk-5HLNFDV4.js';
|
|
2
|
+
import './tokens-223RYVVS.css';
|
|
3
3
|
import './shared-NJHRNLRH.css';
|
|
4
4
|
import './Skeleton-FMFE3BRI.css';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useInputTriggerToggle } from './chunk-RC6ULCQP.js';
|
|
2
2
|
import { useFloating } from './chunk-3QXP2ZNP.js';
|
|
3
|
-
import { Input } from './chunk-
|
|
3
|
+
import { Input } from './chunk-TUXF2G2O.js';
|
|
4
4
|
import { useOverlayLayer } from './chunk-2A4GYSN4.js';
|
|
5
|
-
import { Button } from './chunk-
|
|
6
|
-
import { Calendar } from './chunk-
|
|
7
|
-
import { useComponentPortalTheme, InternalComponentThemePart, withComponentTheme } from './chunk-
|
|
8
|
-
import { usePortalContainer } from './chunk-
|
|
9
|
-
import './tokens-
|
|
5
|
+
import { Button } from './chunk-563SQXH7.js';
|
|
6
|
+
import { Calendar } from './chunk-TY5LOU3A.js';
|
|
7
|
+
import { useComponentPortalTheme, InternalComponentThemePart, withComponentTheme } from './chunk-5HLNFDV4.js';
|
|
8
|
+
import { usePortalContainer } from './chunk-CPVUDSIY.js';
|
|
9
|
+
import './tokens-223RYVVS.css';
|
|
10
10
|
import './shared-NJHRNLRH.css';
|
|
11
11
|
import './DateTimePicker-EWSISVIF.css';
|
|
12
12
|
import * as React from 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./tokens-
|
|
3
|
+
var chunkV6BLBIY6_cjs = require('./chunk-V6BLBIY6.cjs');
|
|
4
|
+
require('./tokens-223RYVVS.css');
|
|
5
5
|
require('./shared-NJHRNLRH.css');
|
|
6
6
|
require('./Splitter-IQ3PFIKK.css');
|
|
7
7
|
var React = require('react');
|
|
@@ -55,6 +55,11 @@ var SplitterBase = React__namespace.forwardRef(({
|
|
|
55
55
|
className = "",
|
|
56
56
|
handleClassName = "",
|
|
57
57
|
handleProps,
|
|
58
|
+
firstPaneClassName = "",
|
|
59
|
+
firstPaneStyle,
|
|
60
|
+
secondPaneClassName = "",
|
|
61
|
+
secondPaneStyle,
|
|
62
|
+
handle,
|
|
58
63
|
secondMin = 24,
|
|
59
64
|
storageKey,
|
|
60
65
|
...rest
|
|
@@ -178,6 +183,13 @@ var SplitterBase = React__namespace.forwardRef(({
|
|
|
178
183
|
}
|
|
179
184
|
};
|
|
180
185
|
const firstStyle = direction === "horizontal" ? { width: current } : { height: current };
|
|
186
|
+
const {
|
|
187
|
+
className: nativeHandleClassName = "",
|
|
188
|
+
style: nativeHandleStyle,
|
|
189
|
+
children: nativeHandleChildren,
|
|
190
|
+
...nativeHandleProps
|
|
191
|
+
} = handleProps ?? {};
|
|
192
|
+
const handleContent = handle !== void 0 ? handle : nativeHandleChildren !== void 0 ? nativeHandleChildren : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "splitter-handle-grip", "aria-hidden": true });
|
|
181
193
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
182
194
|
"div",
|
|
183
195
|
{
|
|
@@ -189,11 +201,18 @@ var SplitterBase = React__namespace.forwardRef(({
|
|
|
189
201
|
className: `splitter ${direction} ${dragging ? "dragging" : ""} ${className}`,
|
|
190
202
|
...rest,
|
|
191
203
|
children: [
|
|
192
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "splitter-panel first", style: firstStyle, children: children[0] }),
|
|
193
204
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
194
205
|
"div",
|
|
195
206
|
{
|
|
196
|
-
|
|
207
|
+
className: ["splitter-panel", "first", firstPaneClassName].filter(Boolean).join(" "),
|
|
208
|
+
style: { ...firstStyle, ...firstPaneStyle },
|
|
209
|
+
children: children[0]
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
213
|
+
"div",
|
|
214
|
+
{
|
|
215
|
+
...nativeHandleProps,
|
|
197
216
|
role: "separator",
|
|
198
217
|
tabIndex: 0,
|
|
199
218
|
"aria-label": handleProps?.["aria-label"] ?? "\u8C03\u6574\u5206\u680F\u5C3A\u5BF8",
|
|
@@ -201,21 +220,29 @@ var SplitterBase = React__namespace.forwardRef(({
|
|
|
201
220
|
"aria-valuenow": current,
|
|
202
221
|
"aria-valuemin": min,
|
|
203
222
|
"aria-valuemax": Number.isFinite(max) ? clamp(max) : void 0,
|
|
204
|
-
className:
|
|
223
|
+
className: ["splitter-handle", handleClassName, nativeHandleClassName].filter(Boolean).join(" "),
|
|
224
|
+
style: nativeHandleStyle,
|
|
205
225
|
onPointerDown,
|
|
206
226
|
onKeyDown: (event) => {
|
|
207
227
|
handleProps?.onKeyDown?.(event);
|
|
208
228
|
if (!event.defaultPrevented) onKeyDown(event);
|
|
209
229
|
},
|
|
210
|
-
children:
|
|
230
|
+
children: handleContent
|
|
211
231
|
}
|
|
212
232
|
),
|
|
213
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
233
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
className: ["splitter-panel", "second", secondPaneClassName].filter(Boolean).join(" "),
|
|
237
|
+
style: secondPaneStyle,
|
|
238
|
+
children: children[1]
|
|
239
|
+
}
|
|
240
|
+
)
|
|
214
241
|
]
|
|
215
242
|
}
|
|
216
243
|
);
|
|
217
244
|
});
|
|
218
245
|
SplitterBase.displayName = "Splitter";
|
|
219
|
-
var Splitter =
|
|
246
|
+
var Splitter = chunkV6BLBIY6_cjs.withComponentTheme(SplitterBase, "Splitter", "splitter");
|
|
220
247
|
|
|
221
248
|
exports.Splitter = Splitter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { withComponentTheme } from './chunk-
|
|
2
|
-
import './tokens-
|
|
1
|
+
import { withComponentTheme } from './chunk-5HLNFDV4.js';
|
|
2
|
+
import './tokens-223RYVVS.css';
|
|
3
3
|
import './shared-NJHRNLRH.css';
|
|
4
|
-
import './Switch-
|
|
4
|
+
import './Switch-3JV3LCPX.css';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
@@ -20,6 +20,7 @@ var SwitchBase = React.forwardRef(({
|
|
|
20
20
|
value: formValue,
|
|
21
21
|
required,
|
|
22
22
|
form,
|
|
23
|
+
invalid = false,
|
|
23
24
|
"aria-label": ariaLabel,
|
|
24
25
|
"aria-labelledby": ariaLabelledBy,
|
|
25
26
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -41,6 +42,7 @@ var SwitchBase = React.forwardRef(({
|
|
|
41
42
|
value && "on",
|
|
42
43
|
size !== "md" && size,
|
|
43
44
|
disabled && "disabled",
|
|
45
|
+
invalid && "invalid",
|
|
44
46
|
hasChildren && "with-children",
|
|
45
47
|
className
|
|
46
48
|
].filter(Boolean).join(" ");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./tokens-
|
|
3
|
+
var chunkV6BLBIY6_cjs = require('./chunk-V6BLBIY6.cjs');
|
|
4
|
+
require('./tokens-223RYVVS.css');
|
|
5
5
|
require('./shared-NJHRNLRH.css');
|
|
6
6
|
require('./Badge-DBWJEV4C.css');
|
|
7
7
|
var React = require('react');
|
|
@@ -56,6 +56,6 @@ var BadgeBase = React__namespace.forwardRef(({
|
|
|
56
56
|
] });
|
|
57
57
|
});
|
|
58
58
|
BadgeBase.displayName = "Badge";
|
|
59
|
-
var Badge =
|
|
59
|
+
var Badge = chunkV6BLBIY6_cjs.withComponentTheme(BadgeBase, "Badge", "badge");
|
|
60
60
|
|
|
61
61
|
exports.Badge = Badge;
|