bj-web-components 0.2.13 → 0.2.14
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/index.d.ts +1115 -0
- package/dist/miniapp.d.ts +1 -0
- package/dist/mobile.d.ts +1 -0
- package/dist/react.d.ts +1 -0
- package/dist/shared.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/web/Dropdown/BDropdown.js +1 -1
- package/dist/web/Dropdown/BDropdown.mjs +61 -61
- package/dist/web/Table/BTable.js +1 -1
- package/dist/web/Table/BTable.mjs +22 -18
- package/dist/web.d.ts +1115 -0
- package/package.json +1 -1
package/dist/web.d.ts
ADDED
|
@@ -0,0 +1,1115 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { FocusEvent as FocusEvent_2 } from 'react';
|
|
3
|
+
import { FocusEventHandler } from 'react';
|
|
4
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
5
|
+
import { HTMLAttributes } from 'react';
|
|
6
|
+
import { InputHTMLAttributes } from 'react';
|
|
7
|
+
import { JSX } from 'react/jsx-runtime';
|
|
8
|
+
import { Key } from 'react';
|
|
9
|
+
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
10
|
+
import { KeyboardEventHandler } from 'react';
|
|
11
|
+
import { MouseEventHandler } from 'react';
|
|
12
|
+
import { ReactElement } from 'react';
|
|
13
|
+
import { ReactNode } from 'react';
|
|
14
|
+
import { Ref } from 'react';
|
|
15
|
+
import { RefAttributes } from 'react';
|
|
16
|
+
import { RefObject } from 'react';
|
|
17
|
+
import { SVGProps } from 'react';
|
|
18
|
+
import { TdHTMLAttributes } from 'react';
|
|
19
|
+
|
|
20
|
+
declare interface BaseTooltipProps {
|
|
21
|
+
placement?: TooltipPlacement;
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
/** 自定义弹层挂载容器,默认 document.body */
|
|
25
|
+
getPopupContainer?: () => HTMLElement;
|
|
26
|
+
/** Optional element used as the positioning anchor when rendered through a portal. */
|
|
27
|
+
getAnchorElement?: () => HTMLElement | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export declare const BCheckBox: typeof BCheckBox_2 & {
|
|
31
|
+
Group: typeof Group;
|
|
32
|
+
__ANT_CHECKBOX: boolean;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
declare const BCheckBox_2: ForwardRefExoticComponent<BCheckBoxProps & RefAttributes<HTMLInputElement>>;
|
|
36
|
+
|
|
37
|
+
export declare interface BCheckBoxGroupProps {
|
|
38
|
+
className?: string;
|
|
39
|
+
style?: CSSProperties;
|
|
40
|
+
name?: string;
|
|
41
|
+
options?: Array<CheckboxOptionType | string | number>;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
defaultValue?: CheckboxValueType[];
|
|
44
|
+
value?: CheckboxValueType[];
|
|
45
|
+
onChange?: (checkedValues: CheckboxValueType[]) => void;
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
direction?: 'ltr' | 'rtl';
|
|
48
|
+
variant?: BCheckBoxVariant;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export declare interface BCheckBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'children' | 'defaultChecked' | 'onChange' | 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'style' | 'type' | 'value'> {
|
|
52
|
+
className?: string;
|
|
53
|
+
style?: CSSProperties;
|
|
54
|
+
defaultChecked?: boolean;
|
|
55
|
+
checked?: boolean;
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
indeterminate?: boolean;
|
|
58
|
+
onChange?: (event: CheckboxChangeEvent) => void;
|
|
59
|
+
onClick?: MouseEventHandler<HTMLInputElement>;
|
|
60
|
+
onMouseEnter?: MouseEventHandler<HTMLLabelElement>;
|
|
61
|
+
onMouseLeave?: MouseEventHandler<HTMLLabelElement>;
|
|
62
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
63
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
64
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
65
|
+
onKeyPress?: KeyboardEventHandler<HTMLInputElement>;
|
|
66
|
+
onKeyUp?: KeyboardEventHandler<HTMLInputElement>;
|
|
67
|
+
value?: CheckboxValueType;
|
|
68
|
+
children?: ReactNode;
|
|
69
|
+
skipGroup?: boolean;
|
|
70
|
+
direction?: 'ltr' | 'rtl';
|
|
71
|
+
variant?: BCheckBoxVariant;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export declare type BCheckBoxVariant = 'dark' | 'white';
|
|
75
|
+
|
|
76
|
+
export declare function BDropdown({ className, style, options, value, defaultValue, multiple, optionMode, searchable, searchValue, searchPlaceholder, onSearch, filterOption, emptyText, labels, t, optionRender, onChange, footer, showReset, showConfirm, resetText, confirmText, onReset, onConfirm, }: BDropdownProps): JSX.Element;
|
|
77
|
+
|
|
78
|
+
export declare interface BDropdownOption {
|
|
79
|
+
label: ReactNode;
|
|
80
|
+
/** Secondary text displayed when optionMode is "double-line". */
|
|
81
|
+
description?: ReactNode;
|
|
82
|
+
value: BDropdownValue;
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export declare interface BDropdownProps {
|
|
87
|
+
className?: string;
|
|
88
|
+
style?: CSSProperties;
|
|
89
|
+
options: BDropdownOption[];
|
|
90
|
+
value?: BDropdownValue[];
|
|
91
|
+
defaultValue?: BDropdownValue[];
|
|
92
|
+
multiple?: boolean;
|
|
93
|
+
/** Option layout. Double-line options display label and description. */
|
|
94
|
+
optionMode?: 'single-line' | 'double-line';
|
|
95
|
+
searchable?: boolean;
|
|
96
|
+
searchValue?: string;
|
|
97
|
+
searchPlaceholder?: string;
|
|
98
|
+
onSearch?: (value: string) => void;
|
|
99
|
+
filterOption?: boolean | ((input: string, option: BDropdownOption) => boolean);
|
|
100
|
+
/** Empty-state content. Takes precedence over labels.emptyText. */
|
|
101
|
+
emptyText?: ReactNode;
|
|
102
|
+
/** Override default labels for i18n support. */
|
|
103
|
+
labels?: {
|
|
104
|
+
emptyText?: ReactNode;
|
|
105
|
+
};
|
|
106
|
+
/** Internationalization function. Defaults to returning the original text. */
|
|
107
|
+
t?: (text: string) => string;
|
|
108
|
+
optionRender?: (option: BDropdownOption) => ReactNode;
|
|
109
|
+
onChange?: (value: BDropdownValue[], option: BDropdownOption) => void;
|
|
110
|
+
footer?: boolean | ReactNode;
|
|
111
|
+
showReset?: boolean;
|
|
112
|
+
showConfirm?: boolean;
|
|
113
|
+
resetText?: ReactNode;
|
|
114
|
+
confirmText?: ReactNode;
|
|
115
|
+
onReset?: () => void;
|
|
116
|
+
onConfirm?: (value: BDropdownValue[]) => void;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export declare type BDropdownValue = string | number | boolean;
|
|
120
|
+
|
|
121
|
+
export declare const BInput: ForwardRefExoticComponent<BInputProps & RefAttributes<BInputRef>>;
|
|
122
|
+
|
|
123
|
+
export declare interface BInputFocusOptions extends FocusOptions {
|
|
124
|
+
cursor?: 'start' | 'end' | 'all';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export declare const BInputNumber: ForwardRefExoticComponent<BInputNumberProps & RefAttributes<HTMLInputElement>>;
|
|
128
|
+
|
|
129
|
+
export declare interface BInputNumberProps {
|
|
130
|
+
value?: number | string | null;
|
|
131
|
+
defaultValue?: number | string | null;
|
|
132
|
+
onChange?: (value: number | null) => void;
|
|
133
|
+
min?: number | string;
|
|
134
|
+
max?: number | string;
|
|
135
|
+
/** Step used by the up/down controls and ArrowUp/ArrowDown. Defaults to 1. */
|
|
136
|
+
step?: number | string;
|
|
137
|
+
/** Fixed decimal precision. When unset, inferred from the value/step. */
|
|
138
|
+
precision?: number;
|
|
139
|
+
disabled?: boolean;
|
|
140
|
+
readOnly?: boolean;
|
|
141
|
+
placeholder?: string;
|
|
142
|
+
autoFocus?: boolean;
|
|
143
|
+
size?: BInputNumberSize;
|
|
144
|
+
status?: BInputNumberStatus;
|
|
145
|
+
/** Set to false for a borderless input. */
|
|
146
|
+
bordered?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Show up/down controls, or provide a custom icon. Defaults to true.
|
|
149
|
+
* The default control is a single combined up/down icon: clicking its top half increases
|
|
150
|
+
* the value, its bottom half decreases it.
|
|
151
|
+
*/
|
|
152
|
+
controls?: boolean | {
|
|
153
|
+
icon?: ReactNode;
|
|
154
|
+
};
|
|
155
|
+
/** Enable ArrowUp/ArrowDown keyboard stepping. Defaults to true. */
|
|
156
|
+
keyboard?: boolean;
|
|
157
|
+
/** Step on mouse wheel while focused. Defaults to false. */
|
|
158
|
+
changeOnWheel?: boolean;
|
|
159
|
+
/** Flush the input value to onChange on blur. Defaults to true. */
|
|
160
|
+
changeOnBlur?: boolean;
|
|
161
|
+
addonBefore?: ReactNode;
|
|
162
|
+
addonAfter?: ReactNode;
|
|
163
|
+
prefix?: ReactNode;
|
|
164
|
+
suffix?: ReactNode;
|
|
165
|
+
/** Custom display formatter, e.g. `(v) => \`$ ${v}\`` */
|
|
166
|
+
formatter?: (value: number | string | undefined, info: {
|
|
167
|
+
userTyping: boolean;
|
|
168
|
+
input: string;
|
|
169
|
+
}) => string;
|
|
170
|
+
/** Reverse of `formatter`: strips display-only characters before parsing. */
|
|
171
|
+
parser?: (displayValue: string) => string;
|
|
172
|
+
/** Decimal separator for both display and parsing, e.g. ',' for locales that use it. */
|
|
173
|
+
decimalSeparator?: string;
|
|
174
|
+
onStep?: (value: number, info: {
|
|
175
|
+
offset: number | string;
|
|
176
|
+
type: 'up' | 'down';
|
|
177
|
+
}) => void;
|
|
178
|
+
onPressEnter?: (event: KeyboardEvent_2<HTMLInputElement>) => void;
|
|
179
|
+
onFocus?: (event: FocusEvent_2<HTMLInputElement>) => void;
|
|
180
|
+
onBlur?: (event: FocusEvent_2<HTMLInputElement>) => void;
|
|
181
|
+
id?: string;
|
|
182
|
+
name?: string;
|
|
183
|
+
className?: string;
|
|
184
|
+
style?: CSSProperties;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export declare type BInputNumberSize = 'small' | 'middle' | 'large';
|
|
188
|
+
|
|
189
|
+
export declare type BInputNumberStatus = 'error' | 'warning';
|
|
190
|
+
|
|
191
|
+
export declare interface BInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'value'> {
|
|
192
|
+
value?: InputHTMLAttributes<HTMLInputElement>['value'] | bigint;
|
|
193
|
+
prefix?: ReactNode;
|
|
194
|
+
suffix?: ReactNode;
|
|
195
|
+
addonBefore?: ReactNode;
|
|
196
|
+
addonAfter?: ReactNode;
|
|
197
|
+
allowClear?: boolean | {
|
|
198
|
+
clearIcon?: ReactNode;
|
|
199
|
+
};
|
|
200
|
+
size?: BInputSize;
|
|
201
|
+
status?: BInputStatus;
|
|
202
|
+
bordered?: boolean;
|
|
203
|
+
htmlSize?: number;
|
|
204
|
+
onPressEnter?: KeyboardEventHandler<HTMLInputElement>;
|
|
205
|
+
onClear?: () => void;
|
|
206
|
+
className?: string;
|
|
207
|
+
style?: CSSProperties;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export declare interface BInputRef {
|
|
211
|
+
focus: (options?: BInputFocusOptions) => void;
|
|
212
|
+
blur: () => void;
|
|
213
|
+
setSelectionRange: HTMLInputElement['setSelectionRange'];
|
|
214
|
+
select: () => void;
|
|
215
|
+
input: HTMLInputElement | null;
|
|
216
|
+
nativeElement: HTMLElement | null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export declare type BInputSize = 'small' | 'middle' | 'large';
|
|
220
|
+
|
|
221
|
+
export declare type BInputStatus = 'error' | 'warning';
|
|
222
|
+
|
|
223
|
+
export declare function BOverlayScrollbar({ containerRef, targetRef, selector, direction, size, gap, background, showOnHover, showOnScroll, hoverSelector, horizontalInsetStart, horizontalInsetEnd, horizontalThumbLength, className, }: BOverlayScrollbarProps): JSX.Element;
|
|
224
|
+
|
|
225
|
+
export declare interface BOverlayScrollbarProps {
|
|
226
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
227
|
+
targetRef?: RefObject<HTMLElement | null>;
|
|
228
|
+
selector?: string;
|
|
229
|
+
direction?: OverlayScrollbarDirection;
|
|
230
|
+
size?: number;
|
|
231
|
+
gap?: number;
|
|
232
|
+
background?: CSSProperties['backgroundColor'];
|
|
233
|
+
showOnHover?: boolean;
|
|
234
|
+
showOnScroll?: boolean;
|
|
235
|
+
hoverSelector?: string;
|
|
236
|
+
horizontalInsetStart?: number;
|
|
237
|
+
horizontalInsetEnd?: number;
|
|
238
|
+
horizontalThumbLength?: number;
|
|
239
|
+
className?: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export declare type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
243
|
+
|
|
244
|
+
export declare const BTable: typeof BTable_2 & {
|
|
245
|
+
Column: typeof Column;
|
|
246
|
+
ColumnGroup: typeof ColumnGroup;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
declare function BTable_2<RecordType extends object>({ columns, dataSource, rowKey, rowSelection, pagination, loading, bordered, size, showHeader, emptyText, emptyImage, emptyHeight, t, className, style, rowClassName, sortDirections, onChange, children, title, footer, summary, tableLayout, components, onRow, onHeaderRow, id, scroll, locale, }: TableProps<RecordType>): JSX.Element;
|
|
250
|
+
|
|
251
|
+
export declare function BTabs({ activeKey, children, centered, className, defaultActiveKey, id, items, onChange, onTabClick, style, tabBarGutter, tabBarStyle, tabPosition, type, }: BTabsProps): JSX.Element;
|
|
252
|
+
|
|
253
|
+
export declare namespace BTabs {
|
|
254
|
+
var TabPane: TabPane;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export declare interface BTabsItem {
|
|
258
|
+
key: string;
|
|
259
|
+
label: ReactNode;
|
|
260
|
+
children?: ReactNode;
|
|
261
|
+
disabled?: boolean;
|
|
262
|
+
forceRender?: boolean;
|
|
263
|
+
className?: string;
|
|
264
|
+
style?: CSSProperties;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare type BTabsPosition = 'top' | 'right' | 'bottom' | 'left';
|
|
268
|
+
|
|
269
|
+
export declare interface BTabsProps {
|
|
270
|
+
activeKey?: string;
|
|
271
|
+
defaultActiveKey?: string;
|
|
272
|
+
items?: BTabsItem[];
|
|
273
|
+
children?: ReactNode;
|
|
274
|
+
className?: string;
|
|
275
|
+
style?: CSSProperties;
|
|
276
|
+
id?: string;
|
|
277
|
+
tabPosition?: BTabsPosition;
|
|
278
|
+
type?: BTabsType;
|
|
279
|
+
centered?: boolean;
|
|
280
|
+
tabBarGutter?: number;
|
|
281
|
+
tabBarStyle?: CSSProperties;
|
|
282
|
+
onChange?: (activeKey: string) => void;
|
|
283
|
+
onTabClick?: (activeKey: string, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export declare interface BTabsTabPaneProps extends Omit<BTabsItem, 'key' | 'label'> {
|
|
287
|
+
tab: ReactNode;
|
|
288
|
+
tabKey?: Key;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export declare type BTabsType = 'line' | 'card';
|
|
292
|
+
|
|
293
|
+
declare function BTooltip({ placement, content, variant, className, style, getPopupContainer, getAnchorElement, color, fontColor, }: ContentTooltipProps): JSX.Element;
|
|
294
|
+
export { BTooltip }
|
|
295
|
+
export { BTooltip as ContentTooltip }
|
|
296
|
+
|
|
297
|
+
export declare function BuCategoryDropdown({ data, value, onChange, placeholder, disabled, maxVisible, className, style, getPopupContainer, dropdownStyle: customDropdownStyle, }: BuCategoryDropdownProps): JSX.Element;
|
|
298
|
+
|
|
299
|
+
export declare interface BuCategoryDropdownProps {
|
|
300
|
+
/** 分类树数据 */
|
|
301
|
+
data: CategoryItem[];
|
|
302
|
+
/** 当前选中路径,数组索引对应层级 */
|
|
303
|
+
value?: string[];
|
|
304
|
+
/** 选中回调,返回新路径和对应的节点数组 */
|
|
305
|
+
onChange?: (value: string[], path: CategoryItem[]) => void;
|
|
306
|
+
/** 触发按钮占位文字 */
|
|
307
|
+
placeholder?: string;
|
|
308
|
+
/** 是否禁用整个组件 */
|
|
309
|
+
disabled?: boolean;
|
|
310
|
+
/** 每列最多显示几项,超出后出现滚动条,默认 6 */
|
|
311
|
+
maxVisible?: number;
|
|
312
|
+
className?: string;
|
|
313
|
+
style?: CSSProperties;
|
|
314
|
+
/** 自定义下拉面板挂载容器,返回目标 DOM 元素。默认挂载到 document.body */
|
|
315
|
+
getPopupContainer?: () => HTMLElement;
|
|
316
|
+
/** 追加到下拉面板(.bu-category-dropdown__portal)内联样式上,与内部计算出的定位样式(position/top/left/zIndex)合并 */
|
|
317
|
+
dropdownStyle?: CSSProperties;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export declare const BuEmptyInputBox: ForwardRefExoticComponent<BuEmptyInputBoxProps & RefAttributes<HTMLInputElement>>;
|
|
321
|
+
|
|
322
|
+
export declare type BuEmptyInputBoxLang = 'zh' | 'en';
|
|
323
|
+
|
|
324
|
+
export declare type BuEmptyInputBoxMode = 'single' | 'bilingual';
|
|
325
|
+
|
|
326
|
+
export declare interface BuEmptyInputBoxProps {
|
|
327
|
+
/** 单语 / 双语模式 */
|
|
328
|
+
mode?: BuEmptyInputBoxMode;
|
|
329
|
+
/** 双语模式下当前激活的语言 */
|
|
330
|
+
activeLang?: BuEmptyInputBoxLang;
|
|
331
|
+
onLangChange?: (lang: BuEmptyInputBoxLang) => void;
|
|
332
|
+
/** 受控值,与 antd Form 兼容 */
|
|
333
|
+
value?: string;
|
|
334
|
+
onChange?: (value: string) => void;
|
|
335
|
+
placeholder?: string;
|
|
336
|
+
maxLength?: number;
|
|
337
|
+
/** 错误状态 */
|
|
338
|
+
error?: boolean;
|
|
339
|
+
disabled?: boolean;
|
|
340
|
+
/** 点击删除按钮回调(传入时显示删除按钮) */
|
|
341
|
+
onDelete?: () => void;
|
|
342
|
+
/** Override display labels for i18n support */
|
|
343
|
+
labels?: {
|
|
344
|
+
zh?: string;
|
|
345
|
+
en?: string;
|
|
346
|
+
};
|
|
347
|
+
id?: string;
|
|
348
|
+
className?: string;
|
|
349
|
+
style?: CSSProperties;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export declare const BuIcon: {
|
|
353
|
+
({ type, style, onClick, className, ...rest }: BuIconProps): JSX.Element;
|
|
354
|
+
displayName: string;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export declare interface BuIconProps extends Omit<SVGProps<SVGSVGElement>, 'onClick' | 'style' | 'className'> {
|
|
358
|
+
/** iconfont symbol id(不含 # 前缀),对应 <symbol id="icon-xxx"> */
|
|
359
|
+
type: string;
|
|
360
|
+
/** 自定义样式 */
|
|
361
|
+
style?: CSSProperties;
|
|
362
|
+
/** 点击事件 */
|
|
363
|
+
onClick?: MouseEventHandler<SVGSVGElement>;
|
|
364
|
+
/** 自定义类名 */
|
|
365
|
+
className?: string;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export declare const BuInput: ForwardRefExoticComponent<BuInputProps & RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
369
|
+
|
|
370
|
+
export declare type BuInputLang = 'zh' | 'en';
|
|
371
|
+
|
|
372
|
+
export declare type BuInputMode = 'single' | 'bilingual';
|
|
373
|
+
|
|
374
|
+
export declare interface BuInputProps {
|
|
375
|
+
/** 输入框类型:input(单行)| textarea(多行) */
|
|
376
|
+
type?: BuInputType;
|
|
377
|
+
/** 单语 / 双语模式 */
|
|
378
|
+
mode?: BuInputMode;
|
|
379
|
+
/** 双语模式下当前激活的语言 */
|
|
380
|
+
activeLang?: BuInputLang;
|
|
381
|
+
onLangChange?: (lang: BuInputLang) => void;
|
|
382
|
+
/** 受控值,与 antd Form 兼容 */
|
|
383
|
+
value?: string;
|
|
384
|
+
onChange?: (value: string) => void;
|
|
385
|
+
/** 标签文字 */
|
|
386
|
+
label?: string;
|
|
387
|
+
/** 是否必填(label 前显示红色 *) */
|
|
388
|
+
required?: boolean;
|
|
389
|
+
placeholder?: string;
|
|
390
|
+
/** 最大字符数,配合 showCount 使用 */
|
|
391
|
+
maxLength?: number;
|
|
392
|
+
/** 是否显示字符计数,双语模式下始终显示 */
|
|
393
|
+
showCount?: boolean;
|
|
394
|
+
/** 错误状态:无值时 placeholder 变红;有值时显示 errorMessage */
|
|
395
|
+
error?: boolean;
|
|
396
|
+
/** 错误提示文字(有输入值 + error=true 时显示在输入框下方) */
|
|
397
|
+
errorMessage?: string;
|
|
398
|
+
disabled?: boolean;
|
|
399
|
+
/** 数字步进器最小值(type='number' 时生效) */
|
|
400
|
+
min?: number;
|
|
401
|
+
/** 数字步进器最大值(type='number' 时生效) */
|
|
402
|
+
max?: number;
|
|
403
|
+
/** 数字步进器步长(type='number' 时生效) */
|
|
404
|
+
step?: number;
|
|
405
|
+
/** 输入框左侧 icon,如拖拽把手 */
|
|
406
|
+
leftIcon?: ReactNode;
|
|
407
|
+
/** 输入框右侧 icon,如删除按钮 */
|
|
408
|
+
rightIcon?: ReactNode;
|
|
409
|
+
/** 自定义语言切换按钮,替换内置的中文/EN 按钮,双语模式下生效 */
|
|
410
|
+
langToggle?: ReactNode;
|
|
411
|
+
/** 正在翻译中状态,显示 loading 指示器 */
|
|
412
|
+
translating?: boolean;
|
|
413
|
+
/** 翻译完成状态,显示对勾 */
|
|
414
|
+
translated?: boolean;
|
|
415
|
+
onBlur?: () => void;
|
|
416
|
+
/** Override display labels for i18n support */
|
|
417
|
+
labels?: {
|
|
418
|
+
zh?: string;
|
|
419
|
+
en?: string;
|
|
420
|
+
};
|
|
421
|
+
id?: string;
|
|
422
|
+
className?: string;
|
|
423
|
+
style?: CSSProperties;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export declare type BuInputType = 'input' | 'textarea' | 'number';
|
|
427
|
+
|
|
428
|
+
export declare function BuModal({ open, title, mode, children, okText, cancelText, onOk, onCancel, onClose, activeLang, onLangChange, labels, hint, confirmLoading, width, className, style, }: BuModalProps): JSX.Element | null;
|
|
429
|
+
|
|
430
|
+
export declare interface BuModalProps {
|
|
431
|
+
/** 是否显示弹窗 */
|
|
432
|
+
open?: boolean;
|
|
433
|
+
/** 弹窗标题 */
|
|
434
|
+
title?: string;
|
|
435
|
+
/** 弹窗模式:standard 双按钮 | bilingual 双语双按钮 | single 单按钮居中 */
|
|
436
|
+
mode?: ModalMode;
|
|
437
|
+
/** 弹窗内容 */
|
|
438
|
+
children?: ReactNode;
|
|
439
|
+
/** 确认按钮文字 */
|
|
440
|
+
okText?: string;
|
|
441
|
+
/** 取消按钮文字(standard / bilingual 模式生效) */
|
|
442
|
+
cancelText?: string;
|
|
443
|
+
/** 确认回调 */
|
|
444
|
+
onOk?: () => void;
|
|
445
|
+
/** 取消回调 */
|
|
446
|
+
onCancel?: () => void;
|
|
447
|
+
/** 关闭回调(点击 × 或遮罩) */
|
|
448
|
+
onClose?: () => void;
|
|
449
|
+
/** bilingual 模式下当前激活语言 */
|
|
450
|
+
activeLang?: ModalLang;
|
|
451
|
+
/** bilingual 模式下语言切换回调 */
|
|
452
|
+
onLangChange?: (lang: ModalLang) => void;
|
|
453
|
+
/** 按钮上方的提示文字,12px #999 */
|
|
454
|
+
hint?: string;
|
|
455
|
+
/** Override display labels for i18n support */
|
|
456
|
+
labels?: {
|
|
457
|
+
zh?: string;
|
|
458
|
+
en?: string;
|
|
459
|
+
};
|
|
460
|
+
/** 确认按钮加载中状态 */
|
|
461
|
+
confirmLoading?: boolean;
|
|
462
|
+
/** 弹窗宽度,默认 480px,作用于内层白框 */
|
|
463
|
+
width?: number | string;
|
|
464
|
+
/** 自定义类名,挂在最外层遮罩上(整个 modal) */
|
|
465
|
+
className?: string;
|
|
466
|
+
/** 自定义样式,作用于内层白框 */
|
|
467
|
+
style?: CSSProperties;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export declare function BuProductField({ options, value, onChange, placeholder, emptyText, onManageField, multiple, showSearch, showSort, addButtonText, onAdd, labels, className, style, getPopupContainer, }: BuProductFieldProps): JSX.Element;
|
|
471
|
+
|
|
472
|
+
export declare interface BuProductFieldProps {
|
|
473
|
+
/** 可选项列表 */
|
|
474
|
+
options?: ProductFieldOption[];
|
|
475
|
+
/** 当前选中值(受控) */
|
|
476
|
+
value?: string[];
|
|
477
|
+
/** 选中变化回调 */
|
|
478
|
+
onChange?: (values: string[]) => void;
|
|
479
|
+
/** 触发器占位文字 */
|
|
480
|
+
placeholder?: string;
|
|
481
|
+
/** 无数据主文案 */
|
|
482
|
+
emptyText?: string;
|
|
483
|
+
/** 点击"管理字段"的回调 */
|
|
484
|
+
onManageField?: () => void;
|
|
485
|
+
/** 单选模式(默认多选) */
|
|
486
|
+
multiple?: boolean;
|
|
487
|
+
/** 是否显示搜索框(默认 true) */
|
|
488
|
+
showSearch?: boolean;
|
|
489
|
+
/** 是否显示排序按钮(默认 true) */
|
|
490
|
+
showSort?: boolean;
|
|
491
|
+
/** 底部新增区域内容(字符串或 React 元素),不传则不显示 */
|
|
492
|
+
addButtonText?: ReactNode;
|
|
493
|
+
/** 点击新增按钮的回调 */
|
|
494
|
+
onAdd?: () => void;
|
|
495
|
+
/** Override display labels for i18n support */
|
|
496
|
+
labels?: {
|
|
497
|
+
searchPlaceholder?: string;
|
|
498
|
+
sortDefault?: string;
|
|
499
|
+
sortAsc?: string;
|
|
500
|
+
sortDesc?: string;
|
|
501
|
+
noMatchText?: string;
|
|
502
|
+
manageFieldPre?: string;
|
|
503
|
+
manageFieldLink?: string;
|
|
504
|
+
manageFieldPost?: string;
|
|
505
|
+
};
|
|
506
|
+
className?: string;
|
|
507
|
+
style?: CSSProperties;
|
|
508
|
+
/** 自定义下拉面板挂载容器,返回目标 DOM 元素。默认挂载到 document.body */
|
|
509
|
+
getPopupContainer?: () => HTMLElement;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export declare const BuSwitch: {
|
|
513
|
+
({ checked: controlledChecked, defaultChecked, onChange, disabled, loading, checkedChildren, unCheckedChildren, theme, activeColor, inactiveColor, className, style, }: BuSwitchProps): JSX.Element;
|
|
514
|
+
displayName: string;
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
export declare interface BuSwitchProps {
|
|
518
|
+
/** 是否选中(受控) */
|
|
519
|
+
checked?: boolean;
|
|
520
|
+
/** 初始是否选中(非受控) */
|
|
521
|
+
defaultChecked?: boolean;
|
|
522
|
+
/** 变化回调 */
|
|
523
|
+
onChange?: (checked: boolean) => void;
|
|
524
|
+
/** 是否禁用 */
|
|
525
|
+
disabled?: boolean;
|
|
526
|
+
/** 加载中 */
|
|
527
|
+
loading?: boolean;
|
|
528
|
+
/** 选中时的内容(显示在开关内部右侧) */
|
|
529
|
+
checkedChildren?: ReactNode;
|
|
530
|
+
/** 未选中时的内容(显示在开关内部左侧) */
|
|
531
|
+
unCheckedChildren?: ReactNode;
|
|
532
|
+
/** 颜色主题:light=黑灰系, dark=品牌红系 */
|
|
533
|
+
theme?: BuSwitchTheme;
|
|
534
|
+
/** 自定义选中颜色,覆盖 theme 默认色 */
|
|
535
|
+
activeColor?: string;
|
|
536
|
+
/** 自定义未选中颜色,覆盖 theme 默认色 */
|
|
537
|
+
inactiveColor?: string;
|
|
538
|
+
/** 自定义类名 */
|
|
539
|
+
className?: string;
|
|
540
|
+
/** 自定义样式 */
|
|
541
|
+
style?: CSSProperties;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/** 开关颜色主题 */
|
|
545
|
+
export declare type BuSwitchTheme = 'light' | 'dark';
|
|
546
|
+
|
|
547
|
+
export declare interface CategoryItem {
|
|
548
|
+
/** 唯一标识 */
|
|
549
|
+
value: string;
|
|
550
|
+
/** 显示文字 */
|
|
551
|
+
label: string;
|
|
552
|
+
/** 是否禁用(分类未创建好时不可选) */
|
|
553
|
+
disabled?: boolean;
|
|
554
|
+
/** 子分类 */
|
|
555
|
+
children?: CategoryItem[];
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export declare interface CellType<RecordType> {
|
|
559
|
+
key?: Key;
|
|
560
|
+
className?: string;
|
|
561
|
+
style?: CSSProperties;
|
|
562
|
+
children?: ReactNode;
|
|
563
|
+
column?: ColumnsType<RecordType>[number];
|
|
564
|
+
colSpan?: number;
|
|
565
|
+
rowSpan?: number;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export declare interface CheckboxChangeEvent {
|
|
569
|
+
target: CheckboxChangeEventTarget;
|
|
570
|
+
stopPropagation: () => void;
|
|
571
|
+
preventDefault: () => void;
|
|
572
|
+
nativeEvent: Event;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export declare interface CheckboxChangeEventTarget extends BCheckBoxProps {
|
|
576
|
+
checked: boolean;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
export declare interface CheckboxOptionType {
|
|
580
|
+
label: ReactNode;
|
|
581
|
+
value: CheckboxValueType;
|
|
582
|
+
style?: CSSProperties;
|
|
583
|
+
disabled?: boolean;
|
|
584
|
+
onChange?: (event: CheckboxChangeEvent) => void;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export declare type CheckboxValueType = string | number | boolean;
|
|
588
|
+
|
|
589
|
+
export declare function Column<RecordType>(_: ColumnProps<RecordType>): null;
|
|
590
|
+
|
|
591
|
+
export declare interface ColumnFilterItem {
|
|
592
|
+
text: ReactNode;
|
|
593
|
+
/** Secondary text forwarded to the built-in BDropdown in double-line mode. */
|
|
594
|
+
description?: ReactNode;
|
|
595
|
+
value: TableKey | boolean;
|
|
596
|
+
children?: ColumnFilterItem[];
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
export declare function ColumnGroup<RecordType>(_: ColumnGroupProps<RecordType>): null;
|
|
600
|
+
|
|
601
|
+
export declare interface ColumnGroupProps<RecordType> extends Omit<ColumnGroupType<RecordType>, 'children'> {
|
|
602
|
+
children: ReactElement<ColumnProps<RecordType>> | Array<ReactElement<ColumnProps<RecordType>>>;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export declare interface ColumnGroupType<RecordType> extends ColumnSharedType<RecordType> {
|
|
606
|
+
colSpan?: number;
|
|
607
|
+
children: ColumnsType<RecordType>;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
export declare interface ColumnProps<RecordType> extends ColumnType<RecordType> {
|
|
611
|
+
children?: null;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
declare interface ColumnSharedType<RecordType> {
|
|
615
|
+
title?: ColumnTitle<RecordType>;
|
|
616
|
+
/** Hint badge rendered beside the column title. Accepts text, icons, or custom JSX. */
|
|
617
|
+
badge?: ReactNode;
|
|
618
|
+
key?: TableKey;
|
|
619
|
+
className?: string;
|
|
620
|
+
fixed?: FixedType;
|
|
621
|
+
width?: number | string;
|
|
622
|
+
align?: TableAlign;
|
|
623
|
+
ellipsis?: boolean | {
|
|
624
|
+
showTitle?: boolean;
|
|
625
|
+
};
|
|
626
|
+
responsive?: Breakpoint[];
|
|
627
|
+
onHeaderCell?: GetComponentProps<ColumnsType<RecordType>[number]>;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
export declare type ColumnsType<RecordType = unknown> = readonly (ColumnGroupType<RecordType> | ColumnType<RecordType>)[];
|
|
631
|
+
|
|
632
|
+
declare type ColumnTitle<RecordType> = ReactNode | ((props: ColumnTitleProps<RecordType>) => ReactNode);
|
|
633
|
+
|
|
634
|
+
export declare interface ColumnTitleProps<RecordType> {
|
|
635
|
+
sortOrder?: SortOrder;
|
|
636
|
+
sortColumn?: ColumnType<RecordType>;
|
|
637
|
+
sortColumns?: Array<{
|
|
638
|
+
column: ColumnType<RecordType>;
|
|
639
|
+
order: SortOrder;
|
|
640
|
+
}>;
|
|
641
|
+
filters?: Record<string, FilterValue>;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
export declare interface ColumnType<RecordType> extends ColumnSharedType<RecordType> {
|
|
645
|
+
colSpan?: number;
|
|
646
|
+
rowSpan?: number;
|
|
647
|
+
dataIndex?: TableDataIndex;
|
|
648
|
+
render?: (value: unknown, record: RecordType, index: number) => ReactNode | RenderedCell<RecordType>;
|
|
649
|
+
shouldCellUpdate?: (record: RecordType, previousRecord: RecordType) => boolean;
|
|
650
|
+
onCell?: GetComponentProps<RecordType>;
|
|
651
|
+
sorter?: boolean | CompareFn<RecordType> | {
|
|
652
|
+
compare?: CompareFn<RecordType>;
|
|
653
|
+
multiple?: number;
|
|
654
|
+
};
|
|
655
|
+
sortOrder?: SortOrder;
|
|
656
|
+
defaultSortOrder?: SortOrder;
|
|
657
|
+
sortDirections?: SortOrder[];
|
|
658
|
+
showSorterTooltip?: boolean | {
|
|
659
|
+
title?: ReactNode;
|
|
660
|
+
};
|
|
661
|
+
filtered?: boolean;
|
|
662
|
+
filters?: ColumnFilterItem[];
|
|
663
|
+
/** Props forwarded to BDropdown when rendering the built-in filter panel. Table-managed options, value, and callbacks take precedence. */
|
|
664
|
+
filterDropdownProps?: Partial<BDropdownProps>;
|
|
665
|
+
filterDropdown?: ReactNode | ((props: FilterDropdownProps) => ReactNode);
|
|
666
|
+
filterMultiple?: boolean;
|
|
667
|
+
filteredValue?: FilterValue | null;
|
|
668
|
+
defaultFilteredValue?: FilterValue | null;
|
|
669
|
+
filterIcon?: ReactNode | ((filtered: boolean) => ReactNode);
|
|
670
|
+
filterMode?: 'menu' | 'tree';
|
|
671
|
+
/** Show a search input. Pass a matcher to search custom option fields. */
|
|
672
|
+
filterSearch?: FilterSearchType;
|
|
673
|
+
/** Load filter options externally after the search input's 300ms debounce. */
|
|
674
|
+
filterRequest?: FilterRequest;
|
|
675
|
+
onFilter?: (value: TableKey | boolean, record: RecordType) => boolean;
|
|
676
|
+
filterDropdownOpen?: boolean;
|
|
677
|
+
onFilterDropdownOpenChange?: (open: boolean) => void;
|
|
678
|
+
filterResetToDefaultFilteredValue?: boolean;
|
|
679
|
+
/** @deprecated Use filterDropdownOpen. */
|
|
680
|
+
filterDropdownVisible?: boolean;
|
|
681
|
+
/** @deprecated Use onFilterDropdownOpenChange. */
|
|
682
|
+
onFilterDropdownVisibleChange?: (visible: boolean) => void;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
export declare type CompareFn<RecordType> = (first: RecordType, second: RecordType, sortOrder?: SortOrder) => number;
|
|
686
|
+
|
|
687
|
+
export declare function ConfirmTooltip({ placement, title, okText, cancelText, onOk, onCancel, className, style, }: ConfirmTooltipProps): JSX.Element;
|
|
688
|
+
|
|
689
|
+
export declare interface ConfirmTooltipProps extends BaseTooltipProps {
|
|
690
|
+
title?: string;
|
|
691
|
+
okText?: string;
|
|
692
|
+
cancelText?: string;
|
|
693
|
+
onOk?: () => void;
|
|
694
|
+
onCancel?: () => void;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
declare interface ContentTooltipProps extends BaseTooltipProps {
|
|
698
|
+
content?: ReactNode;
|
|
699
|
+
variant?: TooltipVariant;
|
|
700
|
+
/** Tooltip background color, including the arrow. */
|
|
701
|
+
color?: string;
|
|
702
|
+
/** Tooltip content text color. */
|
|
703
|
+
fontColor?: string;
|
|
704
|
+
}
|
|
705
|
+
export { ContentTooltipProps as BTooltipProps }
|
|
706
|
+
export { ContentTooltipProps }
|
|
707
|
+
|
|
708
|
+
export declare interface ExpandableConfig<RecordType> {
|
|
709
|
+
expandedRowKeys?: readonly TableKey[];
|
|
710
|
+
defaultExpandedRowKeys?: readonly TableKey[];
|
|
711
|
+
expandedRowRender?: (record: RecordType, index: number, indent: number, expanded: boolean) => ReactNode;
|
|
712
|
+
columnTitle?: ReactNode;
|
|
713
|
+
expandRowByClick?: boolean;
|
|
714
|
+
expandIcon?: (props: {
|
|
715
|
+
prefixCls: string;
|
|
716
|
+
expanded: boolean;
|
|
717
|
+
record: RecordType;
|
|
718
|
+
expandable: boolean;
|
|
719
|
+
onExpand: (record: RecordType, event: React.MouseEvent<HTMLElement>) => void;
|
|
720
|
+
}) => ReactNode;
|
|
721
|
+
onExpand?: (expanded: boolean, record: RecordType) => void;
|
|
722
|
+
onExpandedRowsChange?: (expandedKeys: readonly TableKey[]) => void;
|
|
723
|
+
defaultExpandAllRows?: boolean;
|
|
724
|
+
indentSize?: number;
|
|
725
|
+
expandIconColumnIndex?: number;
|
|
726
|
+
showExpandColumn?: boolean;
|
|
727
|
+
expandedRowClassName?: RowClassName<RecordType>;
|
|
728
|
+
childrenColumnName?: string;
|
|
729
|
+
rowExpandable?: (record: RecordType) => boolean;
|
|
730
|
+
columnWidth?: number | string;
|
|
731
|
+
fixed?: FixedType;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
export declare function FileCard(props: FileCardProps): JSX.Element;
|
|
735
|
+
|
|
736
|
+
export declare interface FileCardProps {
|
|
737
|
+
/** 文件名 */
|
|
738
|
+
fileName: string;
|
|
739
|
+
/** 文件类型 */
|
|
740
|
+
fileType: FileType;
|
|
741
|
+
/** 文件 URL(image 类型可展示缩略图) */
|
|
742
|
+
fileUrl?: string;
|
|
743
|
+
/** 自定义类名 */
|
|
744
|
+
className?: string;
|
|
745
|
+
/** 自定义样式 */
|
|
746
|
+
style?: CSSProperties;
|
|
747
|
+
/** 删除回调 */
|
|
748
|
+
onDelete?: () => void;
|
|
749
|
+
/** 修改文件名提交回调 */
|
|
750
|
+
onRename?: (newName: string) => void | Promise<void>;
|
|
751
|
+
/** 预览点击回调 */
|
|
752
|
+
onPreview?: () => void;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
export declare type FileType = 'pdf' | 'image' | 'doc' | 'docx' | 'xls' | 'xlsx' | 'ppt' | 'pptx' | 'zip' | 'rar' | 'txt' | 'other';
|
|
756
|
+
|
|
757
|
+
export declare interface FilterDropdownProps {
|
|
758
|
+
prefixCls: string;
|
|
759
|
+
setSelectedKeys: (selectedKeys: TableKey[]) => void;
|
|
760
|
+
selectedKeys: TableKey[];
|
|
761
|
+
confirm: (options?: {
|
|
762
|
+
closeDropdown?: boolean;
|
|
763
|
+
}) => void;
|
|
764
|
+
clearFilters?: (options?: {
|
|
765
|
+
confirm?: boolean;
|
|
766
|
+
closeDropdown?: boolean;
|
|
767
|
+
}) => void;
|
|
768
|
+
filters?: ColumnFilterItem[];
|
|
769
|
+
close: () => void;
|
|
770
|
+
visible: boolean;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
export declare type FilterRequest = (input: string) => ColumnFilterItem[] | Promise<ColumnFilterItem[]>;
|
|
774
|
+
|
|
775
|
+
export declare type FilterSearchType<RecordType = ColumnFilterItem> = boolean | ((input: string, item: RecordType) => boolean);
|
|
776
|
+
|
|
777
|
+
export declare type FilterValue = Array<TableKey | boolean>;
|
|
778
|
+
|
|
779
|
+
export declare type FixedType = 'left' | 'right' | boolean;
|
|
780
|
+
|
|
781
|
+
declare type GetComponentProps<DataType> = (data: DataType, index?: number) => HTMLAttributes<HTMLElement> | TdHTMLAttributes<HTMLTableCellElement>;
|
|
782
|
+
|
|
783
|
+
export declare type GetRowKey<RecordType> = (record: RecordType, index?: number) => TableKey;
|
|
784
|
+
|
|
785
|
+
declare const Group: ForwardRefExoticComponent<BCheckBoxGroupProps & RefAttributes<HTMLDivElement>>;
|
|
786
|
+
|
|
787
|
+
export declare type ModalLang = 'zh' | 'en';
|
|
788
|
+
|
|
789
|
+
export declare type ModalMode = 'standard' | 'bilingual' | 'single';
|
|
790
|
+
|
|
791
|
+
export declare type OverlayScrollbarDirection = 'vertical' | 'horizontal' | 'both';
|
|
792
|
+
|
|
793
|
+
export declare const Pagination: (props: PaginationProps) => JSX.Element | null;
|
|
794
|
+
|
|
795
|
+
export declare type PaginationAlign = 'start' | 'center' | 'end';
|
|
796
|
+
|
|
797
|
+
export declare interface PaginationProps {
|
|
798
|
+
/** 国际化方法,默认返回原参数 */
|
|
799
|
+
t?: (text: string) => string;
|
|
800
|
+
current?: number;
|
|
801
|
+
defaultCurrent?: number;
|
|
802
|
+
pageSize?: number;
|
|
803
|
+
defaultPageSize?: number;
|
|
804
|
+
total?: number;
|
|
805
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
806
|
+
onShowSizeChange?: (current: number, size: number) => void;
|
|
807
|
+
showSizeChanger?: boolean;
|
|
808
|
+
showQuickJumper?: boolean | {
|
|
809
|
+
goButton?: ReactNode;
|
|
810
|
+
};
|
|
811
|
+
pageSizeOptions?: number[];
|
|
812
|
+
disabled?: boolean;
|
|
813
|
+
hideOnSinglePage?: boolean;
|
|
814
|
+
showTotal?: boolean | ((total: number, range: [number, number]) => ReactNode);
|
|
815
|
+
size?: PaginationSize;
|
|
816
|
+
align?: PaginationAlign;
|
|
817
|
+
simple?: boolean;
|
|
818
|
+
/** 下拉弹框弹出位置,最高优先级。默认自动检测:底部空间不足时翻转到顶部 */
|
|
819
|
+
popupPlacement?: PopupPlacement;
|
|
820
|
+
/**
|
|
821
|
+
* 自定义弹出方向判断逻辑,优先于内置的自动检测。
|
|
822
|
+
* 返回 'top' / 'bottom' 采用返回值;返回 undefined 则回退到内置的自动检测逻辑。
|
|
823
|
+
*/
|
|
824
|
+
resolvePopupPlacement?: (info: {
|
|
825
|
+
/** 触发器(size changer)在视口中的位置 */
|
|
826
|
+
triggerRect: DOMRect;
|
|
827
|
+
/** 下拉面板预估高度 */
|
|
828
|
+
dropdownHeight: number;
|
|
829
|
+
/** 当前视口高度 */
|
|
830
|
+
viewportHeight: number;
|
|
831
|
+
}) => 'top' | 'bottom' | undefined;
|
|
832
|
+
/** 追加到 size changer 下拉面板(.pagination-sizer-dropdown)上的自定义 className */
|
|
833
|
+
dropdownClassName?: string;
|
|
834
|
+
className?: string;
|
|
835
|
+
style?: CSSProperties;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
export declare type PaginationSize = 'small' | 'medium' | 'large';
|
|
839
|
+
|
|
840
|
+
declare type PopupPlacement = 'bottom' | 'top';
|
|
841
|
+
|
|
842
|
+
export declare interface ProductFieldOption {
|
|
843
|
+
/** 选项唯一标识 */
|
|
844
|
+
value: string;
|
|
845
|
+
/** 选项显示内容,支持字符串或 React 元素 */
|
|
846
|
+
label: ReactNode;
|
|
847
|
+
/** 搜索匹配文本,label 为 ReactNode 时必须提供,否则该选项不参与搜索过滤 */
|
|
848
|
+
searchText?: string;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
export declare function ProgressTooltip({ placement, title, progress, className, style, }: ProgressTooltipProps): JSX.Element;
|
|
852
|
+
|
|
853
|
+
export declare interface ProgressTooltipProps extends BaseTooltipProps {
|
|
854
|
+
title?: string;
|
|
855
|
+
progress?: number;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
export declare interface RenderedCell<RecordType> {
|
|
859
|
+
children?: ReactNode;
|
|
860
|
+
props?: CellType<RecordType>;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
declare type RowClassName<RecordType> = (record: RecordType, index: number, indent: number) => string;
|
|
864
|
+
|
|
865
|
+
declare type RowSelectMethod = 'all' | 'none' | 'invert' | 'single' | 'multiple';
|
|
866
|
+
|
|
867
|
+
export declare function SkuInputCard({ id, name, onNameChange, mode, activeLang, onLangChange, showBody, error, onDelete, onPreviewImage, onDeleteImage, onUpload, onAssociate, images, labels, inputEvents, className, style, options, optionFilterProp, onSelect, onSearch, open: controlledOpen, onDropdownVisibleChange, }: SkuInputCardProps): JSX.Element;
|
|
868
|
+
|
|
869
|
+
export declare interface SkuInputCardProps {
|
|
870
|
+
/** Drag handle id, for external DnD libraries */
|
|
871
|
+
id?: string;
|
|
872
|
+
/** Product name value */
|
|
873
|
+
name?: string;
|
|
874
|
+
onNameChange?: (value: string) => void;
|
|
875
|
+
/** single: no language toggle; bilingual: show 中文/EN toggle */
|
|
876
|
+
mode?: SkuInputMode;
|
|
877
|
+
/** Active language when mode is bilingual */
|
|
878
|
+
activeLang?: SkuInputLang;
|
|
879
|
+
onLangChange?: (lang: SkuInputLang) => void;
|
|
880
|
+
/** Show/hide the body content area */
|
|
881
|
+
showBody?: boolean;
|
|
882
|
+
/** Error state — red border + tinted input */
|
|
883
|
+
error?: boolean;
|
|
884
|
+
onDelete?: () => void;
|
|
885
|
+
/** Called when user clicks the preview button on an uploaded image */
|
|
886
|
+
onPreviewImage?: (url: string) => void;
|
|
887
|
+
/** Called when user clicks the delete button on an uploaded image */
|
|
888
|
+
onDeleteImage?: (url: string) => void;
|
|
889
|
+
/**
|
|
890
|
+
* Parent-provided upload handler. Receives the selected File and should
|
|
891
|
+
* return a URL string (or Promise<string>) to display the image.
|
|
892
|
+
* If not provided the component manages uploads internally.
|
|
893
|
+
*/
|
|
894
|
+
onUpload?: (file: File) => string | Promise<string>;
|
|
895
|
+
/** Called when user clicks "关联图片". Parent is responsible for providing the image URL. */
|
|
896
|
+
onAssociate?: () => void;
|
|
897
|
+
/** Externally managed image list (URLs). Controls displayed images when provided. */
|
|
898
|
+
images?: string[];
|
|
899
|
+
/** Override display labels for i18n support */
|
|
900
|
+
labels?: {
|
|
901
|
+
namePlaceholder?: string;
|
|
902
|
+
uploadLocal?: string;
|
|
903
|
+
associateImage?: string;
|
|
904
|
+
searchPlaceholder?: string;
|
|
905
|
+
notFoundContent?: string;
|
|
906
|
+
};
|
|
907
|
+
/** Input event handlers applied to the name input element */
|
|
908
|
+
inputEvents?: Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'style' | 'className'>;
|
|
909
|
+
className?: string;
|
|
910
|
+
style?: CSSProperties;
|
|
911
|
+
/** Options for the search dropdown. When provided the input shows a dropdown on focus/type. */
|
|
912
|
+
options?: SkuInputOption[];
|
|
913
|
+
/** Custom filter: receives the option and the current input value; return true to show. */
|
|
914
|
+
optionFilterProp?: (option: SkuInputOption, inputValue: string) => boolean;
|
|
915
|
+
/** Called when user selects an option from the dropdown. */
|
|
916
|
+
onSelect?: (value: string, option: SkuInputOption) => void;
|
|
917
|
+
/** Called when input value changes while dropdown is active (for remote search). */
|
|
918
|
+
onSearch?: (value: string) => void;
|
|
919
|
+
/** Whether the dropdown is visible (controlled mode). */
|
|
920
|
+
open?: boolean;
|
|
921
|
+
/** Callback when dropdown visibility changes. */
|
|
922
|
+
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
export declare type SkuInputLang = 'zh' | 'en';
|
|
926
|
+
|
|
927
|
+
export declare type SkuInputMode = 'single' | 'bilingual';
|
|
928
|
+
|
|
929
|
+
export declare interface SkuInputOption {
|
|
930
|
+
value: string;
|
|
931
|
+
label: ReactNode;
|
|
932
|
+
disabled?: boolean;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
export declare interface SorterResult<RecordType> {
|
|
936
|
+
column?: ColumnType<RecordType>;
|
|
937
|
+
order?: SortOrder;
|
|
938
|
+
field?: TableKey | readonly TableKey[];
|
|
939
|
+
columnKey?: TableKey;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
export declare type SortOrder = 'ascend' | 'descend' | null;
|
|
943
|
+
|
|
944
|
+
declare type TableAction = 'paginate' | 'sort' | 'filter';
|
|
945
|
+
|
|
946
|
+
export declare type TableAlign = 'left' | 'center' | 'right';
|
|
947
|
+
|
|
948
|
+
export declare interface TableComponents<RecordType> {
|
|
949
|
+
table?: React.ElementType;
|
|
950
|
+
header?: {
|
|
951
|
+
wrapper?: React.ElementType;
|
|
952
|
+
row?: React.ElementType;
|
|
953
|
+
cell?: React.ElementType;
|
|
954
|
+
};
|
|
955
|
+
body?: {
|
|
956
|
+
wrapper?: React.ElementType;
|
|
957
|
+
row?: React.ElementType;
|
|
958
|
+
cell?: React.ElementType;
|
|
959
|
+
} | ((data: readonly RecordType[], info: {
|
|
960
|
+
scrollbarSize: number;
|
|
961
|
+
ref: Ref<{
|
|
962
|
+
scrollLeft: number;
|
|
963
|
+
}>;
|
|
964
|
+
onScroll: (info: {
|
|
965
|
+
currentTarget?: HTMLElement;
|
|
966
|
+
scrollLeft?: number;
|
|
967
|
+
}) => void;
|
|
968
|
+
}) => ReactNode);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
declare interface TableCurrentDataSource<RecordType> {
|
|
972
|
+
currentDataSource: RecordType[];
|
|
973
|
+
action: TableAction;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
export declare type TableDataIndex = string | number | readonly (string | number)[];
|
|
977
|
+
|
|
978
|
+
export declare type TableKey = Exclude<Key, bigint>;
|
|
979
|
+
|
|
980
|
+
declare type TableLayout = 'auto' | 'fixed';
|
|
981
|
+
|
|
982
|
+
export declare interface TableLocale {
|
|
983
|
+
filterTitle?: string;
|
|
984
|
+
filterConfirm?: ReactNode;
|
|
985
|
+
filterReset?: ReactNode;
|
|
986
|
+
filterEmptyText?: ReactNode;
|
|
987
|
+
filterCheckall?: ReactNode;
|
|
988
|
+
filterSearchPlaceholder?: string;
|
|
989
|
+
emptyText?: ReactNode | (() => ReactNode);
|
|
990
|
+
selectAll?: ReactNode;
|
|
991
|
+
selectNone?: ReactNode;
|
|
992
|
+
selectInvert?: ReactNode;
|
|
993
|
+
selectionAll?: ReactNode;
|
|
994
|
+
sortTitle?: string;
|
|
995
|
+
expand?: string;
|
|
996
|
+
collapse?: string;
|
|
997
|
+
triggerDesc?: string;
|
|
998
|
+
triggerAsc?: string;
|
|
999
|
+
cancelSort?: string;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
export declare interface TablePaginationConfig extends PaginationProps {
|
|
1003
|
+
position?: Array<'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight' | 'none'>;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
export declare interface TableProps<RecordType extends object> {
|
|
1007
|
+
columns?: ColumnsType<RecordType>;
|
|
1008
|
+
children?: ReactNode;
|
|
1009
|
+
dataSource?: readonly RecordType[];
|
|
1010
|
+
rowKey?: keyof RecordType | string | GetRowKey<RecordType>;
|
|
1011
|
+
rowSelection?: TableRowSelection<RecordType>;
|
|
1012
|
+
pagination?: false | TablePaginationConfig;
|
|
1013
|
+
loading?: boolean | {
|
|
1014
|
+
spinning?: boolean;
|
|
1015
|
+
tip?: ReactNode;
|
|
1016
|
+
indicator?: ReactNode;
|
|
1017
|
+
};
|
|
1018
|
+
bordered?: boolean;
|
|
1019
|
+
size?: TableSize;
|
|
1020
|
+
showHeader?: boolean;
|
|
1021
|
+
/** Empty-state description. Defaults to `t('暂无数据')`. */
|
|
1022
|
+
emptyText?: ReactNode | (() => ReactNode);
|
|
1023
|
+
/** Empty-state image URL or custom image node. */
|
|
1024
|
+
emptyImage?: string | ReactNode;
|
|
1025
|
+
/** Empty-state body height. Defaults to 454px. */
|
|
1026
|
+
emptyHeight?: number | string;
|
|
1027
|
+
/** Translation function used by built-in Table text. */
|
|
1028
|
+
t?: (text: string) => string;
|
|
1029
|
+
className?: string;
|
|
1030
|
+
style?: CSSProperties;
|
|
1031
|
+
id?: string;
|
|
1032
|
+
rowClassName?: string | RowClassName<RecordType>;
|
|
1033
|
+
tableLayout?: TableLayout;
|
|
1034
|
+
scroll?: {
|
|
1035
|
+
x?: number | true | string;
|
|
1036
|
+
y?: number | string;
|
|
1037
|
+
scrollToFirstRowOnChange?: boolean;
|
|
1038
|
+
};
|
|
1039
|
+
sticky?: boolean | {
|
|
1040
|
+
offsetHeader?: number;
|
|
1041
|
+
offsetSummary?: number;
|
|
1042
|
+
offsetScroll?: number;
|
|
1043
|
+
getContainer?: () => Window | HTMLElement;
|
|
1044
|
+
};
|
|
1045
|
+
direction?: 'ltr' | 'rtl';
|
|
1046
|
+
title?: (data: readonly RecordType[]) => ReactNode;
|
|
1047
|
+
footer?: (data: readonly RecordType[]) => ReactNode;
|
|
1048
|
+
summary?: (data: readonly RecordType[]) => ReactNode;
|
|
1049
|
+
components?: TableComponents<RecordType>;
|
|
1050
|
+
onRow?: GetComponentProps<RecordType>;
|
|
1051
|
+
onHeaderRow?: GetComponentProps<readonly ColumnType<RecordType>[]>;
|
|
1052
|
+
expandable?: ExpandableConfig<RecordType>;
|
|
1053
|
+
locale?: TableLocale;
|
|
1054
|
+
sortDirections?: SortOrder[];
|
|
1055
|
+
showSorterTooltip?: boolean | {
|
|
1056
|
+
title?: ReactNode;
|
|
1057
|
+
};
|
|
1058
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
1059
|
+
onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<RecordType> | SorterResult<RecordType>[], extra: TableCurrentDataSource<RecordType>) => void;
|
|
1060
|
+
ref?: Ref<HTMLDivElement>;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
export declare interface TableRowSelection<RecordType> {
|
|
1064
|
+
preserveSelectedRowKeys?: boolean;
|
|
1065
|
+
type?: TableSelectionType;
|
|
1066
|
+
selectedRowKeys?: TableKey[];
|
|
1067
|
+
defaultSelectedRowKeys?: TableKey[];
|
|
1068
|
+
getCheckboxProps?: (record: RecordType) => {
|
|
1069
|
+
disabled?: boolean;
|
|
1070
|
+
name?: string;
|
|
1071
|
+
};
|
|
1072
|
+
columnTitle?: ReactNode;
|
|
1073
|
+
columnWidth?: number | string;
|
|
1074
|
+
fixed?: FixedType;
|
|
1075
|
+
hideSelectAll?: boolean;
|
|
1076
|
+
checkStrictly?: boolean;
|
|
1077
|
+
selections?: boolean | Array<{
|
|
1078
|
+
key: string;
|
|
1079
|
+
text: ReactNode;
|
|
1080
|
+
onSelect?: (keys: TableKey[]) => void;
|
|
1081
|
+
}>;
|
|
1082
|
+
renderCell?: (checked: boolean, record: RecordType, index: number, originNode: ReactNode) => ReactNode | RenderedCell<RecordType>;
|
|
1083
|
+
onChange?: (selectedRowKeys: TableKey[], selectedRows: RecordType[], info?: {
|
|
1084
|
+
type: RowSelectMethod;
|
|
1085
|
+
}) => void;
|
|
1086
|
+
onSelect?: (record: RecordType, selected: boolean, selectedRows: RecordType[], nativeEvent?: Event) => void;
|
|
1087
|
+
onSelectAll?: (selected: boolean, selectedRows: RecordType[], changeRows?: RecordType[]) => void;
|
|
1088
|
+
onSelectInvert?: (selectedRowKeys: TableKey[]) => void;
|
|
1089
|
+
onSelectNone?: () => void;
|
|
1090
|
+
onSelectMultiple?: (selected: boolean, selectedRows: RecordType[], changeRows: RecordType[]) => void;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
export declare type TableSelectionType = 'checkbox' | 'radio';
|
|
1094
|
+
|
|
1095
|
+
export declare type TableSize = 'large' | 'middle' | 'small';
|
|
1096
|
+
|
|
1097
|
+
export declare function TabPane(_: BTabsTabPaneProps): ReactElement | null;
|
|
1098
|
+
|
|
1099
|
+
export declare namespace TabPane {
|
|
1100
|
+
var displayName: string;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
export declare type TooltipPlacement = 'auto' | 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom';
|
|
1104
|
+
|
|
1105
|
+
export declare type TooltipVariant = 'default' | 'light' | 'bordered' | 'tinted';
|
|
1106
|
+
|
|
1107
|
+
export declare const TooltipWrapper: ForwardRefExoticComponent<TooltipWrapperProps & RefAttributes<HTMLDivElement>>;
|
|
1108
|
+
|
|
1109
|
+
export declare interface TooltipWrapperProps {
|
|
1110
|
+
children: React.ReactNode;
|
|
1111
|
+
style?: CSSProperties;
|
|
1112
|
+
className?: string;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
export { }
|