bj-web-components 0.2.17 → 0.2.19

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.
Files changed (87) hide show
  1. package/dist/index.d.ts +23 -2
  2. package/dist/miniapp.d.ts +1 -1
  3. package/dist/mobile.d.ts +1 -1
  4. package/dist/react.d.ts +1 -1
  5. package/dist/shared.d.ts +1 -1
  6. package/dist/style.css +1 -1
  7. package/dist/web/Dropdown/BDropdown.js +1 -1
  8. package/dist/web/Dropdown/BDropdown.mjs +38 -38
  9. package/dist/web/Table/BTable.js +1 -1
  10. package/dist/web/Table/BTable.mjs +447 -419
  11. package/dist/web.d.ts +1138 -2
  12. package/package.json +1 -1
  13. package/dist/miniapp/index.d.ts +0 -0
  14. package/dist/mobile/index.d.ts +0 -0
  15. package/dist/react/index.d.ts +0 -0
  16. package/dist/shared/index.d.ts +0 -0
  17. package/dist/web/BasicInput/BInput.d.ts +0 -3
  18. package/dist/web/BasicInput/index.d.ts +0 -2
  19. package/dist/web/BasicInput/types.d.ts +0 -32
  20. package/dist/web/BasicInput/utils.d.ts +0 -13
  21. package/dist/web/CategoryDropdown/CategoryDropdown.d.ts +0 -2
  22. package/dist/web/CategoryDropdown/index.d.ts +0 -2
  23. package/dist/web/CategoryDropdown/types.d.ts +0 -31
  24. package/dist/web/CheckBox/BCheckBox.d.ts +0 -3
  25. package/dist/web/CheckBox/Group.d.ts +0 -3
  26. package/dist/web/CheckBox/context.d.ts +0 -11
  27. package/dist/web/CheckBox/index.d.ts +0 -9
  28. package/dist/web/CheckBox/types.d.ts +0 -54
  29. package/dist/web/Dropdown/BDropdown.d.ts +0 -2
  30. package/dist/web/Dropdown/index.d.ts +0 -2
  31. package/dist/web/Dropdown/types.d.ts +0 -41
  32. package/dist/web/EmptyInputBox/EmptyInputBox.d.ts +0 -3
  33. package/dist/web/EmptyInputBox/index.d.ts +0 -2
  34. package/dist/web/EmptyInputBox/types.d.ts +0 -28
  35. package/dist/web/FileCard/FileCard.d.ts +0 -2
  36. package/dist/web/FileCard/index.d.ts +0 -2
  37. package/dist/web/FileCard/types.d.ts +0 -20
  38. package/dist/web/Icon/Icon.d.ts +0 -6
  39. package/dist/web/Icon/index.d.ts +0 -2
  40. package/dist/web/Icon/types.d.ts +0 -11
  41. package/dist/web/Input/Input.d.ts +0 -3
  42. package/dist/web/Input/index.d.ts +0 -2
  43. package/dist/web/Input/types.d.ts +0 -55
  44. package/dist/web/InputNumber/BInputNumber.d.ts +0 -3
  45. package/dist/web/InputNumber/StepHandler.d.ts +0 -10
  46. package/dist/web/InputNumber/hooks/useCursor.d.ts +0 -2
  47. package/dist/web/InputNumber/hooks/useFrame.d.ts +0 -2
  48. package/dist/web/InputNumber/index.d.ts +0 -2
  49. package/dist/web/InputNumber/types.d.ts +0 -60
  50. package/dist/web/InputNumber/utils/decimal.d.ts +0 -46
  51. package/dist/web/Modal/Modal.d.ts +0 -2
  52. package/dist/web/Modal/index.d.ts +0 -2
  53. package/dist/web/Modal/types.d.ts +0 -42
  54. package/dist/web/OverlayScrollbar/BOverlayScrollbar.d.ts +0 -2
  55. package/dist/web/OverlayScrollbar/index.d.ts +0 -2
  56. package/dist/web/OverlayScrollbar/types.d.ts +0 -18
  57. package/dist/web/Pagination/Pagination.d.ts +0 -3
  58. package/dist/web/Pagination/index.d.ts +0 -2
  59. package/dist/web/Pagination/types.d.ts +0 -44
  60. package/dist/web/ProductField/ProductField.d.ts +0 -2
  61. package/dist/web/ProductField/index.d.ts +0 -2
  62. package/dist/web/ProductField/types.d.ts +0 -48
  63. package/dist/web/SkuInputCard/SkuInputCard.d.ts +0 -2
  64. package/dist/web/SkuInputCard/index.d.ts +0 -2
  65. package/dist/web/SkuInputCard/types.d.ts +0 -63
  66. package/dist/web/Switch/Switch.d.ts +0 -6
  67. package/dist/web/Switch/index.d.ts +0 -2
  68. package/dist/web/Switch/types.d.ts +0 -29
  69. package/dist/web/Table/BTable.d.ts +0 -10
  70. package/dist/web/Table/Column.d.ts +0 -3
  71. package/dist/web/Table/ColumnGroup.d.ts +0 -3
  72. package/dist/web/Table/index.d.ts +0 -4
  73. package/dist/web/Table/types.d.ts +0 -299
  74. package/dist/web/Table/utils/columns.d.ts +0 -11
  75. package/dist/web/Table/utils/sortFilter.d.ts +0 -7
  76. package/dist/web/Tabs/BTabs.d.ts +0 -8
  77. package/dist/web/Tabs/TabPane.d.ts +0 -7
  78. package/dist/web/Tabs/index.d.ts +0 -3
  79. package/dist/web/Tabs/types.d.ts +0 -32
  80. package/dist/web/Tooltip/ConfirmTooltip.d.ts +0 -2
  81. package/dist/web/Tooltip/ContentTooltip.d.ts +0 -2
  82. package/dist/web/Tooltip/ProgressTooltip.d.ts +0 -2
  83. package/dist/web/Tooltip/TooltipWrapper.d.ts +0 -3
  84. package/dist/web/Tooltip/index.d.ts +0 -6
  85. package/dist/web/Tooltip/types.d.ts +0 -36
  86. package/dist/web/Tooltip/useAutoPlacement.d.ts +0 -7
  87. package/dist/web/index.d.ts +0 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bj-web-components",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "Enterprise UI component library for Web, Mobile, and Mini-app platforms",
