@bioturing/components 0.27.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/checkbox/component.js.map +1 -1
- package/dist/components/choice-list/component.js +9 -9
- package/dist/components/cmdk/index.js.map +1 -1
- package/dist/components/combobox/component.js +202 -0
- package/dist/components/combobox/component.js.map +1 -0
- package/dist/components/combobox/style.css +1 -0
- package/dist/components/combobox/trigger.js +89 -0
- package/dist/components/combobox/trigger.js.map +1 -0
- package/dist/components/dropdown-menu/component.js +176 -163
- package/dist/components/dropdown-menu/component.js.map +1 -1
- package/dist/components/dropdown-menu/divider.js +16 -0
- package/dist/components/dropdown-menu/divider.js.map +1 -0
- package/dist/components/dropdown-menu/item.css +1 -0
- package/dist/components/dropdown-menu/item.js +131 -0
- package/dist/components/dropdown-menu/item.js.map +1 -0
- package/dist/components/dropdown-menu/style.css +1 -1
- package/dist/components/hooks/useDraggable.js +77 -0
- package/dist/components/hooks/useDraggable.js.map +1 -0
- package/dist/components/hooks/useHover.js +26 -0
- package/dist/components/hooks/useHover.js.map +1 -0
- package/dist/components/hooks/useTransitionStatus.js +52 -0
- package/dist/components/hooks/useTransitionStatus.js.map +1 -0
- package/dist/components/nav/item.js +2 -2
- package/dist/components/popup-panel/component.js +81 -92
- package/dist/components/popup-panel/component.js.map +1 -1
- package/dist/components/resizable/component.js +165 -97
- package/dist/components/resizable/component.js.map +1 -1
- package/dist/components/resizable/style.css +1 -1
- package/dist/components/select/component.js +160 -91
- package/dist/components/select/component.js.map +1 -1
- package/dist/components/select/item.js +54 -0
- package/dist/components/select/item.js.map +1 -0
- package/dist/components/select/style.css +1 -1
- package/dist/components/splitter/splitter-panel.js +8 -8
- package/dist/components/splitter/splitter.js +9 -9
- package/dist/components/splitter/useSizes.js +10 -10
- package/dist/components/splitter/useSizes.js.map +1 -1
- package/dist/components/stack/StackChild.js +9 -9
- package/dist/components/transition/component.js +1 -1
- package/dist/components/transition/component.js.map +1 -1
- package/dist/index.d.ts +317 -5
- package/dist/index.js +204 -194
- package/dist/index.js.map +1 -1
- package/dist/metadata.js +21 -7
- package/dist/metadata.js.map +1 -1
- package/package.json +4 -3
|
@@ -5,8 +5,8 @@ import { useRender as w } from "@base-ui-components/react/use-render";
|
|
|
5
5
|
import { mergeProps as E } from "@base-ui-components/react/merge-props";
|
|
6
6
|
import { Stack as P } from "./Stack.js";
|
|
7
7
|
import { useCls as V } from "../utils/antdUtils.js";
|
|
8
|
-
import { cn as
|
|
9
|
-
const
|
|
8
|
+
import { cn as _ } from "../utils/cn.js";
|
|
9
|
+
const j = g(
|
|
10
10
|
({
|
|
11
11
|
flex: s,
|
|
12
12
|
grow: m = !1,
|
|
@@ -15,8 +15,8 @@ const x = g(
|
|
|
15
15
|
style: n,
|
|
16
16
|
stack: f = !1,
|
|
17
17
|
// stack props
|
|
18
|
-
hug:
|
|
19
|
-
align:
|
|
18
|
+
hug: d = !1,
|
|
19
|
+
align: p = "flex-start",
|
|
20
20
|
justify: k = "flex-start",
|
|
21
21
|
vertical: u = !1,
|
|
22
22
|
gap: h = 0,
|
|
@@ -25,13 +25,13 @@ const x = g(
|
|
|
25
25
|
...o
|
|
26
26
|
}, a) => {
|
|
27
27
|
const t = V(), N = {
|
|
28
|
-
hug:
|
|
29
|
-
align:
|
|
28
|
+
hug: d,
|
|
29
|
+
align: p,
|
|
30
30
|
justify: k,
|
|
31
31
|
vertical: u,
|
|
32
32
|
gap: h,
|
|
33
33
|
wrap: C
|
|
34
|
-
}, r = v(() => typeof s == "boolean" || s === 0 || s === 1 ? t(s === !0 || s === 1 ? "stack-child-flex-1" : "stack-child-flex-0") : "", [s, t]), c =
|
|
34
|
+
}, r = v(() => typeof s == "boolean" || s === 0 || s === 1 ? t(s === !0 || s === 1 ? "stack-child-flex-1" : "stack-child-flex-0") : "", [s, t]), c = _(
|
|
35
35
|
t("stack-child"),
|
|
36
36
|
m && t("stack-child-grow"),
|
|
37
37
|
i && t("stack-child-shrink"),
|
|
@@ -55,8 +55,8 @@ const x = g(
|
|
|
55
55
|
return f ? /* @__PURE__ */ l(P, { ...N, ref: a, className: c, ...o, children: e }) : R;
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
|
-
|
|
58
|
+
j.displayName = "StackChild";
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
j as StackChild
|
|
61
61
|
};
|
|
62
62
|
//# sourceMappingURL=StackChild.js.map
|
|
@@ -3,7 +3,7 @@ import { jsx as y } from "react/jsx-runtime";
|
|
|
3
3
|
import { useMemo as j, useRef as F, useCallback as A, isValidElement as E, useEffect as N } from "react";
|
|
4
4
|
import { useRender as S } from "@base-ui-components/react/use-render";
|
|
5
5
|
import { mergeProps as L } from "@base-ui-components/react/merge-props";
|
|
6
|
-
import { useTransitionStatus as O } from "
|
|
6
|
+
import { useTransitionStatus as O } from "../hooks/useTransitionStatus.js";
|
|
7
7
|
import './style.css';/* empty css */
|
|
8
8
|
import { useLatestRef as P, useAnimationsFinished as V } from "../hooks/base-ui.js";
|
|
9
9
|
import { useCls as q } from "../utils/antdUtils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/transition/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n CSSProperties,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\nimport { mergeProps } from \"@base-ui-components/react/merge-props\";\nimport { useTransitionStatus } from \"
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/transition/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n CSSProperties,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\nimport { mergeProps } from \"@base-ui-components/react/merge-props\";\nimport { useTransitionStatus } from \"../hooks/useTransitionStatus\";\nimport { clsx, useCls } from \"../utils\";\nimport { useAnimationsFinished, useLatestRef } from \"../hooks\";\n\nimport \"./style.css\";\n\nexport type TransitionProps = Omit<\n useRender.ComponentProps<\"div\">,\n \"render\" | \"children\"\n> & {\n /** Whether the component should be shown */\n show?: boolean;\n /** CSS classes to apply when the component is opened */\n starting?: string | CSSProperties;\n /** CSS classes to apply when the component is closed */\n ending?: string | CSSProperties;\n /** CSS classes to apply to the component */\n className?: string;\n /** Keep mounted */\n keepMounted?: boolean;\n /**\n * Callback function to be called when the transition ends\n */\n onTransitionComplete?: (show?: boolean) => void;\n /**\n * Whether to listen for animations in child elements\n */\n listenToChildAnimations?: boolean;\n /**\n * Whether to render the child as a child element\n * @default true\n */\n asChild?: boolean;\n children?: React.ReactNode | useRender.ComponentProps<\"div\">[\"render\"];\n};\n\nexport function Transition({\n children = <div />,\n className,\n starting,\n ending,\n show = true,\n keepMounted = false,\n onTransitionComplete,\n listenToChildAnimations = false,\n asChild = true,\n ...otherProps\n}: TransitionProps) {\n const { mounted, setMounted, transitionStatus } = useTransitionStatus(show);\n const showRef = useLatestRef(show);\n\n const cls = useCls();\n\n const combinedClassName = useMemo(\n () =>\n clsx(\n className,\n transitionStatus === \"starting\" &&\n typeof starting == \"string\" &&\n starting,\n transitionStatus === \"ending\" && typeof ending == \"string\" && ending,\n // hide by display: none when not mounted and keepMounted is true\n mounted == false && keepMounted ? cls(\"transition-hidden\") : undefined\n ),\n [className, starting, ending, transitionStatus, mounted, keepMounted, cls]\n );\n\n const ref = useRef<HTMLDivElement>(null);\n const runOnceAnimationsFinish = useAnimationsFinished(ref, {\n waitForNextTick: show,\n subtree: listenToChildAnimations,\n });\n\n const getRender = useCallback(() => {\n if (typeof children === \"function\") {\n return children;\n }\n if (asChild && isValidElement(children)) {\n return children;\n }\n return <div>{children}</div>;\n }, [children, asChild]);\n\n const rendered = useRender({\n render: getRender(),\n props: mergeProps<\"div\">(otherProps, {\n ref,\n className: combinedClassName,\n ...{\n \"data-starting\": transitionStatus === \"starting\" ? \"true\" : undefined,\n \"data-ending\": transitionStatus === \"ending\" ? \"true\" : undefined,\n },\n style: {\n ...(transitionStatus === \"starting\" && typeof starting === \"object\"\n ? starting\n : {}),\n ...(transitionStatus === \"ending\" && typeof ending === \"object\"\n ? ending\n : {}),\n },\n }),\n });\n\n useEffect(() => {\n runOnceAnimationsFinish(() => {\n if (show === showRef.current) {\n setMounted(show);\n onTransitionComplete?.(show);\n }\n });\n }, [\n show,\n keepMounted,\n runOnceAnimationsFinish,\n setMounted,\n showRef,\n onTransitionComplete,\n ]);\n\n return mounted || keepMounted ? rendered : null;\n}\n"],"names":["Transition","children","className","starting","ending","show","keepMounted","onTransitionComplete","listenToChildAnimations","asChild","otherProps","mounted","setMounted","transitionStatus","useTransitionStatus","showRef","useLatestRef","cls","useCls","combinedClassName","useMemo","clsx","ref","useRef","runOnceAnimationsFinish","useAnimationsFinished","getRender","useCallback","isValidElement","jsx","rendered","useRender","mergeProps","useEffect"],"mappings":";;;;;;;;;;AA+CO,SAASA,EAAW;AAAA,EACzB,UAAAC,sBAAY,OAAI,EAAA;AAAA,EAChB,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC,IAAc;AAAA,EACd,sBAAAC;AAAA,EACA,yBAAAC,IAA0B;AAAA,EAC1B,SAAAC,IAAU;AAAA,EACV,GAAGC;AACL,GAAoB;AAClB,QAAM,EAAE,SAAAC,GAAS,YAAAC,GAAY,kBAAAC,EAAiB,IAAIC,EAAoBT,CAAI,GACpEU,IAAUC,EAAaX,CAAI,GAE3BY,IAAMC,EAAO,GAEbC,IAAoBC;AAAA,IACxB,MACEC;AAAA,MACEnB;AAAA,MACAW,MAAqB,cACnB,OAAOV,KAAY,YACnBA;AAAA,MACFU,MAAqB,YAAY,OAAOT,KAAU,YAAYA;AAAA;AAAA,MAE9DO,KAAW,MAASL,IAAcW,EAAI,mBAAmB,IAAI;AAAA,IAC/D;AAAA,IACF,CAACf,GAAWC,GAAUC,GAAQS,GAAkBF,GAASL,GAAaW,CAAG;AAAA,EAC3E,GAEMK,IAAMC,EAAuB,IAAI,GACjCC,IAA0BC,EAAsBH,GAAK;AAAA,IACzD,iBAAiBjB;AAAA,IACjB,SAASG;AAAA,EAAA,CACV,GAEKkB,IAAYC,EAAY,MACxB,OAAO1B,KAAa,cAGpBQ,KAAWmB,EAAe3B,CAAQ,IAC7BA,IAEF,gBAAA4B,EAAC,SAAK,UAAA5B,GAAS,GACrB,CAACA,GAAUQ,CAAO,CAAC,GAEhBqB,IAAWC,EAAU;AAAA,IACzB,QAAQL,EAAU;AAAA,IAClB,OAAOM,EAAkBtB,GAAY;AAAA,MACnC,KAAAY;AAAA,MACA,WAAWH;AAAA,MAET,iBAAiBN,MAAqB,aAAa,SAAS;AAAA,MAC5D,eAAeA,MAAqB,WAAW,SAAS;AAAA,MAE1D,OAAO;AAAA,QACL,GAAIA,MAAqB,cAAc,OAAOV,KAAa,WACvDA,IACA,CAAC;AAAA,QACL,GAAIU,MAAqB,YAAY,OAAOT,KAAW,WACnDA,IACA,CAAA;AAAA,MAAC;AAAA,IAER,CAAA;AAAA,EAAA,CACF;AAED,SAAA6B,EAAU,MAAM;AACd,IAAAT,EAAwB,MAAM;AACxB,MAAAnB,MAASU,EAAQ,YACnBH,EAAWP,CAAI,GACfE,KAAA,QAAAA,EAAuBF;AAAA,IACzB,CACD;AAAA,EAAA,GACA;AAAA,IACDA;AAAA,IACAC;AAAA,IACAkB;AAAA,IACAZ;AAAA,IACAG;AAAA,IACAR;AAAA,EAAA,CACD,GAEMI,KAAWL,IAAcwB,IAAW;AAC7C;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -433,7 +433,7 @@ export declare interface CheckboxProps extends CheckboxProps_2 {
|
|
|
433
433
|
* Checkbox appearance variant
|
|
434
434
|
* @default 'default'
|
|
435
435
|
*/
|
|
436
|
-
variant?:
|
|
436
|
+
variant?: "default" | "outlined";
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
export { CheckboxRef }
|
|
@@ -953,6 +953,140 @@ export declare type ColorTokenValue = {
|
|
|
953
953
|
|
|
954
954
|
export { ColProps }
|
|
955
955
|
|
|
956
|
+
export declare const Combobox: default_2.ForwardRefExoticComponent<ComboboxProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
957
|
+
|
|
958
|
+
export declare interface ComboboxOption {
|
|
959
|
+
value: string | number;
|
|
960
|
+
label: default_2.ReactNode;
|
|
961
|
+
disabled?: boolean;
|
|
962
|
+
icon?: default_2.ReactNode;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
export declare interface ComboboxProps {
|
|
966
|
+
/** Array of options to be displayed in the combobox */
|
|
967
|
+
options?: ComboboxOption[];
|
|
968
|
+
/** Current value of the combobox */
|
|
969
|
+
value?: string | number | Array<string | number>;
|
|
970
|
+
/** Default value when uncontrolled */
|
|
971
|
+
defaultValue?: string | number | Array<string | number>;
|
|
972
|
+
/** Callback when value changes */
|
|
973
|
+
onChange?: (value: string | number | Array<string | number>) => void;
|
|
974
|
+
/** Placeholder text for the input */
|
|
975
|
+
placeholder?: string;
|
|
976
|
+
/** Whether the combobox is disabled */
|
|
977
|
+
disabled?: boolean;
|
|
978
|
+
/** Whether to allow clearing the selection */
|
|
979
|
+
allowClear?: boolean;
|
|
980
|
+
/** Whether to allow multiple selections */
|
|
981
|
+
multiple?: boolean;
|
|
982
|
+
/** Maximum number of tags to show */
|
|
983
|
+
maxTagCount?: number;
|
|
984
|
+
/** Whether to show search functionality */
|
|
985
|
+
showSearch?: boolean;
|
|
986
|
+
/** Controlled open state */
|
|
987
|
+
open?: boolean;
|
|
988
|
+
/** Callback when open state changes */
|
|
989
|
+
onOpenChange?: (open: boolean) => void;
|
|
990
|
+
/** Placement of the dropdown */
|
|
991
|
+
placement?: PopoverProps_2["placement"];
|
|
992
|
+
/** Custom className for the component */
|
|
993
|
+
className?: string;
|
|
994
|
+
/** Custom class names for different parts */
|
|
995
|
+
classNames?: {
|
|
996
|
+
trigger?: string;
|
|
997
|
+
input?: string;
|
|
998
|
+
option?: string;
|
|
999
|
+
optionIcon?: string;
|
|
1000
|
+
optionText?: string;
|
|
1001
|
+
};
|
|
1002
|
+
/** Size of the combobox */
|
|
1003
|
+
size?: "small" | "middle" | "large";
|
|
1004
|
+
/** Loading state */
|
|
1005
|
+
loading?: boolean;
|
|
1006
|
+
/** Custom render for options */
|
|
1007
|
+
optionRender?: (option: ComboboxOption, props: default_2.HTMLAttributes<HTMLElement>) => default_2.ReactElement;
|
|
1008
|
+
/** Filter function for search */
|
|
1009
|
+
filterOption?: boolean | ((input: string, option: ComboboxOption) => boolean);
|
|
1010
|
+
/** Callback when search input changes */
|
|
1011
|
+
onSearch?: (value: string) => void;
|
|
1012
|
+
/** Custom dropdown render */
|
|
1013
|
+
dropdownRender?: (menu: default_2.ReactElement) => default_2.ReactElement;
|
|
1014
|
+
/** Custom clear icon */
|
|
1015
|
+
clearIcon?: default_2.ReactNode;
|
|
1016
|
+
/** Custom suffix icon */
|
|
1017
|
+
suffixIcon?: default_2.ReactNode;
|
|
1018
|
+
/**
|
|
1019
|
+
* Props to pass to the dropdown menu
|
|
1020
|
+
*/
|
|
1021
|
+
dropdownMenuProps?: DropdownMenuProps;
|
|
1022
|
+
/**
|
|
1023
|
+
* Props to pass to the combobox trigger
|
|
1024
|
+
*/
|
|
1025
|
+
triggerProps?: ComboboxTriggerProps;
|
|
1026
|
+
searchProps?: {
|
|
1027
|
+
placeholder?: string;
|
|
1028
|
+
onValueChange?: (value: string) => void;
|
|
1029
|
+
value?: string;
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* Show selection summary instead of individual tags when multiple
|
|
1033
|
+
* @default false
|
|
1034
|
+
*/
|
|
1035
|
+
showSelectionSummary?: boolean;
|
|
1036
|
+
/**
|
|
1037
|
+
* Render function for the selection summary in multiple case
|
|
1038
|
+
* @default (selectedValues) => `${selectedValues.length} items selected`
|
|
1039
|
+
*/
|
|
1040
|
+
selectionSummaryRender?: (selectedValues: Array<string | number>) => default_2.ReactNode;
|
|
1041
|
+
/**
|
|
1042
|
+
* Show select all option when in multiple mode
|
|
1043
|
+
* @default false
|
|
1044
|
+
*/
|
|
1045
|
+
showSelectAll?: boolean;
|
|
1046
|
+
/**
|
|
1047
|
+
* Render function for the select all option
|
|
1048
|
+
*/
|
|
1049
|
+
selectAllRender?: (props: {
|
|
1050
|
+
onSelectAll: () => void;
|
|
1051
|
+
onDeselectAll: () => void;
|
|
1052
|
+
checked: boolean;
|
|
1053
|
+
indeterminate: boolean;
|
|
1054
|
+
}) => default_2.ReactNode;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
export declare const ComboboxTrigger: default_2.ForwardRefExoticComponent<ComboboxTriggerProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
1058
|
+
|
|
1059
|
+
export declare interface ComboboxTriggerProps extends default_2.ComponentPropsWithoutRef<"button"> {
|
|
1060
|
+
/** Selected options */
|
|
1061
|
+
selectedOptions: ComboboxOption[];
|
|
1062
|
+
/** Placeholder text */
|
|
1063
|
+
placeholder?: string;
|
|
1064
|
+
/** Whether multiple selection is enabled */
|
|
1065
|
+
multiple?: boolean;
|
|
1066
|
+
/** Whether the component is disabled */
|
|
1067
|
+
disabled?: boolean;
|
|
1068
|
+
/** Whether the dropdown is open */
|
|
1069
|
+
open?: boolean;
|
|
1070
|
+
/** Size variant */
|
|
1071
|
+
size?: "small" | "middle" | "large";
|
|
1072
|
+
/** Whether to show clear button */
|
|
1073
|
+
allowClear?: boolean;
|
|
1074
|
+
/** Custom suffix icon */
|
|
1075
|
+
suffixIcon?: default_2.ReactNode;
|
|
1076
|
+
/** Custom clear icon */
|
|
1077
|
+
clearIcon?: default_2.ReactNode;
|
|
1078
|
+
/** Custom class names */
|
|
1079
|
+
classNames?: {
|
|
1080
|
+
trigger?: string;
|
|
1081
|
+
};
|
|
1082
|
+
/** Clear handler */
|
|
1083
|
+
onClear?: () => void;
|
|
1084
|
+
/** Show selection summary instead of individual tags when multiple */
|
|
1085
|
+
showSelectionSummary?: boolean;
|
|
1086
|
+
/** Render function for the selection summary in multiple case */
|
|
1087
|
+
selectionSummaryRender?: (selectedValues: Array<string | number>) => default_2.ReactNode;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
956
1090
|
declare type CommandFilter = (value: string, search: string, keywords?: string[]) => number;
|
|
957
1091
|
|
|
958
1092
|
declare type CommandProps = Children & DivProps & {
|
|
@@ -1297,6 +1431,15 @@ export declare const componentMetadata: {
|
|
|
1297
1431
|
originalDocUrl: string;
|
|
1298
1432
|
description: string;
|
|
1299
1433
|
};
|
|
1434
|
+
Combobox: {
|
|
1435
|
+
name: string;
|
|
1436
|
+
link: string;
|
|
1437
|
+
base: "custom";
|
|
1438
|
+
refinements: string[];
|
|
1439
|
+
category: "Data Entry";
|
|
1440
|
+
packages: string[];
|
|
1441
|
+
description: string;
|
|
1442
|
+
};
|
|
1300
1443
|
ColorSelect: {
|
|
1301
1444
|
name: string;
|
|
1302
1445
|
link: string;
|
|
@@ -1667,26 +1810,121 @@ export declare const DROPDOWN_COLLISION_AVOIDANCE: {
|
|
|
1667
1810
|
readonly fallbackAxisSide: "none";
|
|
1668
1811
|
};
|
|
1669
1812
|
|
|
1670
|
-
export declare const DropdownMenu: ({ children, items, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, className, itemRender, classNames, size, showSearch, searchProps, }: DropdownMenuProps) => JSX.Element;
|
|
1813
|
+
export declare const DropdownMenu: ({ children, items, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, className, itemRender, classNames, size, showSearch, searchProps, popupMatchTriggerWidth, beforeList, afterList, keepOpenOnSelect, highlightedItemKey, selectedItemKeys, showCheckbox, }: DropdownMenuProps) => JSX.Element;
|
|
1814
|
+
|
|
1815
|
+
export declare const DropdownMenuItem: default_2.FC<DropdownMenuItemProps>;
|
|
1816
|
+
|
|
1817
|
+
export declare interface DropdownMenuItemProps {
|
|
1818
|
+
/** The menu item data */
|
|
1819
|
+
item: DropdownMenuItemType & {
|
|
1820
|
+
type: "item";
|
|
1821
|
+
};
|
|
1822
|
+
/** Custom render function for the item */
|
|
1823
|
+
itemRender?: (item: DropdownMenuItemType, props: default_2.HTMLAttributes<HTMLElement>) => default_2.ReactElement;
|
|
1824
|
+
/** Additional props to pass to the item */
|
|
1825
|
+
itemProps?: default_2.HTMLAttributes<HTMLElement>;
|
|
1826
|
+
/** Class names from parent DropdownMenu */
|
|
1827
|
+
classNames?: {
|
|
1828
|
+
item?: string;
|
|
1829
|
+
itemIcon?: string;
|
|
1830
|
+
itemText?: string;
|
|
1831
|
+
};
|
|
1832
|
+
onSelect?: () => void;
|
|
1833
|
+
/**
|
|
1834
|
+
* Whether the menu item is in a combobox
|
|
1835
|
+
*/
|
|
1836
|
+
inCombobox?: boolean;
|
|
1837
|
+
/**
|
|
1838
|
+
* Whether the menu item is in a menu
|
|
1839
|
+
*/
|
|
1840
|
+
renderAsNativeElement?: boolean;
|
|
1841
|
+
/**
|
|
1842
|
+
* Whether the menu item is selected (for combobox)
|
|
1843
|
+
* @default false
|
|
1844
|
+
*/
|
|
1845
|
+
selected?: boolean;
|
|
1846
|
+
/**
|
|
1847
|
+
* Whether to show checkbox (only for decoration purpose)
|
|
1848
|
+
*/
|
|
1849
|
+
showCheckbox?: boolean;
|
|
1850
|
+
/**
|
|
1851
|
+
* Whether the menu item checkbox is indeterminate (for combobox)
|
|
1852
|
+
* @default false
|
|
1853
|
+
*/
|
|
1854
|
+
indeterminate?: boolean;
|
|
1855
|
+
}
|
|
1671
1856
|
|
|
1672
1857
|
export declare type DropdownMenuItemType = {
|
|
1858
|
+
/**
|
|
1859
|
+
* The type of the menu item
|
|
1860
|
+
*/
|
|
1673
1861
|
type: "item";
|
|
1862
|
+
/**
|
|
1863
|
+
* The label of the menu item
|
|
1864
|
+
*/
|
|
1674
1865
|
label?: React.ReactNode;
|
|
1866
|
+
/**
|
|
1867
|
+
* Whether the menu item is disabled
|
|
1868
|
+
*/
|
|
1675
1869
|
disabled?: boolean;
|
|
1870
|
+
/**
|
|
1871
|
+
* The icon of the menu item
|
|
1872
|
+
*/
|
|
1676
1873
|
icon?: React.ReactNode;
|
|
1874
|
+
/**
|
|
1875
|
+
* The key of the menu item
|
|
1876
|
+
*/
|
|
1677
1877
|
key: React.Key;
|
|
1878
|
+
/**
|
|
1879
|
+
* The onClick event handler of the menu item
|
|
1880
|
+
*/
|
|
1678
1881
|
onClick?: React.HTMLAttributes<HTMLElement>["onClick"];
|
|
1882
|
+
/**
|
|
1883
|
+
* The onMouseEnter event handler of the menu item
|
|
1884
|
+
*/
|
|
1679
1885
|
onMouseEnter?: React.HTMLAttributes<HTMLElement>["onMouseEnter"];
|
|
1886
|
+
/**
|
|
1887
|
+
* The onMouseLeave event handler of the menu item
|
|
1888
|
+
*/
|
|
1680
1889
|
onMouseLeave?: React.HTMLAttributes<HTMLElement>["onMouseLeave"];
|
|
1890
|
+
/**
|
|
1891
|
+
* The onMouseOver event handler of the menu item
|
|
1892
|
+
*/
|
|
1681
1893
|
onMouseOver?: React.HTMLAttributes<HTMLElement>["onMouseOver"];
|
|
1894
|
+
/**
|
|
1895
|
+
* The onMouseOut event handler of the menu item
|
|
1896
|
+
*/
|
|
1682
1897
|
onMouseOut?: React.HTMLAttributes<HTMLElement>["onMouseOut"];
|
|
1898
|
+
/**
|
|
1899
|
+
* The className of the menu item
|
|
1900
|
+
*/
|
|
1901
|
+
className?: string;
|
|
1902
|
+
/**
|
|
1903
|
+
* Whether the menu item is a danger item
|
|
1904
|
+
*/
|
|
1683
1905
|
danger?: boolean;
|
|
1906
|
+
/**
|
|
1907
|
+
* The ref of the menu item
|
|
1908
|
+
*/
|
|
1684
1909
|
ref?: React.Ref<HTMLElement>;
|
|
1685
1910
|
} | {
|
|
1911
|
+
/**
|
|
1912
|
+
* The type of the menu item
|
|
1913
|
+
*/
|
|
1686
1914
|
type: "divider";
|
|
1687
1915
|
} | {
|
|
1916
|
+
/**
|
|
1917
|
+
* The type of the menu item
|
|
1918
|
+
*/
|
|
1688
1919
|
type: "header";
|
|
1920
|
+
/**
|
|
1921
|
+
* The title of the menu item
|
|
1922
|
+
*/
|
|
1689
1923
|
title?: React.ReactNode;
|
|
1924
|
+
/**
|
|
1925
|
+
* The className of the menu item
|
|
1926
|
+
*/
|
|
1927
|
+
className?: string;
|
|
1690
1928
|
};
|
|
1691
1929
|
|
|
1692
1930
|
export declare interface DropdownMenuProps {
|
|
@@ -1750,6 +1988,37 @@ export declare interface DropdownMenuProps {
|
|
|
1750
1988
|
* Search placeholder
|
|
1751
1989
|
*/
|
|
1752
1990
|
searchProps?: Omit<React.ComponentProps<typeof pkg.Input>, "size" | "ref">;
|
|
1991
|
+
/**
|
|
1992
|
+
* Whether to match the width of the popup with the trigger
|
|
1993
|
+
* @default false
|
|
1994
|
+
*/
|
|
1995
|
+
popupMatchTriggerWidth?: boolean;
|
|
1996
|
+
/**
|
|
1997
|
+
* Content to display before the list
|
|
1998
|
+
*/
|
|
1999
|
+
beforeList?: React.ReactNode;
|
|
2000
|
+
/**
|
|
2001
|
+
* Content to display after the list
|
|
2002
|
+
*/
|
|
2003
|
+
afterList?: React.ReactNode;
|
|
2004
|
+
/**
|
|
2005
|
+
* Whether to keep the dropdown open when an item is selected
|
|
2006
|
+
* @default false
|
|
2007
|
+
*/
|
|
2008
|
+
keepOpenOnSelect?: boolean;
|
|
2009
|
+
/**
|
|
2010
|
+
* Control the highlighted state of the menu item
|
|
2011
|
+
*/
|
|
2012
|
+
highlightedItemKey?: React.Key;
|
|
2013
|
+
/**
|
|
2014
|
+
* Control the selected state of the menu item
|
|
2015
|
+
*/
|
|
2016
|
+
selectedItemKeys?: React.Key[];
|
|
2017
|
+
/**
|
|
2018
|
+
* Whether to show checkbox
|
|
2019
|
+
* @default false
|
|
2020
|
+
*/
|
|
2021
|
+
showCheckbox?: boolean;
|
|
1753
2022
|
}
|
|
1754
2023
|
|
|
1755
2024
|
export { DropDownProps }
|
|
@@ -2009,7 +2278,7 @@ declare const MainInputInner: (props: InputProps, ref: React.Ref<InputRef>) => J
|
|
|
2009
2278
|
|
|
2010
2279
|
declare const MainSegmentedInner: <T>(props: SegmentedProps<T>, ref: React.Ref<React.ComponentRef<typeof default_5>>) => JSX.Element;
|
|
2011
2280
|
|
|
2012
|
-
declare const MainSelectInner: <ValueType = unknown, OptionType extends SelectBaseOptionType | SelectDefaultOptionType = SelectDefaultOptionType>({ mode, className, open: openProp, defaultOpen, onOpenChange, popupClassName, onDropdownVisibleChange, enhancePositioner, getPopupContainer, popupSize, popupRender, dropdownRender, classNames, styles, ...rest }: SelectProps<ValueType, OptionType>, ref: default_2.Ref<default_2.ComponentRef<typeof default_3>>) => JSX.Element;
|
|
2281
|
+
declare const MainSelectInner: <ValueType = unknown, OptionType extends SelectBaseOptionType | SelectDefaultOptionType = SelectDefaultOptionType>({ mode, className, open: openProp, defaultOpen, onOpenChange, popupClassName, onDropdownVisibleChange, enhancePositioner, getPopupContainer, popupSize, popupRender, dropdownRender, classNames, styles, showSelectionSummary, selectionSummaryRender, value: valueProp, onChange: onChangeProp, defaultValue, showSelectAll, selectAllRender, options, ...rest }: SelectProps<ValueType, OptionType>, ref: default_2.Ref<default_2.ComponentRef<typeof default_3>>) => JSX.Element;
|
|
2013
2282
|
|
|
2014
2283
|
declare const MainSwitchInner: ({ ...rest }: SwitchProps, ref: React.Ref<React.ComponentRef<typeof default_4>>) => JSX.Element;
|
|
2015
2284
|
|
|
@@ -2410,9 +2679,9 @@ export declare const POPUP_COLLISION_AVOIDANCE: {
|
|
|
2410
2679
|
readonly fallbackAxisSide: "end";
|
|
2411
2680
|
};
|
|
2412
2681
|
|
|
2413
|
-
export declare const PopupPanel: ({ children, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, content, title, trigger, className, anchor, beforeCloseButton, afterCloseButton, afterTitle, size, footer, defaultOpen, resizable, classNames, modal, closeOnClickOutside, onPlacementChange, }: PopupPanelProps) => JSX.Element;
|
|
2682
|
+
export declare const PopupPanel: ({ children, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, content, title, trigger, className, anchor, beforeCloseButton, afterCloseButton, afterTitle, size, footer, defaultOpen, resizable, draggable, maintainAspectRatio, classNames, modal, closeOnClickOutside, onPlacementChange, ...rest }: PopupPanelProps) => JSX.Element;
|
|
2414
2683
|
|
|
2415
|
-
export declare interface PopupPanelProps extends Omit<React.ComponentPropsWithRef<"div">, "title" | "content" | "children"> {
|
|
2684
|
+
export declare interface PopupPanelProps extends Omit<React.ComponentPropsWithRef<"div">, "title" | "content" | "children">, Omit<Popover_2.Root.Props, "children"> {
|
|
2416
2685
|
/** The trigger element that opens the popup panel */
|
|
2417
2686
|
children?: React.ComponentProps<typeof Popover_2.Trigger>["render"];
|
|
2418
2687
|
/** Placement of the popup panel relative to its trigger */
|
|
@@ -2467,6 +2736,17 @@ export declare interface PopupPanelProps extends Omit<React.ComponentPropsWithRe
|
|
|
2467
2736
|
* @default false
|
|
2468
2737
|
*/
|
|
2469
2738
|
resizable?: boolean;
|
|
2739
|
+
/**
|
|
2740
|
+
* Whether the panel should be draggable
|
|
2741
|
+
* @default false
|
|
2742
|
+
*/
|
|
2743
|
+
draggable?: boolean;
|
|
2744
|
+
/**
|
|
2745
|
+
* Whether to maintain aspect ratio when resizing
|
|
2746
|
+
* Only applies when resizable is true
|
|
2747
|
+
* @default false
|
|
2748
|
+
*/
|
|
2749
|
+
maintainAspectRatio?: boolean;
|
|
2470
2750
|
/**
|
|
2471
2751
|
* Custom class names for different parts of the popup panel
|
|
2472
2752
|
* @default {}
|
|
@@ -3158,6 +3438,29 @@ export declare interface SelectProps<ValueType = unknown, OptionType extends Sel
|
|
|
3158
3438
|
* Will be ignored if enhancePositioner is false
|
|
3159
3439
|
*/
|
|
3160
3440
|
popupSize?: string | number | PopupPanelSize;
|
|
3441
|
+
/**
|
|
3442
|
+
* Show selection summary instead of tags in multiple case
|
|
3443
|
+
* @default false
|
|
3444
|
+
*/
|
|
3445
|
+
showSelectionSummary?: boolean;
|
|
3446
|
+
/**
|
|
3447
|
+
* Render function for the selection summary in multiple case
|
|
3448
|
+
* @default (value) => `${value.length} items selected`
|
|
3449
|
+
*/
|
|
3450
|
+
selectionSummaryRender?: (value: ValueType) => default_2.ReactNode;
|
|
3451
|
+
/**
|
|
3452
|
+
* Show select all option when in multiple mode
|
|
3453
|
+
* @default false
|
|
3454
|
+
*/
|
|
3455
|
+
showSelectAll?: boolean;
|
|
3456
|
+
/**
|
|
3457
|
+
* Render function for the select all option
|
|
3458
|
+
*/
|
|
3459
|
+
selectAllRender?: (props: {
|
|
3460
|
+
onClick: () => void;
|
|
3461
|
+
checked: CheckboxProps["checked"];
|
|
3462
|
+
indeterminate: CheckboxProps["indeterminate"];
|
|
3463
|
+
}) => default_2.ReactNode;
|
|
3161
3464
|
}
|
|
3162
3465
|
|
|
3163
3466
|
export declare const SEQUENTIAL_PALETTE_NAMES: readonly ["YlOrBr", "YlOrRd", "OrRd", "PuRd", "RdPu", "BuPu", "GnBu", "PuBu", "YlGnBu", "PuBuGn", "BuGn", "YlGn"];
|
|
@@ -3681,6 +3984,10 @@ T | undefined,
|
|
|
3681
3984
|
*/
|
|
3682
3985
|
export declare const useCSSVariables: (variables: string | string[]) => Record<string, string>;
|
|
3683
3986
|
|
|
3987
|
+
export declare function useDraggable(enabled?: boolean): {
|
|
3988
|
+
ref: (element: HTMLElement | null) => () => void;
|
|
3989
|
+
};
|
|
3990
|
+
|
|
3684
3991
|
export declare const useDS: () => {
|
|
3685
3992
|
theme: "light" | "dark";
|
|
3686
3993
|
};
|
|
@@ -3695,6 +4002,11 @@ export declare const useGetPrefixCls: () => {
|
|
|
3695
4002
|
getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
|
|
3696
4003
|
};
|
|
3697
4004
|
|
|
4005
|
+
export declare function useHover<T extends HTMLElement>(): [
|
|
4006
|
+
(node: T) => void,
|
|
4007
|
+
boolean
|
|
4008
|
+
];
|
|
4009
|
+
|
|
3698
4010
|
export declare function useLatestRef<T>(value: T): RefObject<T>;
|
|
3699
4011
|
|
|
3700
4012
|
export declare const useMessage: () => MessageInstance;
|