@bixlab/mtone 0.2.0 → 0.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/README.md +13 -0
- package/dist/index.d.ts +1390 -225
- package/dist/index.js +8344 -1224
- package/dist/styles.css +1 -1
- package/llms.txt +2356 -0
- package/package.json +9 -5
package/dist/index.d.ts
CHANGED
|
@@ -2,162 +2,165 @@ import * as _base_ui_react from '@base-ui/react';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { Button as Button$1 } from '@base-ui/react/button';
|
|
5
|
+
import * as _rc_component_table_es_Footer_Cell from '@rc-component/table/es/Footer/Cell';
|
|
6
|
+
import * as _rc_component_table_es_Footer_Row from '@rc-component/table/es/Footer/Row';
|
|
7
|
+
import * as _rc_component_table_es_Footer_Summary from '@rc-component/table/es/Footer/Summary';
|
|
8
|
+
import { TableProps as TableProps$1, ColumnType, ExpandableConfig, Reference } from '@rc-component/table';
|
|
5
9
|
import { ToastManagerAddOptions, ToastManagerUpdateOptions, ToastObject } from '@base-ui/react/toast';
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type Tokens = React.CSSProperties & Record<`--mt-${string}`, string | number>;
|
|
10
|
-
type Context = {
|
|
11
|
-
locale: Locale;
|
|
12
|
-
density: "compact" | "comfortable";
|
|
13
|
-
tokens?: Tokens;
|
|
14
|
-
};
|
|
15
|
-
declare const useMtone: () => Context;
|
|
16
|
-
declare function MtoneScope({ children, className, style, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
17
|
-
declare function MtoneProvider({ children, locale, density, tokens, }: Partial<Context> & {
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
}): React.JSX.Element;
|
|
20
|
-
type ButtonProps = Omit<React.ComponentPropsWithoutRef<typeof Button$1>, "className"> & {
|
|
21
|
-
className?: string;
|
|
22
|
-
variant?: "blue" | "solid" | "outline" | "soft" | "ghost";
|
|
23
|
-
size?: "sm" | "md" | "lg";
|
|
24
|
-
danger?: boolean;
|
|
25
|
-
loading?: boolean;
|
|
26
|
-
icon?: React.ReactNode;
|
|
27
|
-
};
|
|
28
|
-
declare const Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.ButtonProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
29
|
-
className?: string;
|
|
30
|
-
variant?: "blue" | "solid" | "outline" | "soft" | "ghost";
|
|
31
|
-
size?: "sm" | "md" | "lg";
|
|
32
|
-
danger?: boolean;
|
|
33
|
-
loading?: boolean;
|
|
34
|
-
icon?: React.ReactNode;
|
|
35
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
36
|
-
declare const IconButton: React.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.ButtonProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
37
|
-
className?: string;
|
|
38
|
-
variant?: "blue" | "solid" | "outline" | "soft" | "ghost";
|
|
39
|
-
size?: "sm" | "md" | "lg";
|
|
40
|
-
danger?: boolean;
|
|
41
|
-
loading?: boolean;
|
|
42
|
-
icon?: React.ReactNode;
|
|
43
|
-
} & {
|
|
44
|
-
"aria-label": string;
|
|
45
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
46
|
-
declare const ButtonGroup: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
47
|
-
declare const Input: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
48
|
-
declare const Textarea: React.ForwardRefExoticComponent<React.TextareaHTMLAttributes<HTMLTextAreaElement> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
49
|
-
declare const SearchInput: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
50
|
-
declare function FormField({ label, error, description, required, children, }: {
|
|
51
|
-
label: React.ReactNode;
|
|
52
|
-
error?: React.ReactNode;
|
|
53
|
-
description?: React.ReactNode;
|
|
11
|
+
type FormValues = Record<string, unknown>;
|
|
12
|
+
interface FormRule {
|
|
54
13
|
required?: boolean;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
declare const Form: ({ className, ...p }: React.FormHTMLAttributes<HTMLFormElement>) => React.JSX.Element;
|
|
58
|
-
type Tone = "neutral" | "blue" | "green" | "orange" | "red" | "purple";
|
|
59
|
-
declare function Badge({ children, tone, onRemove, className, ...p }: React.HTMLAttributes<HTMLSpanElement> & {
|
|
60
|
-
tone?: Tone;
|
|
61
|
-
onRemove?: () => void;
|
|
62
|
-
}): React.JSX.Element;
|
|
63
|
-
declare const Status: ({ children, tone, }: {
|
|
64
|
-
children: React.ReactNode;
|
|
65
|
-
tone?: Tone;
|
|
66
|
-
}) => React.JSX.Element;
|
|
67
|
-
declare function Avatar({ src, name, size, }: {
|
|
68
|
-
src?: string;
|
|
69
|
-
name?: string;
|
|
70
|
-
size?: number;
|
|
71
|
-
}): React.JSX.Element;
|
|
72
|
-
declare function AvatarGroup({ items, max, }: {
|
|
73
|
-
items: {
|
|
74
|
-
name: string;
|
|
75
|
-
src?: string;
|
|
76
|
-
}[];
|
|
14
|
+
type?: "string" | "number" | "boolean" | "array" | "email" | "url" | "integer";
|
|
15
|
+
min?: number;
|
|
77
16
|
max?: number;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
declare function Alert({ tone, title, children, onClose, }: {
|
|
114
|
-
tone?: "info" | "success" | "warning" | "error";
|
|
115
|
-
title?: React.ReactNode;
|
|
116
|
-
children?: React.ReactNode;
|
|
117
|
-
onClose?: () => void;
|
|
118
|
-
}): React.JSX.Element;
|
|
119
|
-
declare function Empty({ title, description, action, }: {
|
|
120
|
-
title?: React.ReactNode;
|
|
121
|
-
description?: React.ReactNode;
|
|
122
|
-
action?: React.ReactNode;
|
|
123
|
-
}): React.JSX.Element;
|
|
124
|
-
declare const Skeleton: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
125
|
-
declare function Spinner({ label }: {
|
|
126
|
-
label?: string;
|
|
127
|
-
}): React.JSX.Element;
|
|
17
|
+
len?: number;
|
|
18
|
+
pattern?: RegExp;
|
|
19
|
+
whitespace?: boolean;
|
|
20
|
+
message?: string;
|
|
21
|
+
validator?: (rule: FormRule, value: unknown, values: FormValues) => void | string | Promise<void | string>;
|
|
22
|
+
}
|
|
23
|
+
interface FormFieldError {
|
|
24
|
+
name: string;
|
|
25
|
+
errors: string[];
|
|
26
|
+
}
|
|
27
|
+
interface FormValidationError {
|
|
28
|
+
values: FormValues;
|
|
29
|
+
errorFields: FormFieldError[];
|
|
30
|
+
outOfDate: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface FieldRegistration {
|
|
33
|
+
rules?: FormRule[];
|
|
34
|
+
initialValue?: unknown;
|
|
35
|
+
}
|
|
36
|
+
interface FormInstance {
|
|
37
|
+
getFieldValue(name: string): unknown;
|
|
38
|
+
getFieldsValue(): FormValues;
|
|
39
|
+
setFieldValue(name: string, value: unknown): void;
|
|
40
|
+
setFieldsValue(values: FormValues): void;
|
|
41
|
+
getFieldError(name: string): string[];
|
|
42
|
+
getFieldsError(names?: string[]): FormFieldError[];
|
|
43
|
+
isFieldValidating(name: string): boolean;
|
|
44
|
+
validateFields(names?: string[]): Promise<FormValues>;
|
|
45
|
+
resetFields(names?: string[]): void;
|
|
46
|
+
subscribe(listener: () => void): () => void;
|
|
47
|
+
getSnapshot(): number;
|
|
48
|
+
register(name: string, config: FieldRegistration): () => void;
|
|
49
|
+
/** Updates reset defaults; only absent values are initialized, never edited values. */
|
|
50
|
+
setInitialValues(values: FormValues): void;
|
|
51
|
+
}
|
|
128
52
|
|
|
129
|
-
type
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
53
|
+
type FormValidateTrigger = "onChange" | "onBlur" | ("onChange" | "onBlur")[] | false;
|
|
54
|
+
declare function useForm(): [FormInstance];
|
|
55
|
+
interface FormFieldProps {
|
|
56
|
+
label: React__default.ReactNode;
|
|
57
|
+
error?: React__default.ReactNode;
|
|
58
|
+
description?: React__default.ReactNode;
|
|
59
|
+
required?: boolean;
|
|
60
|
+
children: React__default.ReactElement;
|
|
61
|
+
/** Flat field key. Omit to retain manual error/controlled-value behavior. */
|
|
62
|
+
name?: string;
|
|
63
|
+
rules?: FormRule[];
|
|
64
|
+
initialValue?: unknown;
|
|
65
|
+
validateTrigger?: FormValidateTrigger;
|
|
66
|
+
valuePropName?: string;
|
|
67
|
+
trigger?: string;
|
|
68
|
+
getValueFromEvent?: (...args: any[]) => unknown;
|
|
69
|
+
}
|
|
70
|
+
declare function FormField({ label, error, description, required, children, name, rules, initialValue, validateTrigger, valuePropName, trigger: triggerProp, getValueFromEvent }: FormFieldProps): React__default.JSX.Element;
|
|
71
|
+
interface FormProps extends React__default.FormHTMLAttributes<HTMLFormElement> {
|
|
72
|
+
form?: FormInstance;
|
|
73
|
+
initialValues?: FormValues;
|
|
74
|
+
validateTrigger?: FormValidateTrigger;
|
|
75
|
+
onFinish?: (values: FormValues) => void;
|
|
76
|
+
onFinishFailed?: (error: FormValidationError) => void;
|
|
77
|
+
onValuesChange?: (changed: FormValues, values: FormValues) => void;
|
|
78
|
+
}
|
|
79
|
+
declare function FormRoot({ form: supplied, initialValues, validateTrigger, onFinish, onFinishFailed, onValuesChange, className, onSubmit, onReset, noValidate, children, ...props }: FormProps): React__default.JSX.Element;
|
|
80
|
+
declare const Form: typeof FormRoot & {
|
|
81
|
+
useForm: typeof useForm;
|
|
82
|
+
Item: typeof FormField;
|
|
139
83
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
84
|
+
|
|
85
|
+
type AvatarBreakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
86
|
+
type AvatarSize = number | "sm" | "md" | "lg" | "small" | "medium" | "large" | Partial<Record<AvatarBreakpoint, number>>;
|
|
87
|
+
interface AvatarProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "onError" | "children"> {
|
|
88
|
+
name?: string;
|
|
89
|
+
src?: string | React.ReactElement;
|
|
90
|
+
srcSet?: string;
|
|
91
|
+
alt?: string;
|
|
92
|
+
crossOrigin?: React.ImgHTMLAttributes<HTMLImageElement>["crossOrigin"];
|
|
93
|
+
draggable?: React.ImgHTMLAttributes<HTMLImageElement>["draggable"];
|
|
94
|
+
onError?: (event: React.SyntheticEvent<HTMLImageElement>) => boolean | void;
|
|
143
95
|
icon?: React.ReactNode;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
items
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}): React.JSX.Element;
|
|
160
|
-
declare const
|
|
96
|
+
children?: React.ReactNode;
|
|
97
|
+
size?: AvatarSize;
|
|
98
|
+
shape?: "circle" | "square";
|
|
99
|
+
gap?: number;
|
|
100
|
+
}
|
|
101
|
+
interface AvatarGroupProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
102
|
+
items?: AvatarProps[];
|
|
103
|
+
max?: number | {
|
|
104
|
+
count?: number;
|
|
105
|
+
style?: React.CSSProperties;
|
|
106
|
+
};
|
|
107
|
+
size?: AvatarSize;
|
|
108
|
+
shape?: "circle" | "square";
|
|
109
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
110
|
+
}
|
|
111
|
+
declare function AvatarGroup({ items, children, max, size, shape, side, className, ...props }: AvatarGroupProps): React.JSX.Element;
|
|
112
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>> & {
|
|
113
|
+
Group: typeof AvatarGroup;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
interface DividerProps extends React.HTMLAttributes<HTMLElement> {
|
|
117
|
+
orientation?: "horizontal" | "vertical";
|
|
118
|
+
variant?: "solid" | "dashed" | "dotted";
|
|
119
|
+
size?: "small" | "medium" | "large";
|
|
120
|
+
titlePlacement?: "start" | "center" | "end";
|
|
121
|
+
plain?: boolean;
|
|
122
|
+
titleClassName?: string;
|
|
123
|
+
titleStyle?: React.CSSProperties;
|
|
124
|
+
}
|
|
125
|
+
/** A non-interactive separator. Titles are supported in horizontal orientation only. */
|
|
126
|
+
declare const Divider: React.ForwardRefExoticComponent<DividerProps & React.RefAttributes<HTMLDivElement | HTMLHRElement>>;
|
|
127
|
+
|
|
128
|
+
interface TabItem {
|
|
129
|
+
value: string;
|
|
130
|
+
label: React__default.ReactNode;
|
|
131
|
+
content: React__default.ReactNode;
|
|
132
|
+
disabled?: boolean;
|
|
133
|
+
icon?: React__default.ReactNode;
|
|
134
|
+
closable?: boolean;
|
|
135
|
+
closeLabel?: string;
|
|
136
|
+
forceRender?: boolean;
|
|
137
|
+
destroyOnHidden?: boolean;
|
|
138
|
+
}
|
|
139
|
+
interface TabsProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "children"> {
|
|
140
|
+
items: TabItem[];
|
|
141
|
+
value?: string;
|
|
142
|
+
defaultValue?: string;
|
|
143
|
+
onValueChange?: (value: string) => void;
|
|
144
|
+
label?: string;
|
|
145
|
+
placement?: "top" | "bottom" | "start" | "end";
|
|
146
|
+
variant?: "line" | "card" | "editable-card";
|
|
147
|
+
size?: "small" | "medium" | "large";
|
|
148
|
+
centered?: boolean;
|
|
149
|
+
gap?: number;
|
|
150
|
+
extraStart?: React__default.ReactNode;
|
|
151
|
+
extraEnd?: React__default.ReactNode;
|
|
152
|
+
activateOnFocus?: boolean;
|
|
153
|
+
destroyOnHidden?: boolean;
|
|
154
|
+
hideAdd?: boolean;
|
|
155
|
+
addIcon?: React__default.ReactNode;
|
|
156
|
+
addLabel?: string;
|
|
157
|
+
moreLabel?: string;
|
|
158
|
+
onEdit?: (action: "add" | "remove", value?: string) => void;
|
|
159
|
+
onTabClick?: (value: string, event: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
160
|
+
reorderable?: boolean;
|
|
161
|
+
onOrderChange?: (values: string[]) => void;
|
|
162
|
+
}
|
|
163
|
+
declare const Tabs: React__default.ForwardRefExoticComponent<TabsProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
161
164
|
|
|
162
165
|
type ToastPosition = "top-right" | "bottom-right" | "top-left" | "bottom-left" | "top-center" | "bottom-center" | "center" | "center-top";
|
|
163
166
|
type ToastType = "success" | "error" | "info" | "loading";
|
|
@@ -234,16 +237,30 @@ interface RadioGroupProps extends Common, ValueProps<string> {
|
|
|
234
237
|
orientation?: "horizontal" | "vertical";
|
|
235
238
|
}
|
|
236
239
|
declare function RadioGroup({ options, label, className, orientation, ...props }: RadioGroupProps): React__default.JSX.Element;
|
|
237
|
-
interface
|
|
240
|
+
interface FieldControlProps {
|
|
241
|
+
id?: string;
|
|
242
|
+
"aria-invalid"?: React__default.AriaAttributes["aria-invalid"];
|
|
243
|
+
"aria-describedby"?: string;
|
|
244
|
+
"aria-labelledby"?: string;
|
|
245
|
+
"aria-busy"?: boolean;
|
|
246
|
+
onBlur?: React__default.FocusEventHandler<HTMLElement>;
|
|
247
|
+
}
|
|
248
|
+
interface SelectProps extends Common, ValueProps<string | null>, OpenProps, FieldControlProps {
|
|
238
249
|
options: Option[];
|
|
239
250
|
placeholder?: string;
|
|
240
251
|
}
|
|
241
|
-
declare function Select({ options, label, placeholder, className, ...props }: SelectProps): React__default.JSX.Element;
|
|
242
|
-
|
|
252
|
+
declare function Select({ options, label, placeholder, className, id, onBlur, "aria-invalid": invalid, "aria-describedby": describedBy, "aria-labelledby": labelledBy, "aria-busy": busy, ...props }: SelectProps): React__default.JSX.Element;
|
|
253
|
+
declare namespace Select {
|
|
254
|
+
var formValueType: "nullable";
|
|
255
|
+
}
|
|
256
|
+
interface MultiSelectProps extends Common, ValueProps<string[]>, OpenProps, FieldControlProps {
|
|
243
257
|
options: Option[];
|
|
244
258
|
placeholder?: string;
|
|
245
259
|
}
|
|
246
|
-
declare function MultiSelect({ options, label, placeholder, className, ...props }: MultiSelectProps): React__default.JSX.Element;
|
|
260
|
+
declare function MultiSelect({ options, label, placeholder, className, id, onBlur, "aria-invalid": invalid, "aria-describedby": describedBy, "aria-labelledby": labelledBy, "aria-busy": busy, ...props }: MultiSelectProps): React__default.JSX.Element;
|
|
261
|
+
declare namespace MultiSelect {
|
|
262
|
+
var formValueType: "array";
|
|
263
|
+
}
|
|
247
264
|
interface SliderProps extends Common, ValueProps<number> {
|
|
248
265
|
min?: number;
|
|
249
266
|
max?: number;
|
|
@@ -257,14 +274,7 @@ interface NumberInputProps extends Common, Omit<ValueProps<number | null>, "defa
|
|
|
257
274
|
step?: number;
|
|
258
275
|
}
|
|
259
276
|
declare function NumberInput({ label, className, ...props }: NumberInputProps): React__default.JSX.Element;
|
|
260
|
-
|
|
261
|
-
content: React__default.ReactNode;
|
|
262
|
-
}
|
|
263
|
-
interface TabsProps extends ValueProps<string> {
|
|
264
|
-
items: TabItem[];
|
|
265
|
-
className?: string;
|
|
266
|
-
}
|
|
267
|
-
declare function Tabs({ items, className, onValueChange, defaultValue, ...props }: TabsProps): React__default.JSX.Element;
|
|
277
|
+
|
|
268
278
|
declare function Segmented({ options, label, className, ...props }: RadioGroupProps): React__default.JSX.Element;
|
|
269
279
|
interface MenuItem {
|
|
270
280
|
icon?: React__default.ReactNode;
|
|
@@ -294,7 +304,7 @@ declare function Popover({ trigger, content, title, side, ...props }: PopoverPro
|
|
|
294
304
|
declare function Tooltip({ children, content, side, ...props }: Omit<PopoverProps, "trigger" | "title"> & {
|
|
295
305
|
children: React__default.ReactElement;
|
|
296
306
|
}): React__default.JSX.Element;
|
|
297
|
-
interface
|
|
307
|
+
interface DialogFrameProps extends OpenProps {
|
|
298
308
|
title: React__default.ReactNode;
|
|
299
309
|
description?: React__default.ReactNode;
|
|
300
310
|
children?: React__default.ReactNode;
|
|
@@ -302,83 +312,633 @@ interface ModalProps extends OpenProps {
|
|
|
302
312
|
trigger?: React__default.ReactElement;
|
|
303
313
|
className?: string;
|
|
304
314
|
}
|
|
305
|
-
|
|
306
|
-
|
|
315
|
+
interface DialogProps extends DialogFrameProps {
|
|
316
|
+
/** Whether outside clicks are blocked from dismissing the dialog. Does not change focus trapping, scroll locking, Escape, or the close button. @default true */
|
|
317
|
+
modal?: boolean;
|
|
318
|
+
}
|
|
319
|
+
declare function Dialog({ modal, title, description, children, footer, trigger, className, ...props }: DialogProps): React__default.JSX.Element;
|
|
320
|
+
/** @deprecated Use DialogProps instead. */
|
|
321
|
+
type ModalProps = DialogProps;
|
|
322
|
+
/** @deprecated Use Dialog instead. */
|
|
323
|
+
declare const Modal: typeof Dialog;
|
|
324
|
+
interface ConfirmDialogProps extends DialogFrameProps {
|
|
307
325
|
onConfirm?: () => void | Promise<void>;
|
|
308
326
|
confirmText?: string;
|
|
309
327
|
cancelText?: string;
|
|
310
328
|
danger?: boolean;
|
|
311
329
|
}
|
|
312
330
|
declare function ConfirmDialog({ title, description, children, trigger, confirmText, cancelText, onConfirm, danger, open, defaultOpen, onOpenChange, }: ConfirmDialogProps): React__default.JSX.Element;
|
|
313
|
-
declare function Drawer({ title, description, children, footer, trigger, className, ...props }:
|
|
331
|
+
declare function Drawer({ title, description, children, footer, trigger, className, ...props }: DialogFrameProps): React__default.JSX.Element;
|
|
314
332
|
|
|
315
|
-
type
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
333
|
+
type CardSemantic = "root" | "header" | "title" | "extra" | "cover" | "body" | "actions" | "tabs";
|
|
334
|
+
type CardSemanticValue<K extends string, V, P> = Partial<Record<K, V>> | ((info: {
|
|
335
|
+
props: P;
|
|
336
|
+
}) => Partial<Record<K, V>>);
|
|
337
|
+
interface CardTokens {
|
|
338
|
+
bodyPadding?: number | string;
|
|
339
|
+
bodyPaddingSM?: number | string;
|
|
340
|
+
headerPadding?: number | string;
|
|
341
|
+
headerPaddingSM?: number | string;
|
|
342
|
+
headerHeight?: number | string;
|
|
343
|
+
headerHeightSM?: number | string;
|
|
344
|
+
headerFontSize?: number | string;
|
|
345
|
+
headerFontSizeSM?: number | string;
|
|
346
|
+
headerBg?: string;
|
|
347
|
+
actionsBg?: string;
|
|
348
|
+
actionsPadding?: number | string;
|
|
349
|
+
borderRadius?: number | string;
|
|
350
|
+
gridMinWidth?: number | string;
|
|
351
|
+
}
|
|
352
|
+
interface CardTabItem {
|
|
324
353
|
key: string;
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
354
|
+
label: React.ReactNode;
|
|
355
|
+
content?: React.ReactNode;
|
|
356
|
+
disabled?: boolean;
|
|
357
|
+
}
|
|
358
|
+
interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
359
|
+
title?: React.ReactNode;
|
|
360
|
+
/** Native HTML tooltip, formerly supplied through title. */
|
|
361
|
+
htmlTitle?: string;
|
|
362
|
+
extra?: React.ReactNode;
|
|
363
|
+
cover?: React.ReactNode;
|
|
364
|
+
actions?: React.ReactNode[];
|
|
365
|
+
loading?: boolean;
|
|
366
|
+
loadingLabel?: string;
|
|
367
|
+
size?: "medium" | "small";
|
|
368
|
+
variant?: "outlined" | "borderless";
|
|
369
|
+
hoverable?: boolean;
|
|
370
|
+
type?: "inner";
|
|
371
|
+
tabList?: CardTabItem[];
|
|
372
|
+
activeTabKey?: string;
|
|
373
|
+
defaultActiveTabKey?: string;
|
|
374
|
+
onTabChange?: (key: string) => void;
|
|
375
|
+
tabBarExtraContent?: React.ReactNode;
|
|
376
|
+
tabProps?: Pick<TabsProps, "className">;
|
|
377
|
+
classNames?: CardSemanticValue<CardSemantic, string, CardProps>;
|
|
378
|
+
styles?: CardSemanticValue<CardSemantic, React.CSSProperties, CardProps>;
|
|
379
|
+
tokens?: CardTokens;
|
|
380
|
+
}
|
|
381
|
+
declare function CardRoot(props: CardProps): React.JSX.Element;
|
|
382
|
+
type CardMetaSemantic = "root" | "section" | "avatar" | "title" | "description";
|
|
383
|
+
interface CardMetaProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
384
|
+
avatar?: React.ReactNode;
|
|
385
|
+
title?: React.ReactNode;
|
|
386
|
+
htmlTitle?: string;
|
|
387
|
+
description?: React.ReactNode;
|
|
388
|
+
classNames?: CardSemanticValue<CardMetaSemantic, string, CardMetaProps>;
|
|
389
|
+
styles?: CardSemanticValue<CardMetaSemantic, React.CSSProperties, CardMetaProps>;
|
|
390
|
+
}
|
|
391
|
+
declare function CardMeta(props: CardMetaProps): React.JSX.Element;
|
|
392
|
+
interface CardGridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
393
|
+
hoverable?: boolean;
|
|
394
|
+
}
|
|
395
|
+
declare function CardGrid({ hoverable, className, ...props }: CardGridProps): React.JSX.Element;
|
|
396
|
+
declare const Card: typeof CardRoot & {
|
|
397
|
+
Meta: typeof CardMeta;
|
|
398
|
+
Grid: typeof CardGrid;
|
|
330
399
|
};
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
400
|
+
|
|
401
|
+
declare const cn: (...v: (string | false | null | undefined)[]) => string;
|
|
402
|
+
type Locale = "zh" | "en";
|
|
403
|
+
type Tokens = React.CSSProperties & Record<`--mt-${string}`, string | number>;
|
|
404
|
+
type Context = {
|
|
405
|
+
locale: Locale;
|
|
406
|
+
density: "compact" | "comfortable";
|
|
407
|
+
tokens?: Tokens;
|
|
339
408
|
};
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
loading?: boolean;
|
|
347
|
-
onChange?: (state: TableState) => void;
|
|
348
|
-
sort?: TableState["sort"];
|
|
349
|
-
filters?: Record<string, string>;
|
|
350
|
-
selectable?: boolean;
|
|
351
|
-
selectedKeys?: React.Key[];
|
|
352
|
-
onSelectionChange?: (keys: React.Key[]) => void;
|
|
353
|
-
pagination?: false | {
|
|
354
|
-
pageSize?: number;
|
|
355
|
-
page?: number;
|
|
356
|
-
total?: number;
|
|
357
|
-
onPageChange?: (page: number) => void;
|
|
358
|
-
};
|
|
359
|
-
empty?: React.ReactNode;
|
|
409
|
+
declare const useMtone: () => Context;
|
|
410
|
+
declare function MtoneScope({ children, className, style, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
411
|
+
declare function MtoneProvider({ children, locale, density, tokens, }: Partial<Context> & {
|
|
412
|
+
children: React.ReactNode;
|
|
413
|
+
}): React.JSX.Element;
|
|
414
|
+
type ButtonProps = Omit<React.ComponentPropsWithoutRef<typeof Button$1>, "className"> & {
|
|
360
415
|
className?: string;
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
label: React.ReactNode;
|
|
366
|
-
children?: TreeItem[];
|
|
367
|
-
disabled?: boolean;
|
|
416
|
+
variant?: "blue" | "solid" | "outline" | "soft" | "ghost";
|
|
417
|
+
size?: "sm" | "md" | "lg";
|
|
418
|
+
danger?: boolean;
|
|
419
|
+
loading?: boolean;
|
|
368
420
|
icon?: React.ReactNode;
|
|
369
421
|
};
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
422
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.ButtonProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
423
|
+
className?: string;
|
|
424
|
+
variant?: "blue" | "solid" | "outline" | "soft" | "ghost";
|
|
425
|
+
size?: "sm" | "md" | "lg";
|
|
426
|
+
danger?: boolean;
|
|
427
|
+
loading?: boolean;
|
|
428
|
+
icon?: React.ReactNode;
|
|
429
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
430
|
+
declare const IconButton: React.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.ButtonProps, "ref"> & React.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
431
|
+
className?: string;
|
|
432
|
+
variant?: "blue" | "solid" | "outline" | "soft" | "ghost";
|
|
433
|
+
size?: "sm" | "md" | "lg";
|
|
434
|
+
danger?: boolean;
|
|
435
|
+
loading?: boolean;
|
|
436
|
+
icon?: React.ReactNode;
|
|
437
|
+
} & {
|
|
438
|
+
"aria-label": string;
|
|
439
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
440
|
+
declare const ButtonGroup: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
441
|
+
declare const Input: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
442
|
+
declare const Textarea: React.ForwardRefExoticComponent<React.TextareaHTMLAttributes<HTMLTextAreaElement> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
443
|
+
declare const SearchInput: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
444
|
+
|
|
445
|
+
type Tone = "neutral" | "blue" | "green" | "orange" | "red" | "purple";
|
|
446
|
+
declare function Badge({ children, tone, onRemove, className, ...p }: React.HTMLAttributes<HTMLSpanElement> & {
|
|
447
|
+
tone?: Tone;
|
|
448
|
+
onRemove?: () => void;
|
|
449
|
+
}): React.JSX.Element;
|
|
450
|
+
declare const Status: ({ children, tone, }: {
|
|
451
|
+
children: React.ReactNode;
|
|
452
|
+
tone?: Tone;
|
|
453
|
+
}) => React.JSX.Element;
|
|
454
|
+
|
|
455
|
+
declare function Progress({ value, label }: {
|
|
456
|
+
value: number;
|
|
457
|
+
label?: string;
|
|
458
|
+
}): React.JSX.Element;
|
|
459
|
+
declare const Text: ({ muted, className, ...p }: React.HTMLAttributes<HTMLSpanElement> & {
|
|
460
|
+
muted?: boolean;
|
|
461
|
+
}) => React.JSX.Element;
|
|
462
|
+
|
|
463
|
+
declare const List: ({ className, ...p }: React.HTMLAttributes<HTMLUListElement>) => React.JSX.Element;
|
|
464
|
+
declare function ListItem({ children, icon, description, actions, ...p }: React.LiHTMLAttributes<HTMLLIElement> & {
|
|
465
|
+
icon?: React.ReactNode;
|
|
466
|
+
description?: React.ReactNode;
|
|
467
|
+
actions?: React.ReactNode;
|
|
468
|
+
}): React.JSX.Element;
|
|
469
|
+
type DocumentItem = {
|
|
470
|
+
id: string;
|
|
471
|
+
title: string;
|
|
472
|
+
description?: string;
|
|
473
|
+
updatedAt?: string;
|
|
474
|
+
icon?: React.ReactNode;
|
|
475
|
+
onClick?: () => void;
|
|
476
|
+
};
|
|
477
|
+
declare function DocumentList({ items }: {
|
|
478
|
+
items: DocumentItem[];
|
|
479
|
+
}): React.JSX.Element;
|
|
480
|
+
declare function DocumentCard({ title, description, icon, updatedAt, onClick, }: DocumentItem): React.JSX.Element;
|
|
481
|
+
declare const PropertyList: ({ children }: {
|
|
482
|
+
children: React.ReactNode;
|
|
483
|
+
}) => React.JSX.Element;
|
|
484
|
+
declare const PropertyItem: ({ label, children, }: {
|
|
485
|
+
label: React.ReactNode;
|
|
486
|
+
children: React.ReactNode;
|
|
487
|
+
}) => React.JSX.Element;
|
|
488
|
+
declare function Alert({ tone, title, children, onClose, }: {
|
|
489
|
+
tone?: "info" | "success" | "warning" | "error";
|
|
490
|
+
title?: React.ReactNode;
|
|
491
|
+
children?: React.ReactNode;
|
|
492
|
+
onClose?: () => void;
|
|
493
|
+
}): React.JSX.Element;
|
|
494
|
+
declare function Empty({ title, description, action, }: {
|
|
495
|
+
title?: React.ReactNode;
|
|
496
|
+
description?: React.ReactNode;
|
|
497
|
+
action?: React.ReactNode;
|
|
498
|
+
}): React.JSX.Element;
|
|
499
|
+
declare const Skeleton: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
500
|
+
declare function Spinner({ label }: {
|
|
501
|
+
label?: string;
|
|
502
|
+
}): React.JSX.Element;
|
|
503
|
+
|
|
504
|
+
type SidebarProps = React.HTMLAttributes<HTMLElement> & {
|
|
505
|
+
header?: React.ReactNode | ((collapsed: boolean) => React.ReactNode);
|
|
506
|
+
footer?: React.ReactNode | ((collapsed: boolean) => React.ReactNode);
|
|
507
|
+
collapsePlacement?: "header" | "footer";
|
|
508
|
+
collapsible?: boolean;
|
|
509
|
+
collapsed?: boolean;
|
|
510
|
+
defaultCollapsed?: boolean;
|
|
511
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
512
|
+
collapseLabel?: string;
|
|
513
|
+
expandLabel?: string;
|
|
514
|
+
};
|
|
515
|
+
declare function Sidebar({ className, children, header, footer, collapsePlacement, collapsible, collapsed, defaultCollapsed, onCollapsedChange, collapseLabel, expandLabel, ...p }: SidebarProps): React.JSX.Element;
|
|
516
|
+
declare const NavItem: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
517
|
+
active?: boolean;
|
|
518
|
+
icon?: React.ReactNode;
|
|
519
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
520
|
+
declare function NavGroup({ label, children, }: {
|
|
521
|
+
label?: React.ReactNode;
|
|
522
|
+
children: React.ReactNode;
|
|
523
|
+
}): React.JSX.Element;
|
|
524
|
+
declare function Breadcrumb({ items, "aria-label": label, }: {
|
|
525
|
+
items: {
|
|
526
|
+
label: React.ReactNode;
|
|
527
|
+
href?: string;
|
|
528
|
+
}[];
|
|
529
|
+
"aria-label"?: string;
|
|
530
|
+
}): React.JSX.Element;
|
|
531
|
+
declare function FilterChip({ children, onRemove, }: {
|
|
532
|
+
children: React.ReactNode;
|
|
533
|
+
onRemove: () => void;
|
|
534
|
+
}): React.JSX.Element;
|
|
535
|
+
declare const FilterBar: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
536
|
+
|
|
537
|
+
type TableRef = Reference;
|
|
538
|
+
type SortOrder = "ascend" | "descend" | null;
|
|
539
|
+
type TableFilterValue = React.Key | boolean;
|
|
540
|
+
type TableFilters = Record<string, TableFilterValue[] | null>;
|
|
541
|
+
type TableState = {
|
|
542
|
+
sort?: {
|
|
543
|
+
key: string;
|
|
544
|
+
direction: "asc" | "desc";
|
|
545
|
+
} | null;
|
|
546
|
+
filters: Record<string, string>;
|
|
547
|
+
page: number;
|
|
548
|
+
pageSize: number;
|
|
549
|
+
};
|
|
550
|
+
type TableFilterItem = {
|
|
551
|
+
text: React.ReactNode;
|
|
552
|
+
value: TableFilterValue;
|
|
553
|
+
children?: TableFilterItem[];
|
|
554
|
+
};
|
|
555
|
+
type TableFilterDropdownProps = {
|
|
556
|
+
prefixCls: string;
|
|
557
|
+
selectedKeys: TableFilterValue[];
|
|
558
|
+
setSelectedKeys: (keys: TableFilterValue[]) => void;
|
|
559
|
+
confirm: (options?: {
|
|
560
|
+
closeDropdown?: boolean;
|
|
561
|
+
}) => void;
|
|
562
|
+
clearFilters: (options?: {
|
|
563
|
+
confirm?: boolean;
|
|
564
|
+
closeDropdown?: boolean;
|
|
565
|
+
}) => void;
|
|
566
|
+
close: () => void;
|
|
567
|
+
filters?: TableFilterItem[];
|
|
568
|
+
visible: boolean;
|
|
569
|
+
};
|
|
570
|
+
type TableSortResult<T> = {
|
|
571
|
+
column?: TableColumn<T>;
|
|
572
|
+
order?: SortOrder;
|
|
573
|
+
field?: TableColumn<T>["dataIndex"];
|
|
574
|
+
columnKey?: React.Key;
|
|
575
|
+
};
|
|
576
|
+
type TableColumnTitleProps<T> = {
|
|
577
|
+
sortColumns: {
|
|
578
|
+
column: TableColumn<T>;
|
|
579
|
+
order: SortOrder;
|
|
580
|
+
}[];
|
|
581
|
+
filters: TableFilters;
|
|
582
|
+
};
|
|
583
|
+
type TableColumn<T> = Omit<ColumnType<T>, "title" | "dataIndex"> & {
|
|
584
|
+
dataIndex?: keyof T | string | number | (string | number)[];
|
|
585
|
+
title?: React.ReactNode | ((props: TableColumnTitleProps<T>) => React.ReactNode);
|
|
586
|
+
children?: TableColumn<T>[];
|
|
587
|
+
sortable?: boolean;
|
|
588
|
+
filterable?: boolean;
|
|
589
|
+
sorter?: boolean | ((a: T, b: T, order?: SortOrder) => number) | {
|
|
590
|
+
compare?: (a: T, b: T, order?: SortOrder) => number;
|
|
591
|
+
multiple?: number;
|
|
592
|
+
};
|
|
593
|
+
sortOrder?: SortOrder;
|
|
594
|
+
defaultSortOrder?: SortOrder;
|
|
595
|
+
sortDirections?: Exclude<SortOrder, null>[];
|
|
596
|
+
sortIcon?: (props: {
|
|
597
|
+
sortOrder: SortOrder;
|
|
598
|
+
}) => React.ReactNode;
|
|
599
|
+
showSorterTooltip?: boolean | {
|
|
600
|
+
title?: React.ReactNode;
|
|
601
|
+
target?: "full-header" | "sorter-icon";
|
|
602
|
+
};
|
|
603
|
+
filters?: TableFilterItem[];
|
|
604
|
+
filteredValue?: TableFilterValue[] | null;
|
|
605
|
+
defaultFilteredValue?: TableFilterValue[] | null;
|
|
606
|
+
filtered?: boolean;
|
|
607
|
+
filterMultiple?: boolean;
|
|
608
|
+
filterMode?: "menu" | "tree";
|
|
609
|
+
filterSearch?: boolean | ((input: string, item: TableFilterItem) => boolean);
|
|
610
|
+
filterResetToDefaultFilteredValue?: boolean;
|
|
611
|
+
filterOnClose?: boolean;
|
|
612
|
+
filterDropdown?: React.ReactNode | ((props: TableFilterDropdownProps) => React.ReactNode);
|
|
613
|
+
filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode);
|
|
614
|
+
filterDropdownProps?: {
|
|
615
|
+
open?: boolean;
|
|
616
|
+
onOpenChange?: (open: boolean) => void;
|
|
617
|
+
className?: string;
|
|
618
|
+
style?: React.CSSProperties;
|
|
619
|
+
};
|
|
620
|
+
onFilter?: (value: TableFilterValue, record: T) => boolean;
|
|
621
|
+
responsive?: ("xs" | "sm" | "md" | "lg" | "xl" | "xxl")[];
|
|
622
|
+
};
|
|
623
|
+
type TableColumnsType<T> = TableColumn<T>[];
|
|
624
|
+
type TableSelectionType = "all" | "none" | "invert" | "single" | "multiple";
|
|
625
|
+
type TableRowSelection<T> = {
|
|
626
|
+
type?: "checkbox" | "radio";
|
|
627
|
+
selectedRowKeys?: React.Key[];
|
|
628
|
+
defaultSelectedRowKeys?: React.Key[];
|
|
629
|
+
onChange?: (keys: React.Key[], rows: T[], info: {
|
|
630
|
+
type: TableSelectionType;
|
|
631
|
+
}) => void;
|
|
632
|
+
onSelect?: (record: T, selected: boolean, rows: T[], event: Event) => void;
|
|
633
|
+
onSelectAll?: (selected: boolean, rows: T[], changeRows: T[]) => void;
|
|
634
|
+
onSelectInvert?: (keys: React.Key[]) => void;
|
|
635
|
+
onSelectNone?: () => void;
|
|
636
|
+
onSelectMultiple?: (selected: boolean, rows: T[], changeRows: T[]) => void;
|
|
637
|
+
getCheckboxProps?: (record: T) => Omit<React.InputHTMLAttributes<HTMLInputElement>, "checked" | "defaultChecked">;
|
|
638
|
+
getTitleCheckboxProps?: () => Omit<React.InputHTMLAttributes<HTMLInputElement>, "checked" | "defaultChecked">;
|
|
639
|
+
checkStrictly?: boolean;
|
|
640
|
+
preserveSelectedRowKeys?: boolean;
|
|
641
|
+
hideSelectAll?: boolean;
|
|
642
|
+
columnTitle?: React.ReactNode | ((original: React.ReactNode) => React.ReactNode);
|
|
643
|
+
columnWidth?: number | string;
|
|
644
|
+
align?: "left" | "right" | "center";
|
|
645
|
+
fixed?: boolean;
|
|
646
|
+
renderCell?: (checked: boolean, record: T, index: number, origin: React.ReactNode) => React.ReactNode;
|
|
647
|
+
onCell?: ColumnType<T>["onCell"];
|
|
648
|
+
selections?: boolean | ("all" | "none" | "invert" | {
|
|
649
|
+
key: string;
|
|
650
|
+
text: React.ReactNode;
|
|
651
|
+
onSelect: (keys: React.Key[]) => void;
|
|
652
|
+
})[];
|
|
653
|
+
};
|
|
654
|
+
type TablePagination = {
|
|
655
|
+
page?: number;
|
|
656
|
+
current?: number;
|
|
657
|
+
defaultCurrent?: number;
|
|
658
|
+
pageSize?: number;
|
|
659
|
+
defaultPageSize?: number;
|
|
660
|
+
total?: number;
|
|
661
|
+
onPageChange?: (page: number) => void;
|
|
662
|
+
onChange?: (page: number, size: number) => void;
|
|
663
|
+
onShowSizeChange?: (page: number, size: number) => void;
|
|
664
|
+
showSizeChanger?: boolean;
|
|
665
|
+
pageSizeOptions?: (number | string)[];
|
|
666
|
+
showQuickJumper?: boolean;
|
|
667
|
+
hideOnSinglePage?: boolean;
|
|
668
|
+
simple?: boolean;
|
|
669
|
+
disabled?: boolean;
|
|
670
|
+
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
|
671
|
+
itemRender?: (page: number, type: "page" | "prev" | "next", original: React.ReactNode) => React.ReactNode;
|
|
672
|
+
position?: ("topLeft" | "topCenter" | "topRight" | "bottomLeft" | "bottomCenter" | "bottomRight" | "none")[];
|
|
673
|
+
placement?: ("topStart" | "topCenter" | "topEnd" | "bottomStart" | "bottomCenter" | "bottomEnd" | "none")[];
|
|
379
674
|
className?: string;
|
|
675
|
+
style?: React.CSSProperties;
|
|
676
|
+
};
|
|
677
|
+
type TableLocale = {
|
|
678
|
+
emptyText?: React.ReactNode;
|
|
679
|
+
filterTitle?: string;
|
|
680
|
+
filterConfirm?: string;
|
|
681
|
+
filterReset?: string;
|
|
682
|
+
filterSearchPlaceholder?: string;
|
|
683
|
+
selectAll?: string;
|
|
684
|
+
selectInvert?: string;
|
|
685
|
+
selectNone?: string;
|
|
686
|
+
selectionAll?: string;
|
|
687
|
+
selectRow?: string | ((key: React.Key) => string);
|
|
688
|
+
selectionActions?: string;
|
|
689
|
+
selectionPlaceholder?: string;
|
|
690
|
+
sortTitle?: string;
|
|
691
|
+
triggerAsc?: string;
|
|
692
|
+
triggerDesc?: string;
|
|
693
|
+
cancelSort?: string;
|
|
694
|
+
expand?: string;
|
|
695
|
+
collapse?: string;
|
|
696
|
+
};
|
|
697
|
+
type RcSemantics = NonNullable<TableProps$1["classNames"]>;
|
|
698
|
+
type RcStyles = NonNullable<TableProps$1["styles"]>;
|
|
699
|
+
type TableClassNames = RcSemantics & {
|
|
700
|
+
root?: string;
|
|
701
|
+
pagination?: string;
|
|
702
|
+
};
|
|
703
|
+
type TableStyles = RcStyles & {
|
|
704
|
+
root?: React.CSSProperties;
|
|
705
|
+
pagination?: React.CSSProperties;
|
|
706
|
+
};
|
|
707
|
+
type TableProps<T> = Omit<TableProps$1<T>, "data" | "columns" | "children" | "onChange" | "scroll" | "classNames" | "styles" | "emptyText"> & {
|
|
708
|
+
data?: T[];
|
|
709
|
+
dataSource?: T[];
|
|
710
|
+
columns?: TableColumn<T>[];
|
|
711
|
+
children?: React.ReactNode;
|
|
712
|
+
column?: Partial<TableColumn<T>>;
|
|
713
|
+
manual?: boolean;
|
|
714
|
+
loading?: boolean | {
|
|
715
|
+
spinning?: boolean;
|
|
716
|
+
tip?: React.ReactNode;
|
|
717
|
+
delay?: number;
|
|
718
|
+
indicator?: React.ReactNode;
|
|
719
|
+
};
|
|
720
|
+
onChange?: (state: TableState) => void;
|
|
721
|
+
onTableChange?: (pagination: TablePagination, filters: TableFilters, sorter: TableSortResult<T> | TableSortResult<T>[], extra: {
|
|
722
|
+
currentDataSource: T[];
|
|
723
|
+
action: "paginate" | "sort" | "filter";
|
|
724
|
+
}) => void;
|
|
725
|
+
sort?: TableState["sort"];
|
|
726
|
+
filters?: Record<string, string>;
|
|
727
|
+
selectable?: boolean;
|
|
728
|
+
selectedKeys?: React.Key[];
|
|
729
|
+
onSelectionChange?: (keys: React.Key[]) => void;
|
|
730
|
+
rowSelection?: TableRowSelection<T>;
|
|
731
|
+
pagination?: false | TablePagination;
|
|
732
|
+
empty?: React.ReactNode;
|
|
733
|
+
locale?: TableLocale;
|
|
734
|
+
size?: "small" | "middle" | "medium" | "large";
|
|
735
|
+
bordered?: boolean;
|
|
736
|
+
sortDirections?: Exclude<SortOrder, null>[];
|
|
737
|
+
showSorterTooltip?: TableColumn<T>["showSorterTooltip"];
|
|
738
|
+
getPopupContainer?: (trigger: HTMLElement) => HTMLElement;
|
|
739
|
+
scroll?: NonNullable<TableProps$1<T>["scroll"]> & {
|
|
740
|
+
scrollToFirstRowOnChange?: boolean;
|
|
741
|
+
};
|
|
742
|
+
virtual?: boolean;
|
|
743
|
+
virtualItemHeight?: number;
|
|
744
|
+
classNames?: TableClassNames | ((info: {
|
|
745
|
+
props: TableProps<T>;
|
|
746
|
+
}) => TableClassNames);
|
|
747
|
+
styles?: TableStyles | ((info: {
|
|
748
|
+
props: TableProps<T>;
|
|
749
|
+
}) => TableStyles);
|
|
750
|
+
};
|
|
751
|
+
type TableExpandableConfig<T> = ExpandableConfig<T>;
|
|
752
|
+
|
|
753
|
+
declare function Column<T>(_props: TableColumn<T>): null;
|
|
754
|
+
declare function ColumnGroup<T>(_props: Omit<TableColumn<T>, "children"> & {
|
|
755
|
+
children: React.ReactNode;
|
|
756
|
+
}): null;
|
|
757
|
+
declare const Table: (<T>(props: TableProps<T> & React.RefAttributes<Reference>) => React.ReactElement) & {
|
|
758
|
+
Column: typeof Column;
|
|
759
|
+
ColumnGroup: typeof ColumnGroup;
|
|
760
|
+
Summary: React.FC<React.PropsWithChildren<_rc_component_table_es_Footer_Summary.SummaryProps>> & {
|
|
761
|
+
Row: React.FC<React.PropsWithChildren<_rc_component_table_es_Footer_Row.FooterRowProps>>;
|
|
762
|
+
Cell: React.FC<React.PropsWithChildren<_rc_component_table_es_Footer_Cell.SummaryCellProps>>;
|
|
763
|
+
};
|
|
764
|
+
EXPAND_COLUMN: {};
|
|
765
|
+
SELECTION_COLUMN: Readonly<{
|
|
766
|
+
key: "__mt_selection_column";
|
|
767
|
+
}>;
|
|
768
|
+
SELECTION_ALL: "all";
|
|
769
|
+
SELECTION_INVERT: "invert";
|
|
770
|
+
SELECTION_NONE: "none";
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
type TreeKey = string | number;
|
|
774
|
+
/** Legacy items retain id/label; normalized treeData uses the same shape. */
|
|
775
|
+
type TreeItem = {
|
|
776
|
+
id: TreeKey;
|
|
777
|
+
label: React.ReactNode;
|
|
778
|
+
children?: TreeItem[];
|
|
779
|
+
disabled?: boolean;
|
|
780
|
+
disableCheckbox?: boolean;
|
|
781
|
+
checkable?: boolean;
|
|
782
|
+
selectable?: boolean;
|
|
783
|
+
isLeaf?: boolean;
|
|
784
|
+
icon?: React.ReactNode | ((node: TreeItem) => React.ReactNode);
|
|
785
|
+
[field: string]: unknown;
|
|
786
|
+
};
|
|
787
|
+
/** Data-node form; custom field mappings can also be supplied. */
|
|
788
|
+
type TreeNode = {
|
|
789
|
+
key: TreeKey;
|
|
790
|
+
title?: React.ReactNode;
|
|
791
|
+
children?: TreeNode[];
|
|
792
|
+
disabled?: boolean;
|
|
793
|
+
disableCheckbox?: boolean;
|
|
794
|
+
checkable?: boolean;
|
|
795
|
+
selectable?: boolean;
|
|
796
|
+
isLeaf?: boolean;
|
|
797
|
+
icon?: React.ReactNode | ((node: TreeItem) => React.ReactNode);
|
|
798
|
+
[field: string]: unknown;
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
type TreeCheckedKeys = TreeKey[] | {
|
|
802
|
+
checked: TreeKey[];
|
|
803
|
+
halfChecked: TreeKey[];
|
|
804
|
+
};
|
|
805
|
+
type TreeNodeInfo = {
|
|
806
|
+
node: TreeItem;
|
|
807
|
+
expanded: boolean;
|
|
808
|
+
selected: boolean;
|
|
809
|
+
checked: boolean;
|
|
810
|
+
loading: boolean;
|
|
811
|
+
};
|
|
812
|
+
type TreeDropInfo = {
|
|
813
|
+
event: React.DragEvent;
|
|
814
|
+
node: TreeItem;
|
|
815
|
+
dragNode: TreeItem;
|
|
816
|
+
dragNodesKeys: TreeKey[];
|
|
817
|
+
dropPosition: -1 | 0 | 1;
|
|
818
|
+
dropToGap: boolean;
|
|
380
819
|
};
|
|
381
|
-
|
|
820
|
+
type TreeRef = {
|
|
821
|
+
nativeElement: HTMLDivElement | null;
|
|
822
|
+
focus: () => void;
|
|
823
|
+
scrollTo: (options: {
|
|
824
|
+
key: TreeKey;
|
|
825
|
+
align?: "top" | "bottom" | "auto";
|
|
826
|
+
offset?: number;
|
|
827
|
+
autoExpand?: boolean;
|
|
828
|
+
}) => void;
|
|
829
|
+
};
|
|
830
|
+
interface TreeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "draggable" | "onSelect" | "onLoad" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragOver" | "onDragLeave" | "onDrop" | "onDoubleClick"> {
|
|
831
|
+
items?: TreeItem[];
|
|
832
|
+
treeData?: TreeNode[] | Record<string, unknown>[];
|
|
833
|
+
fieldNames?: {
|
|
834
|
+
key?: string;
|
|
835
|
+
title?: string;
|
|
836
|
+
children?: string;
|
|
837
|
+
};
|
|
838
|
+
value?: string;
|
|
839
|
+
defaultValue?: string;
|
|
840
|
+
onValueChange?: (value: string) => void;
|
|
841
|
+
expanded?: string[];
|
|
842
|
+
defaultExpanded?: string[];
|
|
843
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
844
|
+
selectedKeys?: TreeKey[];
|
|
845
|
+
defaultSelectedKeys?: TreeKey[];
|
|
846
|
+
multiple?: boolean;
|
|
847
|
+
selectable?: boolean;
|
|
848
|
+
expandedKeys?: TreeKey[];
|
|
849
|
+
defaultExpandedKeys?: TreeKey[];
|
|
850
|
+
defaultExpandAll?: boolean;
|
|
851
|
+
defaultExpandParent?: boolean;
|
|
852
|
+
autoExpandParent?: boolean;
|
|
853
|
+
onSelect?: (keys: TreeKey[], info: {
|
|
854
|
+
selected: boolean;
|
|
855
|
+
node: TreeItem;
|
|
856
|
+
selectedNodes: TreeItem[];
|
|
857
|
+
event: React.SyntheticEvent;
|
|
858
|
+
}) => void;
|
|
859
|
+
onExpand?: (keys: TreeKey[], info: {
|
|
860
|
+
expanded: boolean;
|
|
861
|
+
node: TreeItem;
|
|
862
|
+
}) => void;
|
|
863
|
+
checkable?: boolean;
|
|
864
|
+
checkStrictly?: boolean;
|
|
865
|
+
checkedKeys?: TreeCheckedKeys;
|
|
866
|
+
defaultCheckedKeys?: TreeKey[];
|
|
867
|
+
onCheck?: (keys: TreeCheckedKeys, info: {
|
|
868
|
+
checked: boolean;
|
|
869
|
+
node: TreeItem;
|
|
870
|
+
checkedNodes: TreeItem[];
|
|
871
|
+
halfCheckedKeys: TreeKey[];
|
|
872
|
+
event: React.SyntheticEvent;
|
|
873
|
+
}) => void;
|
|
874
|
+
disabled?: boolean;
|
|
875
|
+
label?: string;
|
|
876
|
+
blockNode?: boolean;
|
|
877
|
+
showLine?: boolean;
|
|
878
|
+
showIcon?: boolean;
|
|
879
|
+
icon?: React.ReactNode | ((info: TreeNodeInfo) => React.ReactNode);
|
|
880
|
+
switcherIcon?: React.ReactNode | ((info: TreeNodeInfo) => React.ReactNode);
|
|
881
|
+
switcherLoadingIcon?: React.ReactNode;
|
|
882
|
+
titleRender?: (node: TreeItem) => React.ReactNode;
|
|
883
|
+
filterTreeNode?: (node: TreeItem) => boolean;
|
|
884
|
+
loadData?: (node: TreeItem) => Promise<unknown>;
|
|
885
|
+
loadedKeys?: TreeKey[];
|
|
886
|
+
defaultLoadedKeys?: TreeKey[];
|
|
887
|
+
onLoad?: (keys: TreeKey[], info: {
|
|
888
|
+
node: TreeItem;
|
|
889
|
+
}) => void;
|
|
890
|
+
onLoadError?: (error: unknown, node: TreeItem) => void;
|
|
891
|
+
height?: number;
|
|
892
|
+
itemHeight?: number;
|
|
893
|
+
virtual?: boolean;
|
|
894
|
+
draggable?: boolean | ((node: TreeItem) => boolean);
|
|
895
|
+
allowDrop?: (info: {
|
|
896
|
+
dragNode: TreeItem;
|
|
897
|
+
dropNode: TreeItem;
|
|
898
|
+
dropPosition: -1 | 0 | 1;
|
|
899
|
+
}) => boolean;
|
|
900
|
+
onDragStart?: (info: {
|
|
901
|
+
event: React.DragEvent;
|
|
902
|
+
node: TreeItem;
|
|
903
|
+
}) => void;
|
|
904
|
+
onDragEnd?: (info: {
|
|
905
|
+
event: React.DragEvent;
|
|
906
|
+
node: TreeItem;
|
|
907
|
+
}) => void;
|
|
908
|
+
onDragEnter?: (info: {
|
|
909
|
+
event: React.DragEvent;
|
|
910
|
+
node: TreeItem;
|
|
911
|
+
expandedKeys: TreeKey[];
|
|
912
|
+
}) => void;
|
|
913
|
+
onDragOver?: (info: {
|
|
914
|
+
event: React.DragEvent;
|
|
915
|
+
node: TreeItem;
|
|
916
|
+
}) => void;
|
|
917
|
+
onDragLeave?: (info: {
|
|
918
|
+
event: React.DragEvent;
|
|
919
|
+
node: TreeItem;
|
|
920
|
+
}) => void;
|
|
921
|
+
onDrop?: (info: TreeDropInfo) => void;
|
|
922
|
+
onRightClick?: (info: {
|
|
923
|
+
event: React.MouseEvent;
|
|
924
|
+
node: TreeItem;
|
|
925
|
+
}) => void;
|
|
926
|
+
onDoubleClick?: (event: React.MouseEvent, node: TreeItem) => void;
|
|
927
|
+
/** Directory interaction without creating a separate data format. */ directory?: boolean;
|
|
928
|
+
expandAction?: false | "click" | "doubleClick";
|
|
929
|
+
}
|
|
930
|
+
declare const Tree: React.ForwardRefExoticComponent<TreeProps & React.RefAttributes<TreeRef>>;
|
|
931
|
+
declare const DirectoryTree: React.ForwardRefExoticComponent<TreeProps & React.RefAttributes<TreeRef>>;
|
|
932
|
+
|
|
933
|
+
type PaginationProps = {
|
|
934
|
+
total: number;
|
|
935
|
+
pageSize?: number;
|
|
936
|
+
page: number;
|
|
937
|
+
onPageChange: (page: number) => void;
|
|
938
|
+
className?: string;
|
|
939
|
+
};
|
|
940
|
+
declare function Pagination({ total, pageSize, page, onPageChange, className, }: PaginationProps): React.JSX.Element;
|
|
941
|
+
|
|
382
942
|
type DatePickerProps = {
|
|
383
943
|
value?: string;
|
|
384
944
|
defaultValue?: string;
|
|
@@ -453,4 +1013,609 @@ declare const Layout: typeof LayoutRoot & {
|
|
|
453
1013
|
Footer: typeof LayoutFooter;
|
|
454
1014
|
};
|
|
455
1015
|
|
|
456
|
-
|
|
1016
|
+
interface SpotlightAction {
|
|
1017
|
+
/** Unique within this Spotlight. */
|
|
1018
|
+
id: string;
|
|
1019
|
+
label: string;
|
|
1020
|
+
description?: string;
|
|
1021
|
+
keywords?: string | string[];
|
|
1022
|
+
group?: string;
|
|
1023
|
+
icon?: React__default.ReactNode;
|
|
1024
|
+
rightSection?: React__default.ReactNode;
|
|
1025
|
+
disabled?: boolean;
|
|
1026
|
+
onSelect?: () => void;
|
|
1027
|
+
}
|
|
1028
|
+
interface SpotlightProps {
|
|
1029
|
+
actions: SpotlightAction[];
|
|
1030
|
+
trigger?: React__default.ReactElement;
|
|
1031
|
+
open?: boolean;
|
|
1032
|
+
defaultOpen?: boolean;
|
|
1033
|
+
onOpenChange?: (open: boolean) => void;
|
|
1034
|
+
query?: string;
|
|
1035
|
+
defaultQuery?: string;
|
|
1036
|
+
onQueryChange?: (query: string) => void;
|
|
1037
|
+
/** Match a KeyboardEvent.key with Ctrl or Meta, e.g. k. false disables. */
|
|
1038
|
+
shortcut?: string | false;
|
|
1039
|
+
/** Shortcuts do not intercept text editing by default. */
|
|
1040
|
+
enableInInputs?: boolean;
|
|
1041
|
+
title?: string;
|
|
1042
|
+
placeholder?: string;
|
|
1043
|
+
nothingFound?: React__default.ReactNode;
|
|
1044
|
+
limit?: number;
|
|
1045
|
+
filter?: (query: string, action: SpotlightAction) => boolean;
|
|
1046
|
+
onActionSelect?: (action: SpotlightAction) => void;
|
|
1047
|
+
closeOnSelect?: boolean;
|
|
1048
|
+
resetQueryOnClose?: boolean;
|
|
1049
|
+
className?: string;
|
|
1050
|
+
}
|
|
1051
|
+
declare function Spotlight({ actions, trigger, open, defaultOpen, onOpenChange, query, defaultQuery, onQueryChange, shortcut, enableInInputs, title, placeholder, nothingFound, limit, filter, onActionSelect, closeOnSelect, resetQueryOnClose, className }: SpotlightProps): React__default.JSX.Element;
|
|
1052
|
+
|
|
1053
|
+
type SplitterSize = number | `${number}%` | `${number}px`;
|
|
1054
|
+
|
|
1055
|
+
interface SplitterPanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onResize"> {
|
|
1056
|
+
id?: string;
|
|
1057
|
+
label?: string;
|
|
1058
|
+
defaultSize?: SplitterSize;
|
|
1059
|
+
min?: SplitterSize;
|
|
1060
|
+
max?: SplitterSize;
|
|
1061
|
+
resizable?: boolean;
|
|
1062
|
+
collapsible?: boolean;
|
|
1063
|
+
collapsedSize?: SplitterSize;
|
|
1064
|
+
groupResizeBehavior?: "preserve-relative-size" | "preserve-pixel-size";
|
|
1065
|
+
}
|
|
1066
|
+
interface SplitterProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onResize"> {
|
|
1067
|
+
orientation?: "horizontal" | "vertical";
|
|
1068
|
+
sizes?: SplitterSize[];
|
|
1069
|
+
disabled?: boolean;
|
|
1070
|
+
lazy?: boolean;
|
|
1071
|
+
onResize?: (sizes: number[]) => void;
|
|
1072
|
+
onResizeStart?: (sizes: number[]) => void;
|
|
1073
|
+
onResizeEnd?: (sizes: number[]) => void;
|
|
1074
|
+
onCollapse?: (collapsed: boolean[], sizes: number[]) => void;
|
|
1075
|
+
onDraggerDoubleClick?: (index: number) => void;
|
|
1076
|
+
}
|
|
1077
|
+
declare function SplitterPanel(_props: SplitterPanelProps): null;
|
|
1078
|
+
declare function SplitterRoot(props: SplitterProps): React.JSX.Element;
|
|
1079
|
+
declare const Splitter: typeof SplitterRoot & {
|
|
1080
|
+
Panel: typeof SplitterPanel;
|
|
1081
|
+
};
|
|
1082
|
+
|
|
1083
|
+
/** Extract boundary-delimited mentions from plain text; does not validate membership in options. */
|
|
1084
|
+
declare function getMentions(value: string, config?: {
|
|
1085
|
+
prefix?: string | string[];
|
|
1086
|
+
split?: string;
|
|
1087
|
+
}): {
|
|
1088
|
+
prefix: string;
|
|
1089
|
+
value: string;
|
|
1090
|
+
}[];
|
|
1091
|
+
|
|
1092
|
+
type MentionOption = {
|
|
1093
|
+
value: string;
|
|
1094
|
+
label?: React.ReactNode;
|
|
1095
|
+
key?: React.Key;
|
|
1096
|
+
disabled?: boolean;
|
|
1097
|
+
className?: string;
|
|
1098
|
+
style?: React.CSSProperties;
|
|
1099
|
+
};
|
|
1100
|
+
type MentionsSemantic = "root" | "textarea" | "popup" | "option" | "clear";
|
|
1101
|
+
type MentionsRef = {
|
|
1102
|
+
nativeElement: HTMLTextAreaElement | null;
|
|
1103
|
+
focus: (options?: FocusOptions) => void;
|
|
1104
|
+
blur: () => void;
|
|
1105
|
+
};
|
|
1106
|
+
type MentionsProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue" | "onChange" | "onSelect" | "prefix" | "children"> & {
|
|
1107
|
+
value?: string;
|
|
1108
|
+
defaultValue?: string;
|
|
1109
|
+
onChange?: (value: string) => void;
|
|
1110
|
+
options?: MentionOption[];
|
|
1111
|
+
prefix?: string | string[];
|
|
1112
|
+
split?: string;
|
|
1113
|
+
onSearch?: (text: string, prefix: string) => void;
|
|
1114
|
+
onSelect?: (option: MentionOption, prefix: string) => void;
|
|
1115
|
+
filterOption?: false | ((input: string, option: MentionOption) => boolean);
|
|
1116
|
+
validateSearch?: (text: string, split: string) => boolean;
|
|
1117
|
+
loading?: boolean;
|
|
1118
|
+
notFoundContent?: React.ReactNode;
|
|
1119
|
+
placement?: "top" | "bottom";
|
|
1120
|
+
getPopupContainer?: () => HTMLElement;
|
|
1121
|
+
popupRender?: (menu: React.ReactElement) => React.ReactNode;
|
|
1122
|
+
onPopupScroll?: React.UIEventHandler<HTMLDivElement>;
|
|
1123
|
+
size?: "sm" | "md" | "lg";
|
|
1124
|
+
status?: "error" | "warning";
|
|
1125
|
+
autoSize?: boolean | {
|
|
1126
|
+
minRows?: number;
|
|
1127
|
+
maxRows?: number;
|
|
1128
|
+
};
|
|
1129
|
+
allowClear?: boolean | {
|
|
1130
|
+
clearIcon?: React.ReactNode;
|
|
1131
|
+
label?: string;
|
|
1132
|
+
tabIndex?: number;
|
|
1133
|
+
};
|
|
1134
|
+
onClear?: () => void;
|
|
1135
|
+
classNames?: Partial<Record<MentionsSemantic, string>>;
|
|
1136
|
+
styles?: Partial<Record<MentionsSemantic, React.CSSProperties>>;
|
|
1137
|
+
};
|
|
1138
|
+
declare const Mentions: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "defaultValue" | "onChange" | "children" | "prefix" | "onSelect" | "value"> & {
|
|
1139
|
+
value?: string;
|
|
1140
|
+
defaultValue?: string;
|
|
1141
|
+
onChange?: (value: string) => void;
|
|
1142
|
+
options?: MentionOption[];
|
|
1143
|
+
prefix?: string | string[];
|
|
1144
|
+
split?: string;
|
|
1145
|
+
onSearch?: (text: string, prefix: string) => void;
|
|
1146
|
+
onSelect?: (option: MentionOption, prefix: string) => void;
|
|
1147
|
+
filterOption?: false | ((input: string, option: MentionOption) => boolean);
|
|
1148
|
+
validateSearch?: (text: string, split: string) => boolean;
|
|
1149
|
+
loading?: boolean;
|
|
1150
|
+
notFoundContent?: React.ReactNode;
|
|
1151
|
+
placement?: "top" | "bottom";
|
|
1152
|
+
getPopupContainer?: () => HTMLElement;
|
|
1153
|
+
popupRender?: (menu: React.ReactElement) => React.ReactNode;
|
|
1154
|
+
onPopupScroll?: React.UIEventHandler<HTMLDivElement>;
|
|
1155
|
+
size?: "sm" | "md" | "lg";
|
|
1156
|
+
status?: "error" | "warning";
|
|
1157
|
+
autoSize?: boolean | {
|
|
1158
|
+
minRows?: number;
|
|
1159
|
+
maxRows?: number;
|
|
1160
|
+
};
|
|
1161
|
+
allowClear?: boolean | {
|
|
1162
|
+
clearIcon?: React.ReactNode;
|
|
1163
|
+
label?: string;
|
|
1164
|
+
tabIndex?: number;
|
|
1165
|
+
};
|
|
1166
|
+
onClear?: () => void;
|
|
1167
|
+
classNames?: Partial<Record<MentionsSemantic, string>>;
|
|
1168
|
+
styles?: Partial<Record<MentionsSemantic, React.CSSProperties>>;
|
|
1169
|
+
} & React.RefAttributes<MentionsRef>>;
|
|
1170
|
+
declare const Mention: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "defaultValue" | "onChange" | "children" | "prefix" | "onSelect" | "value"> & {
|
|
1171
|
+
value?: string;
|
|
1172
|
+
defaultValue?: string;
|
|
1173
|
+
onChange?: (value: string) => void;
|
|
1174
|
+
options?: MentionOption[];
|
|
1175
|
+
prefix?: string | string[];
|
|
1176
|
+
split?: string;
|
|
1177
|
+
onSearch?: (text: string, prefix: string) => void;
|
|
1178
|
+
onSelect?: (option: MentionOption, prefix: string) => void;
|
|
1179
|
+
filterOption?: false | ((input: string, option: MentionOption) => boolean);
|
|
1180
|
+
validateSearch?: (text: string, split: string) => boolean;
|
|
1181
|
+
loading?: boolean;
|
|
1182
|
+
notFoundContent?: React.ReactNode;
|
|
1183
|
+
placement?: "top" | "bottom";
|
|
1184
|
+
getPopupContainer?: () => HTMLElement;
|
|
1185
|
+
popupRender?: (menu: React.ReactElement) => React.ReactNode;
|
|
1186
|
+
onPopupScroll?: React.UIEventHandler<HTMLDivElement>;
|
|
1187
|
+
size?: "sm" | "md" | "lg";
|
|
1188
|
+
status?: "error" | "warning";
|
|
1189
|
+
autoSize?: boolean | {
|
|
1190
|
+
minRows?: number;
|
|
1191
|
+
maxRows?: number;
|
|
1192
|
+
};
|
|
1193
|
+
allowClear?: boolean | {
|
|
1194
|
+
clearIcon?: React.ReactNode;
|
|
1195
|
+
label?: string;
|
|
1196
|
+
tabIndex?: number;
|
|
1197
|
+
};
|
|
1198
|
+
onClear?: () => void;
|
|
1199
|
+
classNames?: Partial<Record<MentionsSemantic, string>>;
|
|
1200
|
+
styles?: Partial<Record<MentionsSemantic, React.CSSProperties>>;
|
|
1201
|
+
} & React.RefAttributes<MentionsRef>>;
|
|
1202
|
+
|
|
1203
|
+
type CalendarMode = "month" | "year";
|
|
1204
|
+
type CalendarSelectInfo = {
|
|
1205
|
+
source: "date" | "month" | "year" | "customize";
|
|
1206
|
+
};
|
|
1207
|
+
type CalendarCellInfo = {
|
|
1208
|
+
type: "date" | "month";
|
|
1209
|
+
originNode: React.ReactElement;
|
|
1210
|
+
today: string;
|
|
1211
|
+
};
|
|
1212
|
+
type CalendarHeaderInfo = {
|
|
1213
|
+
value: string;
|
|
1214
|
+
type: CalendarMode;
|
|
1215
|
+
onChange: (value: string) => void;
|
|
1216
|
+
onTypeChange: (mode: CalendarMode) => void;
|
|
1217
|
+
};
|
|
1218
|
+
type CalendarSemanticSlot = "root" | "header" | "body" | "cell";
|
|
1219
|
+
interface CalendarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "onSelect" | "defaultValue"> {
|
|
1220
|
+
value?: string;
|
|
1221
|
+
defaultValue?: string;
|
|
1222
|
+
onChange?: (value: string) => void;
|
|
1223
|
+
onValueChange?: (value: string) => void;
|
|
1224
|
+
mode?: CalendarMode;
|
|
1225
|
+
defaultMode?: CalendarMode;
|
|
1226
|
+
onPanelChange?: (value: string, mode: CalendarMode) => void;
|
|
1227
|
+
onSelect?: (value: string, info: CalendarSelectInfo) => void;
|
|
1228
|
+
validRange?: readonly [string, string];
|
|
1229
|
+
disabledDate?: (value: string) => boolean;
|
|
1230
|
+
disabled?: boolean;
|
|
1231
|
+
fullscreen?: boolean;
|
|
1232
|
+
showWeek?: boolean;
|
|
1233
|
+
locale?: Locale;
|
|
1234
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
1235
|
+
cellRender?: (value: string, info: CalendarCellInfo) => React.ReactNode;
|
|
1236
|
+
fullCellRender?: (value: string, info: CalendarCellInfo) => React.ReactNode;
|
|
1237
|
+
headerRender?: (info: CalendarHeaderInfo) => React.ReactNode;
|
|
1238
|
+
classNames?: Partial<Record<CalendarSemanticSlot, string>>;
|
|
1239
|
+
styles?: Partial<Record<CalendarSemanticSlot, React.CSSProperties>>;
|
|
1240
|
+
}
|
|
1241
|
+
declare function Calendar({ value, defaultValue, onChange, onValueChange, mode, defaultMode, onPanelChange, onSelect, validRange, disabledDate, disabled, fullscreen, showWeek, locale, weekStartsOn, cellRender, fullCellRender, headerRender, classNames, styles, className, style, ...props }: CalendarProps): React.JSX.Element;
|
|
1242
|
+
|
|
1243
|
+
interface RateCharacterInfo {
|
|
1244
|
+
/** Zero-based character index. */
|
|
1245
|
+
index: number;
|
|
1246
|
+
/** Committed, normalized value (hover never changes this). */
|
|
1247
|
+
value: number;
|
|
1248
|
+
/** Value currently painted, including a pointer preview. */
|
|
1249
|
+
displayValue: number;
|
|
1250
|
+
count: number;
|
|
1251
|
+
disabled: boolean;
|
|
1252
|
+
}
|
|
1253
|
+
interface RateProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "onChange" | "defaultValue" | "children"> {
|
|
1254
|
+
value?: number;
|
|
1255
|
+
defaultValue?: number;
|
|
1256
|
+
onChange?: (value: number) => void;
|
|
1257
|
+
count?: number;
|
|
1258
|
+
allowHalf?: boolean;
|
|
1259
|
+
allowClear?: boolean;
|
|
1260
|
+
disabled?: boolean;
|
|
1261
|
+
keyboard?: boolean;
|
|
1262
|
+
autoFocus?: boolean;
|
|
1263
|
+
size?: "small" | "medium" | "large";
|
|
1264
|
+
/** Display-only content; do not supply links, inputs or other interactive nodes. */
|
|
1265
|
+
character?: React.ReactNode | ((info: RateCharacterInfo) => React.ReactNode);
|
|
1266
|
+
tooltips?: readonly string[];
|
|
1267
|
+
/** undefined means pointer preview ended. */
|
|
1268
|
+
onHoverChange?: (value: number | undefined) => void;
|
|
1269
|
+
}
|
|
1270
|
+
/** Compact star rating, exposed as one keyboard-focusable slider. */
|
|
1271
|
+
declare const Rate: React.ForwardRefExoticComponent<RateProps & React.RefAttributes<HTMLSpanElement>>;
|
|
1272
|
+
|
|
1273
|
+
type PopconfirmPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom";
|
|
1274
|
+
type Content = React.ReactNode | (() => React.ReactNode);
|
|
1275
|
+
interface PopconfirmProps {
|
|
1276
|
+
trigger: React.ReactElement;
|
|
1277
|
+
title: Content;
|
|
1278
|
+
description?: Content;
|
|
1279
|
+
icon?: React.ReactNode;
|
|
1280
|
+
open?: boolean;
|
|
1281
|
+
defaultOpen?: boolean;
|
|
1282
|
+
onOpenChange?: (open: boolean) => void;
|
|
1283
|
+
disabled?: boolean;
|
|
1284
|
+
placement?: PopconfirmPlacement;
|
|
1285
|
+
arrow?: boolean;
|
|
1286
|
+
autoAdjustOverflow?: boolean;
|
|
1287
|
+
okText?: React.ReactNode;
|
|
1288
|
+
cancelText?: React.ReactNode;
|
|
1289
|
+
showCancel?: boolean;
|
|
1290
|
+
okButtonProps?: Omit<ButtonProps, "onClick" | "children">;
|
|
1291
|
+
cancelButtonProps?: Omit<ButtonProps, "onClick" | "children">;
|
|
1292
|
+
onConfirm?: (event: React.MouseEvent<HTMLButtonElement>) => void | boolean | Promise<void | boolean>;
|
|
1293
|
+
onCancel?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
1294
|
+
onConfirmError?: (error: unknown) => void;
|
|
1295
|
+
errorText?: React.ReactNode;
|
|
1296
|
+
onPopupClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
1297
|
+
className?: string;
|
|
1298
|
+
style?: React.CSSProperties;
|
|
1299
|
+
}
|
|
1300
|
+
declare function Popconfirm({ trigger, title, description, icon, open, defaultOpen, onOpenChange, disabled, placement, arrow, autoAdjustOverflow, okText, cancelText, showCancel, okButtonProps, cancelButtonProps, onConfirm, onCancel, onConfirmError, errorText, onPopupClick, className, style, }: PopconfirmProps): React.JSX.Element;
|
|
1301
|
+
|
|
1302
|
+
type TimelinePlacement = "start" | "end";
|
|
1303
|
+
type TimelineSemantic = "root" | "item" | "tail" | "icon" | "title" | "content";
|
|
1304
|
+
interface TimelineItem extends Omit<React.HTMLAttributes<HTMLLIElement>, "title" | "children" | "content" | "color"> {
|
|
1305
|
+
key?: React.Key;
|
|
1306
|
+
title?: React.ReactNode;
|
|
1307
|
+
content?: React.ReactNode;
|
|
1308
|
+
icon?: React.ReactNode;
|
|
1309
|
+
color?: string;
|
|
1310
|
+
loading?: boolean;
|
|
1311
|
+
placement?: TimelinePlacement;
|
|
1312
|
+
/** Compatibility aliases; prefer title/content/icon/placement. */
|
|
1313
|
+
label?: React.ReactNode;
|
|
1314
|
+
children?: React.ReactNode;
|
|
1315
|
+
dot?: React.ReactNode;
|
|
1316
|
+
position?: TimelinePlacement | "left" | "right";
|
|
1317
|
+
}
|
|
1318
|
+
interface TimelineProps extends Omit<React.HTMLAttributes<HTMLOListElement>, "children"> {
|
|
1319
|
+
items?: readonly TimelineItem[];
|
|
1320
|
+
mode?: TimelinePlacement | "alternate" | "left" | "right";
|
|
1321
|
+
orientation?: "vertical" | "horizontal";
|
|
1322
|
+
reverse?: boolean;
|
|
1323
|
+
variant?: "outlined" | "filled";
|
|
1324
|
+
/** Title column width. A number is pixels, not Ant Design's 24-column span. */
|
|
1325
|
+
titleSpan?: number | string;
|
|
1326
|
+
/** Compatibility ghost item. Prefer an explicit item with loading=true. */
|
|
1327
|
+
pending?: React.ReactNode;
|
|
1328
|
+
pendingDot?: React.ReactNode;
|
|
1329
|
+
classNames?: Partial<Record<TimelineSemantic, string>>;
|
|
1330
|
+
styles?: Partial<Record<TimelineSemantic, React.CSSProperties>>;
|
|
1331
|
+
}
|
|
1332
|
+
declare const Timeline: React.ForwardRefExoticComponent<TimelineProps & React.RefAttributes<HTMLOListElement>>;
|
|
1333
|
+
|
|
1334
|
+
interface AffixProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
1335
|
+
/** Top offset, defaults to zero unless offsetBottom is supplied. Takes precedence. */
|
|
1336
|
+
offsetTop?: number;
|
|
1337
|
+
offsetBottom?: number;
|
|
1338
|
+
target?: () => Window | HTMLElement | null;
|
|
1339
|
+
onChange?: (affixed: boolean) => void;
|
|
1340
|
+
}
|
|
1341
|
+
/** Fixed positioning with an in-flow placeholder. Use with vertical scrolling. */
|
|
1342
|
+
declare const Affix: React.ForwardRefExoticComponent<AffixProps & React.RefAttributes<HTMLDivElement>>;
|
|
1343
|
+
|
|
1344
|
+
type ResultStatus = "success" | "error" | "info" | "warning" | "403" | "404" | "500";
|
|
1345
|
+
type ResultSemantic = "root" | "icon" | "title" | "subTitle" | "extra" | "body";
|
|
1346
|
+
type SemanticValue<T> = Partial<Record<ResultSemantic, T>> | ((info: {
|
|
1347
|
+
props: ResultProps & {
|
|
1348
|
+
status: ResultStatus;
|
|
1349
|
+
};
|
|
1350
|
+
}) => Partial<Record<ResultSemantic, T>>);
|
|
1351
|
+
interface ResultProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1352
|
+
status?: ResultStatus;
|
|
1353
|
+
title?: React.ReactNode;
|
|
1354
|
+
subTitle?: React.ReactNode;
|
|
1355
|
+
icon?: React.ReactNode;
|
|
1356
|
+
extra?: React.ReactNode;
|
|
1357
|
+
classNames?: SemanticValue<string>;
|
|
1358
|
+
styles?: SemanticValue<React.CSSProperties>;
|
|
1359
|
+
}
|
|
1360
|
+
/** Static result summary. Opt into role="status" or aria-live only for dynamic announcements. */
|
|
1361
|
+
declare const Result: React.ForwardRefExoticComponent<ResultProps & React.RefAttributes<HTMLDivElement>>;
|
|
1362
|
+
|
|
1363
|
+
interface ImageItem {
|
|
1364
|
+
src: string;
|
|
1365
|
+
alt?: string;
|
|
1366
|
+
previewSrc?: string;
|
|
1367
|
+
fallback?: string;
|
|
1368
|
+
crossOrigin?: React.ImgHTMLAttributes<HTMLImageElement>["crossOrigin"];
|
|
1369
|
+
referrerPolicy?: React.ImgHTMLAttributes<HTMLImageElement>["referrerPolicy"];
|
|
1370
|
+
}
|
|
1371
|
+
interface ImagePreviewProps {
|
|
1372
|
+
items: readonly ImageItem[];
|
|
1373
|
+
open: boolean;
|
|
1374
|
+
onOpenChange: (open: boolean) => void;
|
|
1375
|
+
current?: number;
|
|
1376
|
+
defaultCurrent?: number;
|
|
1377
|
+
onCurrentChange?: (index: number) => void;
|
|
1378
|
+
/** Focus target after dismissal. Otherwise Base UI returns to the active opener. */
|
|
1379
|
+
returnFocus?: React.RefObject<HTMLElement | null>;
|
|
1380
|
+
closeOnBackdrop?: boolean;
|
|
1381
|
+
className?: string;
|
|
1382
|
+
}
|
|
1383
|
+
interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "placeholder"> {
|
|
1384
|
+
src: string;
|
|
1385
|
+
fallback?: string;
|
|
1386
|
+
placeholder?: React.ReactNode;
|
|
1387
|
+
errorContent?: React.ReactNode;
|
|
1388
|
+
preview?: boolean;
|
|
1389
|
+
previewSrc?: string;
|
|
1390
|
+
open?: boolean;
|
|
1391
|
+
defaultOpen?: boolean;
|
|
1392
|
+
onOpenChange?: (open: boolean) => void;
|
|
1393
|
+
fit?: React.CSSProperties["objectFit"];
|
|
1394
|
+
wrapperClassName?: string;
|
|
1395
|
+
}
|
|
1396
|
+
declare function ImagePreview({ items, open, onOpenChange, current, defaultCurrent, onCurrentChange, returnFocus, closeOnBackdrop, className, }: ImagePreviewProps): React.JSX.Element;
|
|
1397
|
+
declare function Image({ src, fallback, placeholder, errorContent, preview, previewSrc, open, defaultOpen, onOpenChange, fit, wrapperClassName, width, height, style, ...props }: ImageProps): React.JSX.Element;
|
|
1398
|
+
interface ImageGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
1399
|
+
items: readonly ImageItem[];
|
|
1400
|
+
open?: boolean;
|
|
1401
|
+
defaultOpen?: boolean;
|
|
1402
|
+
onOpenChange?: (open: boolean) => void;
|
|
1403
|
+
current?: number;
|
|
1404
|
+
defaultCurrent?: number;
|
|
1405
|
+
onCurrentChange?: (index: number) => void;
|
|
1406
|
+
thumbnailWidth?: number | string;
|
|
1407
|
+
thumbnailHeight?: number | string;
|
|
1408
|
+
}
|
|
1409
|
+
declare function ImageGroup({ items, open, defaultOpen, onOpenChange, current, defaultCurrent, onCurrentChange, thumbnailWidth, thumbnailHeight, className, ...props }: ImageGroupProps): React.JSX.Element;
|
|
1410
|
+
|
|
1411
|
+
interface TableOfContentsItem {
|
|
1412
|
+
id: string;
|
|
1413
|
+
label: string;
|
|
1414
|
+
level: number;
|
|
1415
|
+
}
|
|
1416
|
+
interface TableOfContentsHandle {
|
|
1417
|
+
refresh: () => void;
|
|
1418
|
+
}
|
|
1419
|
+
interface TableOfContentsProps extends Omit<React__default.HTMLAttributes<HTMLElement>, "title" | "onSelect"> {
|
|
1420
|
+
/** Heading scope. null means not ready; omitted means document. */
|
|
1421
|
+
root?: HTMLElement | null | (() => HTMLElement | null);
|
|
1422
|
+
/** Scroller containing the headings. Omitted means window. */
|
|
1423
|
+
scrollContainer?: HTMLElement | null | (() => HTMLElement | null);
|
|
1424
|
+
selector?: string;
|
|
1425
|
+
title?: React__default.ReactNode;
|
|
1426
|
+
initialItems?: TableOfContentsItem[];
|
|
1427
|
+
observe?: boolean;
|
|
1428
|
+
offset?: number;
|
|
1429
|
+
behavior?: ScrollBehavior;
|
|
1430
|
+
indent?: number;
|
|
1431
|
+
variant?: "default" | "subtle";
|
|
1432
|
+
emptyContent?: React__default.ReactNode;
|
|
1433
|
+
getLabel?: (element: HTMLElement) => string;
|
|
1434
|
+
getLevel?: (element: HTMLElement) => number;
|
|
1435
|
+
renderLabel?: (item: TableOfContentsItem, active: boolean) => React__default.ReactNode;
|
|
1436
|
+
onActiveChange?: (id: string | null) => void;
|
|
1437
|
+
onItemClick?: (item: TableOfContentsItem, event: React__default.MouseEvent<HTMLAnchorElement>) => void;
|
|
1438
|
+
}
|
|
1439
|
+
/** An accessible on-page heading index, independent of router hash state. */
|
|
1440
|
+
declare const TableOfContents: React__default.ForwardRefExoticComponent<TableOfContentsProps & React__default.RefAttributes<TableOfContentsHandle>>;
|
|
1441
|
+
|
|
1442
|
+
type AutoCompleteOption = {
|
|
1443
|
+
value: string;
|
|
1444
|
+
label?: React.ReactNode;
|
|
1445
|
+
disabled?: boolean;
|
|
1446
|
+
keywords?: string;
|
|
1447
|
+
};
|
|
1448
|
+
type AutoCompleteGroup = {
|
|
1449
|
+
label: string;
|
|
1450
|
+
options: AutoCompleteOption[];
|
|
1451
|
+
};
|
|
1452
|
+
type AutoCompleteProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "defaultValue" | "onChange" | "onSelect" | "prefix" | "children"> & {
|
|
1453
|
+
options?: (AutoCompleteOption | AutoCompleteGroup)[];
|
|
1454
|
+
value?: string;
|
|
1455
|
+
defaultValue?: string;
|
|
1456
|
+
onChange?: (value: string) => void;
|
|
1457
|
+
onSelect?: (value: string, option: AutoCompleteOption) => void;
|
|
1458
|
+
onSearch?: (value: string) => void;
|
|
1459
|
+
open?: boolean;
|
|
1460
|
+
defaultOpen?: boolean;
|
|
1461
|
+
onOpenChange?: (open: boolean) => void;
|
|
1462
|
+
filterOption?: false | ((query: string, option: AutoCompleteOption) => boolean);
|
|
1463
|
+
autoHighlight?: boolean;
|
|
1464
|
+
backfill?: boolean;
|
|
1465
|
+
allowClear?: boolean;
|
|
1466
|
+
onClear?: () => void;
|
|
1467
|
+
loading?: boolean;
|
|
1468
|
+
notFoundContent?: React.ReactNode;
|
|
1469
|
+
size?: "sm" | "md" | "lg";
|
|
1470
|
+
status?: "error" | "warning";
|
|
1471
|
+
prefix?: React.ReactNode;
|
|
1472
|
+
suffix?: React.ReactNode;
|
|
1473
|
+
popupClassName?: string;
|
|
1474
|
+
popupStyle?: React.CSSProperties;
|
|
1475
|
+
placement?: "top" | "bottom";
|
|
1476
|
+
popupWidth?: number;
|
|
1477
|
+
};
|
|
1478
|
+
/** Free text input with optional suggestions; ref points to the native input. */
|
|
1479
|
+
declare const AutoComplete: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "children" | "prefix" | "onSelect" | "value" | "size"> & {
|
|
1480
|
+
options?: (AutoCompleteOption | AutoCompleteGroup)[];
|
|
1481
|
+
value?: string;
|
|
1482
|
+
defaultValue?: string;
|
|
1483
|
+
onChange?: (value: string) => void;
|
|
1484
|
+
onSelect?: (value: string, option: AutoCompleteOption) => void;
|
|
1485
|
+
onSearch?: (value: string) => void;
|
|
1486
|
+
open?: boolean;
|
|
1487
|
+
defaultOpen?: boolean;
|
|
1488
|
+
onOpenChange?: (open: boolean) => void;
|
|
1489
|
+
filterOption?: false | ((query: string, option: AutoCompleteOption) => boolean);
|
|
1490
|
+
autoHighlight?: boolean;
|
|
1491
|
+
backfill?: boolean;
|
|
1492
|
+
allowClear?: boolean;
|
|
1493
|
+
onClear?: () => void;
|
|
1494
|
+
loading?: boolean;
|
|
1495
|
+
notFoundContent?: React.ReactNode;
|
|
1496
|
+
size?: "sm" | "md" | "lg";
|
|
1497
|
+
status?: "error" | "warning";
|
|
1498
|
+
prefix?: React.ReactNode;
|
|
1499
|
+
suffix?: React.ReactNode;
|
|
1500
|
+
popupClassName?: string;
|
|
1501
|
+
popupStyle?: React.CSSProperties;
|
|
1502
|
+
placement?: "top" | "bottom";
|
|
1503
|
+
popupWidth?: number;
|
|
1504
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
1505
|
+
|
|
1506
|
+
type CascaderKey = string | number;
|
|
1507
|
+
type CascaderPath = CascaderKey[];
|
|
1508
|
+
interface CascaderOption {
|
|
1509
|
+
value: CascaderKey;
|
|
1510
|
+
label: React.ReactNode;
|
|
1511
|
+
/** Required for searching non-text labels. */
|
|
1512
|
+
textValue?: string;
|
|
1513
|
+
children?: CascaderOption[];
|
|
1514
|
+
disabled?: boolean;
|
|
1515
|
+
/** false declares an unloaded branch; loadOptions must supply its children. */
|
|
1516
|
+
isLeaf?: boolean;
|
|
1517
|
+
}
|
|
1518
|
+
interface CascaderCommon {
|
|
1519
|
+
options: CascaderOption[];
|
|
1520
|
+
disabled?: boolean;
|
|
1521
|
+
readOnly?: boolean;
|
|
1522
|
+
changeOnSelect?: boolean;
|
|
1523
|
+
expandTrigger?: "click" | "hover";
|
|
1524
|
+
searchable?: boolean;
|
|
1525
|
+
searchValue?: string;
|
|
1526
|
+
defaultSearchValue?: string;
|
|
1527
|
+
onSearchChange?: (value: string) => void;
|
|
1528
|
+
filterOption?: (query: string, path: CascaderOption[]) => boolean;
|
|
1529
|
+
loadOptions?: (path: CascaderOption[]) => Promise<CascaderOption[]>;
|
|
1530
|
+
onLoadError?: (error: unknown, path: CascaderOption[]) => void;
|
|
1531
|
+
renderOption?: (option: CascaderOption, path: CascaderOption[]) => React.ReactNode;
|
|
1532
|
+
emptyContent?: React.ReactNode;
|
|
1533
|
+
loadingText?: React.ReactNode;
|
|
1534
|
+
loadErrorText?: React.ReactNode;
|
|
1535
|
+
searchPlaceholder?: string;
|
|
1536
|
+
className?: string;
|
|
1537
|
+
style?: React.CSSProperties;
|
|
1538
|
+
"aria-label"?: string;
|
|
1539
|
+
"aria-labelledby"?: string;
|
|
1540
|
+
}
|
|
1541
|
+
type CascaderSelection = {
|
|
1542
|
+
multiple?: false;
|
|
1543
|
+
value?: CascaderPath;
|
|
1544
|
+
defaultValue?: CascaderPath;
|
|
1545
|
+
onValueChange?: (value: CascaderPath, options: CascaderOption[]) => void;
|
|
1546
|
+
} | {
|
|
1547
|
+
multiple: true;
|
|
1548
|
+
value?: CascaderPath[];
|
|
1549
|
+
defaultValue?: CascaderPath[];
|
|
1550
|
+
onValueChange?: (value: CascaderPath[], options: CascaderOption[][]) => void;
|
|
1551
|
+
};
|
|
1552
|
+
type CascaderPanelProps = CascaderCommon & CascaderSelection;
|
|
1553
|
+
type CascaderProps = CascaderPanelProps & {
|
|
1554
|
+
open?: boolean;
|
|
1555
|
+
defaultOpen?: boolean;
|
|
1556
|
+
onOpenChange?: (open: boolean) => void;
|
|
1557
|
+
placeholder?: string;
|
|
1558
|
+
allowClear?: boolean;
|
|
1559
|
+
onClear?: () => void;
|
|
1560
|
+
size?: "sm" | "md" | "lg";
|
|
1561
|
+
status?: "error" | "warning";
|
|
1562
|
+
placement?: "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
1563
|
+
/** Only changes multiple-value presentation; callbacks always contain leaf paths. */
|
|
1564
|
+
showCheckedStrategy?: "parent" | "leaf";
|
|
1565
|
+
maxTagCount?: number;
|
|
1566
|
+
renderValue?: (options: CascaderOption[], path: CascaderPath) => React.ReactNode;
|
|
1567
|
+
prefix?: React.ReactNode;
|
|
1568
|
+
name?: string;
|
|
1569
|
+
id?: string;
|
|
1570
|
+
};
|
|
1571
|
+
declare function CascaderPanel(props: CascaderPanelProps): React.JSX.Element;
|
|
1572
|
+
declare const Cascader: React.ForwardRefExoticComponent<CascaderProps & React.RefAttributes<HTMLButtonElement>>;
|
|
1573
|
+
|
|
1574
|
+
interface TransferItem {
|
|
1575
|
+
key: string;
|
|
1576
|
+
label: React.ReactNode;
|
|
1577
|
+
description?: React.ReactNode;
|
|
1578
|
+
searchText?: string;
|
|
1579
|
+
disabled?: boolean;
|
|
1580
|
+
}
|
|
1581
|
+
type TransferDirection = "left" | "right";
|
|
1582
|
+
interface TransferListContext {
|
|
1583
|
+
direction: TransferDirection;
|
|
1584
|
+
items: TransferItem[];
|
|
1585
|
+
selectedKeys: string[];
|
|
1586
|
+
disabled: boolean;
|
|
1587
|
+
select: (keys: string[], selected: boolean) => void;
|
|
1588
|
+
remove: (keys: string[]) => void;
|
|
1589
|
+
}
|
|
1590
|
+
interface TransferProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "children"> {
|
|
1591
|
+
items: TransferItem[];
|
|
1592
|
+
targetKeys?: string[];
|
|
1593
|
+
defaultTargetKeys?: string[];
|
|
1594
|
+
onChange?: (targetKeys: string[], direction: TransferDirection, moveKeys: string[]) => void;
|
|
1595
|
+
selectedKeys?: string[];
|
|
1596
|
+
defaultSelectedKeys?: string[];
|
|
1597
|
+
onSelectChange?: (sourceKeys: string[], targetKeys: string[]) => void;
|
|
1598
|
+
showSearch?: boolean;
|
|
1599
|
+
filterOption?: (query: string, item: TransferItem, direction: TransferDirection) => boolean;
|
|
1600
|
+
onSearch?: (direction: TransferDirection, query: string) => void;
|
|
1601
|
+
titles?: [React.ReactNode, React.ReactNode];
|
|
1602
|
+
panelLabels?: [string, string];
|
|
1603
|
+
operationLabels?: [string, string];
|
|
1604
|
+
searchPlaceholder?: string;
|
|
1605
|
+
emptyContent?: React.ReactNode;
|
|
1606
|
+
disabled?: boolean;
|
|
1607
|
+
loading?: boolean;
|
|
1608
|
+
oneWay?: boolean;
|
|
1609
|
+
showSelectAll?: boolean;
|
|
1610
|
+
pagination?: boolean | {
|
|
1611
|
+
pageSize?: number;
|
|
1612
|
+
};
|
|
1613
|
+
height?: number | string;
|
|
1614
|
+
status?: "error" | "warning";
|
|
1615
|
+
renderItem?: (item: TransferItem, direction: TransferDirection) => React.ReactNode;
|
|
1616
|
+
renderList?: (context: TransferListContext) => React.ReactNode;
|
|
1617
|
+
footer?: (context: TransferListContext) => React.ReactNode;
|
|
1618
|
+
}
|
|
1619
|
+
declare const Transfer: React.ForwardRefExoticComponent<TransferProps & React.RefAttributes<HTMLDivElement>>;
|
|
1620
|
+
|
|
1621
|
+
export { Affix, type AffixProps, Alert, AutoComplete, type AutoCompleteGroup, type AutoCompleteOption, type AutoCompleteProps, Avatar, type AvatarBreakpoint, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Badge, Breadcrumb, Button, ButtonGroup, type ButtonProps, Calendar, type CalendarCellInfo, type CalendarHeaderInfo, type CalendarMode, type CalendarProps, type CalendarSelectInfo, type CalendarSemanticSlot, Card, type CardGridProps, type CardMetaProps, type CardMetaSemantic, type CardProps, type CardSemantic, type CardTabItem, type CardTokens, Cascader, type CascaderKey, type CascaderOption, CascaderPanel, type CascaderPanelProps, type CascaderPath, type CascaderProps, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, DatePicker, type DatePickerProps, Dialog, type DialogProps, DirectoryTree, Divider, type DividerProps, DocumentCard, type DocumentItem, DocumentList, Drawer, DropdownMenu, type DropdownMenuProps, Dropzone, Empty, FilterBar, FilterChip, Form, FormField, type FormFieldProps, type FormInstance, type FormProps, type FormRule, type FormValidateTrigger, type FormValidationError, type FormValues, IconButton, Image, ImageGroup, type ImageGroupProps, type ImageItem, ImagePreview, type ImagePreviewProps, type ImageProps, Input, Layout, type LayoutContentProps, type LayoutHeaderProps, type LayoutProps, type LayoutSiderProps, List, ListItem, type Locale, Mention, type MentionOption, Mentions, type MentionsProps, type MentionsRef, type MentionsSemantic, type MenuItem, Modal, type ModalProps, MtoneProvider, MtoneScope, MultiSelect, type MultiSelectProps, NavGroup, NavItem, NumberInput, type NumberInputProps, type OpenProps, type Option, Pagination, type PaginationProps, Popconfirm, type PopconfirmPlacement, type PopconfirmProps, Popover, type PopoverProps, Progress, PropertyItem, PropertyList, RadioGroup, type RadioGroupProps, Rate, type RateCharacterInfo, type RateProps, Result, type ResultProps, type ResultSemantic, type ResultStatus, SearchInput, Segmented, Select, type SelectProps, Sidebar, type SidebarProps, Skeleton, Slider, type SliderProps, type SortOrder, Spinner, Splitter, type SplitterPanelProps, type SplitterProps, type SplitterSize, Spotlight, type SpotlightAction, type SpotlightProps, Status, Switch, type TabItem, Table, type TableClassNames, type TableColumn, type TableColumnTitleProps, type TableColumnsType, type TableExpandableConfig, type TableFilterDropdownProps, type TableFilterItem, type TableFilterValue, type TableFilters, type TableLocale, TableOfContents, type TableOfContentsHandle, type TableOfContentsItem, type TableOfContentsProps, type TablePagination, type TableProps, type TableRef, type TableRowSelection, type TableSelectionType, type TableSortResult, type TableState, type TableStyles, Tabs, type TabsProps, Text, Textarea, Timeline, type TimelineItem, type TimelinePlacement, type TimelineProps, type TimelineSemantic, Toast, type ToastOptions, type ToastPosition, type ToastPromiseOptions, ToastProvider, type ToastProviderProps, type ToastType, type ToastUpdateOptions, type Tokens, type Tone, Tooltip, Transfer, type TransferDirection, type TransferItem, type TransferListContext, type TransferProps, Tree, type TreeCheckedKeys, type TreeDropInfo, type TreeItem, type TreeKey, type TreeNode, type TreeNodeInfo, type TreeProps, type TreeRef, Upload, type UploadAdapter, type UploadContext, type UploadFile, type UploadProps, cn, getMentions, useMtone, useToast };
|