5
5
  "keywords": [
6
6
  "react",
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +0,0 @@
1
- import { BInputProps, BInputRef } from './types';
2
- declare const BInput: import('react').ForwardRefExoticComponent<BInputProps & import('react').RefAttributes<BInputRef>>;
3
- export default BInput;
@@ -1,2 +0,0 @@
1
- export { default as BInput } from './BInput';
2
- export type { BInputFocusOptions, BInputProps, BInputRef, BInputSize, BInputStatus } from './types';
@@ -1,32 +0,0 @@
1
- import { CSSProperties, InputHTMLAttributes, KeyboardEventHandler, ReactNode } from 'react';
2
- export type BInputSize = 'small' | 'middle' | 'large';
3
- export type BInputStatus = 'error' | 'warning';
4
- export interface BInputFocusOptions extends FocusOptions {
5
- cursor?: 'start' | 'end' | 'all';
6
- }
7
- export interface BInputRef {
8
- focus: (options?: BInputFocusOptions) => void;
9
- blur: () => void;
10
- setSelectionRange: HTMLInputElement['setSelectionRange'];
11
- select: () => void;
12
- input: HTMLInputElement | null;
13
- nativeElement: HTMLElement | null;
14
- }
15
- export interface BInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'value'> {
16
- value?: InputHTMLAttributes<HTMLInputElement>['value'] | bigint;
17
- prefix?: ReactNode;
18
- suffix?: ReactNode;
19
- addonBefore?: ReactNode;
20
- addonAfter?: ReactNode;
21
- allowClear?: boolean | {
22
- clearIcon?: ReactNode;
23
- };
24
- size?: BInputSize;
25
- status?: BInputStatus;
26
- bordered?: boolean;
27
- htmlSize?: number;
28
- onPressEnter?: KeyboardEventHandler<HTMLInputElement>;
29
- onClear?: () => void;
30
- className?: string;
31
- style?: CSSProperties;
32
- }
@@ -1,13 +0,0 @@
1
- import { ChangeEvent, CompositionEvent, MouseEvent } from 'react';
2
- import { BInputFocusOptions } from './types';
3
- export declare function hasAddon(props: {
4
- addonBefore?: unknown;
5
- addonAfter?: unknown;
6
- }): boolean;
7
- export declare function hasPrefixSuffix(props: {
8
- prefix?: unknown;
9
- suffix?: unknown;
10
- allowClear?: unknown;
11
- }): boolean;
12
- export declare function resolveOnChange(target: HTMLInputElement, event: ChangeEvent<HTMLInputElement> | MouseEvent<HTMLElement> | CompositionEvent<HTMLInputElement>, onChange: ((event: ChangeEvent<HTMLInputElement>) => void) | undefined, targetValue?: string): void;
13
- export declare function triggerFocus(element?: HTMLInputElement | null, option?: BInputFocusOptions): void;
@@ -1,2 +0,0 @@
1
- import { BuCategoryDropdownProps } from './types';
2
- export default function BuCategoryDropdown({ data, value, onChange, placeholder, disabled, maxVisible, className, style, getPopupContainer, dropdownStyle: customDropdownStyle, }: BuCategoryDropdownProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- export { default as BuCategoryDropdown } from './CategoryDropdown';
2
- export type { BuCategoryDropdownProps, CategoryItem } from './types';
@@ -1,31 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- export interface CategoryItem {
3
- /** 唯一标识 */
4
- value: string;
5
- /** 显示文字 */
6
- label: string;
7
- /** 是否禁用(分类未创建好时不可选) */
8
- disabled?: boolean;
9
- /** 子分类 */
10
- children?: CategoryItem[];
11
- }
12
- export interface BuCategoryDropdownProps {
13
- /** 分类树数据 */
14
- data: CategoryItem[];
15
- /** 当前选中路径,数组索引对应层级 */
16
- value?: string[];
17
- /** 选中回调,返回新路径和对应的节点数组 */
18
- onChange?: (value: string[], path: CategoryItem[]) => void;
19
- /** 触发按钮占位文字 */
20
- placeholder?: string;
21
- /** 是否禁用整个组件 */
22
- disabled?: boolean;
23
- /** 每列最多显示几项,超出后出现滚动条,默认 6 */
24
- maxVisible?: number;
25
- className?: string;
26
- style?: CSSProperties;
27
- /** 自定义下拉面板挂载容器,返回目标 DOM 元素。默认挂载到 document.body */
28
- getPopupContainer?: () => HTMLElement;
29
- /** 追加到下拉面板(.bu-category-dropdown__portal)内联样式上,与内部计算出的定位样式(position/top/left/zIndex)合并 */
30
- dropdownStyle?: CSSProperties;
31
- }
@@ -1,3 +0,0 @@
1
- import { BCheckBoxProps } from './types';
2
- declare const BCheckBox: import('react').ForwardRefExoticComponent<BCheckBoxProps & import('react').RefAttributes<HTMLInputElement>>;
3
- export default BCheckBox;
@@ -1,3 +0,0 @@
1
- import { BCheckBoxGroupProps } from './types';
2
- declare const Group: import('react').ForwardRefExoticComponent<BCheckBoxGroupProps & import('react').RefAttributes<HTMLDivElement>>;
3
- export default Group;
@@ -1,11 +0,0 @@
1
- import { CheckboxOptionType, CheckboxValueType, BCheckBoxVariant } from './types';
2
- export interface CheckBoxGroupContextValue {
3
- name?: string;
4
- value: CheckboxValueType[];
5
- disabled?: boolean;
6
- variant?: BCheckBoxVariant;
7
- registerValue: (value: CheckboxValueType) => void;
8
- cancelValue: (value: CheckboxValueType) => void;
9
- toggleOption: (option: CheckboxOptionType) => void;
10
- }
11
- export declare const CheckBoxGroupContext: import('react').Context<CheckBoxGroupContextValue | null>;
@@ -1,9 +0,0 @@
1
- import { default as BCheckBox } from './BCheckBox';
2
- import { default as Group } from './Group';
3
- declare const CompoundBCheckBox: typeof BCheckBox & {
4
- Group: typeof Group;
5
- __ANT_CHECKBOX: boolean;
6
- };
7
- export { CompoundBCheckBox as BCheckBox };
8
- export default CompoundBCheckBox;
9
- export type { BCheckBoxGroupProps, BCheckBoxProps, BCheckBoxVariant, CheckboxChangeEvent, CheckboxChangeEventTarget, CheckboxOptionType, CheckboxValueType, } from './types';
@@ -1,54 +0,0 @@
1
- import { CSSProperties, FocusEventHandler, InputHTMLAttributes, KeyboardEventHandler, MouseEventHandler, ReactNode } from 'react';
2
- export type CheckboxValueType = string | number | boolean;
3
- export type BCheckBoxVariant = 'dark' | 'white';
4
- export interface BCheckBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'children' | 'defaultChecked' | 'onChange' | 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'style' | 'type' | 'value'> {
5
- className?: string;
6
- style?: CSSProperties;
7
- defaultChecked?: boolean;
8
- checked?: boolean;
9
- disabled?: boolean;
10
- indeterminate?: boolean;
11
- onChange?: (event: CheckboxChangeEvent) => void;
12
- onClick?: MouseEventHandler<HTMLInputElement>;
13
- onMouseEnter?: MouseEventHandler<HTMLLabelElement>;
14
- onMouseLeave?: MouseEventHandler<HTMLLabelElement>;
15
- onFocus?: FocusEventHandler<HTMLInputElement>;
16
- onBlur?: FocusEventHandler<HTMLInputElement>;
17
- onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
18
- onKeyPress?: KeyboardEventHandler<HTMLInputElement>;
19
- onKeyUp?: KeyboardEventHandler<HTMLInputElement>;
20
- value?: CheckboxValueType;
21
- children?: ReactNode;
22
- skipGroup?: boolean;
23
- direction?: 'ltr' | 'rtl';
24
- variant?: BCheckBoxVariant;
25
- }
26
- export interface CheckboxChangeEventTarget extends BCheckBoxProps {
27
- checked: boolean;
28
- }
29
- export interface CheckboxChangeEvent {
30
- target: CheckboxChangeEventTarget;
31
- stopPropagation: () => void;
32
- preventDefault: () => void;
33
- nativeEvent: Event;
34
- }
35
- export interface CheckboxOptionType {
36
- label: ReactNode;
37
- value: CheckboxValueType;
38
- style?: CSSProperties;
39
- disabled?: boolean;
40
- onChange?: (event: CheckboxChangeEvent) => void;
41
- }
42
- export interface BCheckBoxGroupProps {
43
- className?: string;
44
- style?: CSSProperties;
45
- name?: string;
46
- options?: Array<CheckboxOptionType | string | number>;
47
- disabled?: boolean;
48
- defaultValue?: CheckboxValueType[];
49
- value?: CheckboxValueType[];
50
- onChange?: (checkedValues: CheckboxValueType[]) => void;
51
- children?: ReactNode;
52
- direction?: 'ltr' | 'rtl';
53
- variant?: BCheckBoxVariant;
54
- }
@@ -1,2 +0,0 @@
1
- import { BDropdownProps } from './types';
2
- 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): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- export { BDropdown } from './BDropdown';
2
- export type { BDropdownOption, BDropdownProps, BDropdownValue } from './types';
@@ -1,41 +0,0 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- export type BDropdownValue = string | number | boolean;
3
- export interface BDropdownOption {
4
- label: ReactNode;
5
- /** Secondary text displayed when optionMode is "double-line". */
6
- description?: ReactNode;
7
- value: BDropdownValue;
8
- disabled?: boolean;
9
- }
10
- export interface BDropdownProps {
11
- className?: string;
12
- style?: CSSProperties;
13
- options: BDropdownOption[];
14
- value?: BDropdownValue[];
15
- defaultValue?: BDropdownValue[];
16
- multiple?: boolean;
17
- /** Option layout. Double-line options display label and description. */
18
- optionMode?: 'single-line' | 'double-line';
19
- searchable?: boolean;
20
- searchValue?: string;
21
- searchPlaceholder?: string;
22
- onSearch?: (value: string) => void;
23
- filterOption?: boolean | ((input: string, option: BDropdownOption) => boolean);
24
- /** Empty-state content. Takes precedence over labels.emptyText. */
25
- emptyText?: ReactNode;
26
- /** Override default labels for i18n support. */
27
- labels?: {
28
- emptyText?: ReactNode;
29
- };
30
- /** Internationalization function. Defaults to returning the original text. */
31
- t?: (text: string) => string;
32
- optionRender?: (option: BDropdownOption) => ReactNode;
33
- onChange?: (value: BDropdownValue[], option: BDropdownOption) => void;
34
- footer?: boolean | ReactNode;
35
- showReset?: boolean;
36
- showConfirm?: boolean;
37
- resetText?: ReactNode;
38
- confirmText?: ReactNode;
39
- onReset?: () => void;
40
- onConfirm?: (value: BDropdownValue[]) => void;
41
- }
@@ -1,3 +0,0 @@
1
- import { BuEmptyInputBoxProps } from './types';
2
- declare const BuEmptyInputBox: import('react').ForwardRefExoticComponent<BuEmptyInputBoxProps & import('react').RefAttributes<HTMLInputElement>>;
3
- export default BuEmptyInputBox;
@@ -1,2 +0,0 @@
1
- export { default as BuEmptyInputBox } from './EmptyInputBox';
2
- export type { BuEmptyInputBoxProps, BuEmptyInputBoxMode, BuEmptyInputBoxLang } from './types';
@@ -1,28 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- export type BuEmptyInputBoxMode = 'single' | 'bilingual';
3
- export type BuEmptyInputBoxLang = 'zh' | 'en';
4
- export interface BuEmptyInputBoxProps {
5
- /** 单语 / 双语模式 */
6
- mode?: BuEmptyInputBoxMode;
7
- /** 双语模式下当前激活的语言 */
8
- activeLang?: BuEmptyInputBoxLang;
9
- onLangChange?: (lang: BuEmptyInputBoxLang) => void;
10
- /** 受控值,与 antd Form 兼容 */
11
- value?: string;
12
- onChange?: (value: string) => void;
13
- placeholder?: string;
14
- maxLength?: number;
15
- /** 错误状态 */
16
- error?: boolean;
17
- disabled?: boolean;
18
- /** 点击删除按钮回调(传入时显示删除按钮) */
19
- onDelete?: () => void;
20
- /** Override display labels for i18n support */
21
- labels?: {
22
- zh?: string;
23
- en?: string;
24
- };
25
- id?: string;
26
- className?: string;
27
- style?: CSSProperties;
28
- }
@@ -1,2 +0,0 @@
1
- import { FileCardProps } from './types';
2
- export default function FileCard(props: FileCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- export { default as FileCard } from './FileCard';
2
- export type { FileCardProps, FileType } from './types';
@@ -1,20 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- export type FileType = 'pdf' | 'image' | 'doc' | 'docx' | 'xls' | 'xlsx' | 'ppt' | 'pptx' | 'zip' | 'rar' | 'txt' | 'other';
3
- export interface FileCardProps {
4
- /** 文件名 */
5
- fileName: string;
6
- /** 文件类型 */
7
- fileType: FileType;
8
- /** 文件 URL(image 类型可展示缩略图) */
9
- fileUrl?: string;
10
- /** 自定义类名 */
11
- className?: string;
12
- /** 自定义样式 */
13
- style?: CSSProperties;
14
- /** 删除回调 */
15
- onDelete?: () => void;
16
- /** 修改文件名提交回调 */
17
- onRename?: (newName: string) => void | Promise<void>;
18
- /** 预览点击回调 */
19
- onPreview?: () => void;
20
- }
@@ -1,6 +0,0 @@
1
- import { BuIconProps } from './types';
2
- declare const BuIcon: {
3
- ({ type, style, onClick, className, ...rest }: BuIconProps): import("react/jsx-runtime").JSX.Element;
4
- displayName: string;
5
- };
6
- export default BuIcon;
@@ -1,2 +0,0 @@
1
- export { default as BuIcon } from './Icon';
2
- export type { BuIconProps } from './types';
@@ -1,11 +0,0 @@
1
- import { CSSProperties, MouseEventHandler, SVGProps } from 'react';
2
- export interface BuIconProps extends Omit<SVGProps<SVGSVGElement>, 'onClick' | 'style' | 'className'> {
3
- /** iconfont symbol id(不含 # 前缀),对应 <symbol id="icon-xxx"> */
4
- type: string;
5
- /** 自定义样式 */
6
- style?: CSSProperties;
7
- /** 点击事件 */
8
- onClick?: MouseEventHandler<SVGSVGElement>;
9
- /** 自定义类名 */
10
- className?: string;
11
- }
@@ -1,3 +0,0 @@
1
- import { BuInputProps } from './types';
2
- declare const BuInput: import('react').ForwardRefExoticComponent<BuInputProps & import('react').RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
3
- export default BuInput;
@@ -1,2 +0,0 @@
1
- export { default as BuInput } from './Input';
2
- export type { BuInputProps, BuInputMode, BuInputLang, BuInputType } from './types';
@@ -1,55 +0,0 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- export type BuInputMode = 'single' | 'bilingual';
3
- export type BuInputLang = 'zh' | 'en';
4
- export type BuInputType = 'input' | 'textarea' | 'number';
5
- export interface BuInputProps {
6
- /** 输入框类型:input(单行)| textarea(多行) */
7
- type?: BuInputType;
8
- /** 单语 / 双语模式 */
9
- mode?: BuInputMode;
10
- /** 双语模式下当前激活的语言 */
11
- activeLang?: BuInputLang;
12
- onLangChange?: (lang: BuInputLang) => void;
13
- /** 受控值,与 antd Form 兼容 */
14
- value?: string;
15
- onChange?: (value: string) => void;
16
- /** 标签文字 */
17
- label?: string;
18
- /** 是否必填(label 前显示红色 *) */
19
- required?: boolean;
20
- placeholder?: string;
21
- /** 最大字符数,配合 showCount 使用 */
22
- maxLength?: number;
23
- /** 是否显示字符计数,双语模式下始终显示 */
24
- showCount?: boolean;
25
- /** 错误状态:无值时 placeholder 变红;有值时显示 errorMessage */
26
- error?: boolean;
27
- /** 错误提示文字(有输入值 + error=true 时显示在输入框下方) */
28
- errorMessage?: string;
29
- disabled?: boolean;
30
- /** 数字步进器最小值(type='number' 时生效) */
31
- min?: number;
32
- /** 数字步进器最大值(type='number' 时生效) */
33
- max?: number;
34
- /** 数字步进器步长(type='number' 时生效) */
35
- step?: number;
36
- /** 输入框左侧 icon,如拖拽把手 */
37
- leftIcon?: ReactNode;
38
- /** 输入框右侧 icon,如删除按钮 */
39
- rightIcon?: ReactNode;
40
- /** 自定义语言切换按钮,替换内置的中文/EN 按钮,双语模式下生效 */
41
- langToggle?: ReactNode;
42
- /** 正在翻译中状态,显示 loading 指示器 */
43
- translating?: boolean;
44
- /** 翻译完成状态,显示对勾 */
45
- translated?: boolean;
46
- onBlur?: () => void;
47
- /** Override display labels for i18n support */
48
- labels?: {
49
- zh?: string;
50
- en?: string;
51
- };
52
- id?: string;
53
- className?: string;
54
- style?: CSSProperties;
55
- }
@@ -1,3 +0,0 @@
1
- import { BInputNumberProps } from './types';
2
- declare const BInputNumber: import('react').ForwardRefExoticComponent<BInputNumberProps & import('react').RefAttributes<HTMLInputElement>>;
3
- export default BInputNumber;
@@ -1,10 +0,0 @@
1
- import { ReactNode } from 'react';
2
- interface StepHandlerProps {
3
- /** Custom node for the whole control. Defaults to the combined up/down icon. */
4
- icon?: ReactNode;
5
- upDisabled: boolean;
6
- downDisabled: boolean;
7
- onStep: (up: boolean) => void;
8
- }
9
- export default function StepHandler({ icon, upDisabled, downDisabled, onStep }: StepHandlerProps): import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,2 +0,0 @@
1
- /** Keep the input cursor in the correct position across re-formatting. */
2
- export default function useCursor(input: HTMLInputElement | null, focused: boolean): [recordCursor: () => void, restoreCursor: () => void];
@@ -1,2 +0,0 @@
1
- /** Runs `callback` on the next animation frame, always cancelling any previously queued call. */
2
- export default function useFrame(): (callback: () => void) => void;
@@ -1,2 +0,0 @@
1
- export { default as BInputNumber } from './BInputNumber';
2
- export type { BInputNumberProps, BInputNumberSize, BInputNumberStatus } from './types';
@@ -1,60 +0,0 @@
1
- import { CSSProperties, FocusEvent, KeyboardEvent, ReactNode } from 'react';
2
- export type BInputNumberSize = 'small' | 'middle' | 'large';
3
- export type BInputNumberStatus = 'error' | 'warning';
4
- export interface BInputNumberProps {
5
- value?: number | string | null;
6
- defaultValue?: number | string | null;
7
- onChange?: (value: number | null) => void;
8
- min?: number | string;
9
- max?: number | string;
10
- /** Step used by the up/down controls and ArrowUp/ArrowDown. Defaults to 1. */
11
- step?: number | string;
12
- /** Fixed decimal precision. When unset, inferred from the value/step. */
13
- precision?: number;
14
- disabled?: boolean;
15
- readOnly?: boolean;
16
- placeholder?: string;
17
- autoFocus?: boolean;
18
- size?: BInputNumberSize;
19
- status?: BInputNumberStatus;
20
- /** Set to false for a borderless input. */
21
- bordered?: boolean;
22
- /**
23
- * Show up/down controls, or provide a custom icon. Defaults to true.
24
- * The default control is a single combined up/down icon: clicking its top half increases
25
- * the value, its bottom half decreases it.
26
- */
27
- controls?: boolean | {
28
- icon?: ReactNode;
29
- };
30
- /** Enable ArrowUp/ArrowDown keyboard stepping. Defaults to true. */
31
- keyboard?: boolean;
32
- /** Step on mouse wheel while focused. Defaults to false. */
33
- changeOnWheel?: boolean;
34
- /** Flush the input value to onChange on blur. Defaults to true. */
35
- changeOnBlur?: boolean;
36
- addonBefore?: ReactNode;
37
- addonAfter?: ReactNode;
38
- prefix?: ReactNode;
39
- suffix?: ReactNode;
40
- /** Custom display formatter, e.g. `(v) => \`$ ${v}\`` */
41
- formatter?: (value: number | string | undefined, info: {
42
- userTyping: boolean;
43
- input: string;
44
- }) => string;
45
- /** Reverse of `formatter`: strips display-only characters before parsing. */
46
- parser?: (displayValue: string) => string;
47
- /** Decimal separator for both display and parsing, e.g. ',' for locales that use it. */
48
- decimalSeparator?: string;
49
- onStep?: (value: number, info: {
50
- offset: number | string;
51
- type: 'up' | 'down';
52
- }) => void;
53
- onPressEnter?: (event: KeyboardEvent<HTMLInputElement>) => void;
54
- onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
55
- onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
56
- id?: string;
57
- name?: string;
58
- className?: string;
59
- style?: CSSProperties;
60
- }
@@ -1,46 +0,0 @@
1
- /**
2
- * Minimal, dependency-free precision-safe decimal helper.
3
- * Ported (and trimmed to the Number-only path) from `@rc-component/mini-decimal`,
4
- * which `rc-input-number` relies on. BigInt string-mode support was dropped since
5
- * this component only needs to match native `number` precision, not arbitrary
6
- * precision big numbers.
7
- */
8
- export declare function isEmptyValue(value: unknown): boolean;
9
- export interface TrimmedNumber {
10
- negative: boolean;
11
- negativeStr: string;
12
- trimStr: string;
13
- integerStr: string;
14
- decimalStr: string;
15
- fullStr: string;
16
- }
17
- /** Format string number to a readable, zero-trimmed number string. */
18
- export declare function trimNumber(numStr: string): TrimmedNumber;
19
- /** [Legacy] Convert 1e-9 to 0.000000001. May lose precision for very large exponents. */
20
- export declare function getNumberPrecision(number: unknown): number;
21
- /** Convert a number (including scientific notation) to `-xxx.yyy` format string. */
22
- export declare function num2str(number: number): string;
23
- export declare function validateNumber(num: unknown): boolean;
24
- export declare class Decimal {
25
- private origin;
26
- private number;
27
- private empty;
28
- constructor(value: unknown);
29
- negate(): Decimal;
30
- add(value: unknown): Decimal;
31
- isEmpty(): boolean;
32
- isNaN(): boolean;
33
- isInvalidate(): boolean;
34
- equals(target: Decimal | null | undefined): boolean;
35
- lessEquals(target: Decimal): boolean;
36
- toNumber(): number;
37
- toString(safe?: boolean): string;
38
- }
39
- export declare function getDecimal(value: unknown): Decimal;
40
- /**
41
- * Align the logic of toFixed to round like 1.5 => 2.
42
- * If `cutOnly` is set, will just truncate the extra decimal part instead of rounding.
43
- */
44
- export declare function toFixed(numStr: string, separatorStr: string, precision?: number, cutOnly?: boolean): string;
45
- /** Returns the step value multiplied by 10, used for Shift+ArrowUp/Down. */
46
- export declare function getDecupleSteps(step: number | string): string;
@@ -1,2 +0,0 @@
1
- import { BuModalProps } from './types';
2
- export default function BuModal({ open, title, mode, children, okText, cancelText, onOk, onCancel, onClose, activeLang, onLangChange, labels, hint, confirmLoading, width, className, style, }: BuModalProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,2 +0,0 @@
1
- export { default as BuModal } from './Modal';
2
- export type { BuModalProps, ModalMode, ModalLang } from './types';
@@ -1,42 +0,0 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- export type ModalMode = 'standard' | 'bilingual' | 'single';
3
- export type ModalLang = 'zh' | 'en';
4
- export interface BuModalProps {
5
- /** 是否显示弹窗 */
6
- open?: boolean;
7
- /** 弹窗标题 */
8
- title?: string;
9
- /** 弹窗模式:standard 双按钮 | bilingual 双语双按钮 | single 单按钮居中 */
10
- mode?: ModalMode;
11
- /** 弹窗内容 */
12
- children?: ReactNode;
13
- /** 确认按钮文字 */
14
- okText?: string;
15
- /** 取消按钮文字(standard / bilingual 模式生效) */
16
- cancelText?: string;
17
- /** 确认回调 */
18
- onOk?: () => void;
19
- /** 取消回调 */
20
- onCancel?: () => void;
21
- /** 关闭回调(点击 × 或遮罩) */
22
- onClose?: () => void;
23
- /** bilingual 模式下当前激活语言 */
24
- activeLang?: ModalLang;
25
- /** bilingual 模式下语言切换回调 */
26
- onLangChange?: (lang: ModalLang) => void;
27
- /** 按钮上方的提示文字,12px #999 */
28
- hint?: string;
29
- /** Override display labels for i18n support */
30
- labels?: {
31
- zh?: string;
32
- en?: string;
33
- };
34
- /** 确认按钮加载中状态 */
35
- confirmLoading?: boolean;
36
- /** 弹窗宽度,默认 480px,作用于内层白框 */
37
- width?: number | string;
38
- /** 自定义类名,挂在最外层遮罩上(整个 modal) */
39
- className?: string;
40
- /** 自定义样式,作用于内层白框 */
41
- style?: CSSProperties;
42
- }
@@ -1,2 +0,0 @@
1
- import { BOverlayScrollbarProps } from './types';
2
- export default function BOverlayScrollbar({ containerRef, targetRef, selector, direction, size, gap, background, showOnHover, showOnScroll, hoverSelector, horizontalInsetStart, horizontalInsetEnd, horizontalThumbLength, className, }: BOverlayScrollbarProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- export { default as BOverlayScrollbar } from './BOverlayScrollbar';
2
- export type { BOverlayScrollbarProps, OverlayScrollbarDirection } from './types';
@@ -1,18 +0,0 @@
1
- import { CSSProperties, RefObject } from 'react';
2
- export type OverlayScrollbarDirection = 'vertical' | 'horizontal' | 'both';
3
- export interface BOverlayScrollbarProps {
4
- containerRef: RefObject<HTMLElement | null>;
5
- targetRef?: RefObject<HTMLElement | null>;
6
- selector?: string;
7
- direction?: OverlayScrollbarDirection;
8
- size?: number;
9
- gap?: number;
10
- background?: CSSProperties['backgroundColor'];
11
- showOnHover?: boolean;
12
- showOnScroll?: boolean;
13
- hoverSelector?: string;
14
- horizontalInsetStart?: number;
15
- horizontalInsetEnd?: number;
16
- horizontalThumbLength?: number;
17
- className?: string;
18
- }
@@ -1,3 +0,0 @@
1
- import { PaginationProps } from './types';
2
- declare const Pagination: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element | null;
3
- export default Pagination;
@@ -1,2 +0,0 @@
1
- export { default as Pagination } from './Pagination';
2
- export type { PaginationProps, PaginationSize, PaginationAlign } from './types';