@aozi6666/bee-design 0.1.0 → 0.2.2
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/App.d.ts +4 -0
- package/{build → dist}/components/AutoComplete/autoComplete.d.ts +2 -2
- package/{build → dist}/components/AutoComplete/autoComplete.types.d.ts +4 -4
- package/{build → dist}/components/AutoComplete/autoCompleteDropdown.d.ts +2 -2
- package/dist/components/AutoComplete/index.d.ts +4 -0
- package/{build → dist}/components/Button/button.d.ts +2 -2
- package/{build → dist}/components/Button/button.types.d.ts +1 -1
- package/dist/components/Button/index.d.ts +2 -0
- package/{build → dist}/components/Icon/icon.d.ts +2 -2
- package/dist/components/Icon/icon.types.d.ts +6 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/Input/index.d.ts +4 -0
- package/dist/components/Input/input.d.ts +5 -0
- package/{build → dist}/components/Input/input.types.d.ts +4 -4
- package/{build → dist}/components/Menu/index.d.ts +4 -4
- package/{build → dist}/components/Menu/menu.d.ts +2 -10
- package/dist/components/Menu/menuContext.d.ts +9 -0
- package/{build → dist}/components/Menu/menuItem.d.ts +2 -2
- package/{build → dist}/components/Menu/subMenu.d.ts +1 -1
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/progress.d.ts +4 -0
- package/{build → dist}/components/Progress/progress.types.d.ts +2 -2
- package/dist/components/Transition/index.d.ts +3 -0
- package/dist/components/Transition/transition.d.ts +4 -0
- package/dist/components/Transition/transition.types.d.ts +9 -0
- package/{build → dist}/components/Upload/dragger.d.ts +1 -1
- package/dist/components/Upload/index.d.ts +2 -0
- package/{build → dist}/components/Upload/upload.d.ts +2 -2
- package/{build → dist}/components/Upload/upload.types.d.ts +7 -11
- package/{build → dist}/components/Upload/uploadList.d.ts +2 -2
- package/dist/hooks/useClickOutside.d.ts +3 -0
- package/dist/hooks/useDebounce.d.ts +2 -0
- package/dist/index.cjs +16272 -0
- package/dist/index.cjs.map +1 -0
- package/{build → dist}/index.css +24 -24
- package/dist/index.d.ts +9 -0
- package/dist/index.esm.js +709 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +14381 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/setupIcons.d.ts +1 -0
- package/dist/setupTests.d.ts +1 -0
- package/package.json +61 -48
- package/README.md +0 -73
- package/build/App.d.ts +0 -4
- package/build/App.js +0 -137
- package/build/components/AutoComplete/autoComplete.js +0 -123
- package/build/components/AutoComplete/autoComplete.types.js +0 -1
- package/build/components/AutoComplete/autoCompleteDropdown.js +0 -17
- package/build/components/AutoComplete/index.d.ts +0 -4
- package/build/components/AutoComplete/index.js +0 -3
- package/build/components/Button/button.js +0 -43
- package/build/components/Button/button.types.js +0 -19
- package/build/components/Button/index.d.ts +0 -2
- package/build/components/Button/index.js +0 -2
- package/build/components/Icon/icon.js +0 -24
- package/build/components/Icon/icon.types.d.ts +0 -6
- package/build/components/Icon/icon.types.js +0 -2
- package/build/components/Icon/index.d.ts +0 -2
- package/build/components/Icon/index.js +0 -2
- package/build/components/Input/index.d.ts +0 -4
- package/build/components/Input/index.js +0 -3
- package/build/components/Input/input.d.ts +0 -5
- package/build/components/Input/input.js +0 -32
- package/build/components/Input/input.types.js +0 -1
- package/build/components/Menu/index.js +0 -9
- package/build/components/Menu/menu.js +0 -48
- package/build/components/Menu/menuItem.js +0 -20
- package/build/components/Menu/subMenu.js +0 -56
- package/build/components/Progress/index.d.ts +0 -2
- package/build/components/Progress/index.js +0 -2
- package/build/components/Progress/progress.d.ts +0 -4
- package/build/components/Progress/progress.js +0 -6
- package/build/components/Progress/progress.types.js +0 -2
- package/build/components/Transition/index.d.ts +0 -3
- package/build/components/Transition/index.js +0 -2
- package/build/components/Transition/transition.d.ts +0 -4
- package/build/components/Transition/transition.js +0 -18
- package/build/components/Transition/transition.types.d.ts +0 -10
- package/build/components/Transition/transition.types.js +0 -1
- package/build/components/Upload/dragger.js +0 -42
- package/build/components/Upload/index.d.ts +0 -2
- package/build/components/Upload/index.js +0 -2
- package/build/components/Upload/native/axios-react.js +0 -99
- package/build/components/Upload/native/from-html.js +0 -5
- package/build/components/Upload/upload.js +0 -192
- package/build/components/Upload/upload.types.js +0 -3
- package/build/components/Upload/uploadList.js +0 -13
- package/build/hooks/useClickOutside.d.ts +0 -3
- package/build/hooks/useClickOutside.js +0 -18
- package/build/hooks/useDebounce.d.ts +0 -2
- package/build/hooks/useDebounce.js +0 -14
- package/build/index.css.map +0 -1
- package/build/index.d.ts +0 -9
- package/build/index.js +0 -12
- package/build/main.d.ts +0 -1
- package/build/main.js +0 -7
- package/build/setupTests.d.ts +0 -1
- package/build/setupTests.js +0 -1
- /package/{build → dist}/components/Upload/native/axios-react.d.ts +0 -0
- /package/{build → dist}/components/Upload/native/from-html.d.ts +0 -0
package/dist/App.d.ts
ADDED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AutoCompleteProps } from
|
|
2
|
-
export type { AutoCompleteProps, DataSourceType } from
|
|
1
|
+
import type { AutoCompleteProps } from "./autoComplete.types";
|
|
2
|
+
export type { AutoCompleteProps, DataSourceType } from "./autoComplete.types";
|
|
3
3
|
/**
|
|
4
4
|
* 输入框自动完成功能。当输入值需要自动完成时使用,支持同步和异步两种方式
|
|
5
5
|
* 支持 Input 组件的所有属性 支持键盘事件选择
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ReactElement } from
|
|
2
|
-
import type { InputProps } from
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { InputProps } from "../Input/input.types";
|
|
3
3
|
interface DataSourceObject {
|
|
4
4
|
value: string;
|
|
5
5
|
}
|
|
6
|
-
export type DataSourceType<T =
|
|
7
|
-
export interface AutoCompleteProps extends Omit<InputProps,
|
|
6
|
+
export type DataSourceType<T = Record<string, unknown>> = T & DataSourceObject;
|
|
7
|
+
export interface AutoCompleteProps extends Omit<InputProps, "onSelect" | "onChange"> {
|
|
8
8
|
/**
|
|
9
9
|
* 返回输入建议的方法,可以拿到当前的输入,然后返回同步的数组或者是异步的 Promise
|
|
10
10
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FC, ReactElement } from
|
|
2
|
-
import type { DataSourceType } from
|
|
1
|
+
import type { FC, ReactElement } from "react";
|
|
2
|
+
import type { DataSourceType } from "./autoComplete.types";
|
|
3
3
|
export interface AutoCompleteDropdownProps {
|
|
4
4
|
loading: boolean;
|
|
5
5
|
showDropdown: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FC } from
|
|
2
|
-
import { ButtonSize, ButtonType, type AnchorButtonProps, type ButtonProps, type NativeButtonProps } from
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import { ButtonSize, ButtonType, type AnchorButtonProps, type ButtonProps, type NativeButtonProps } from "./button.types";
|
|
3
3
|
declare const Button: FC<ButtonProps>;
|
|
4
4
|
export default Button;
|
|
5
5
|
export { ButtonSize, ButtonType };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FontAwesomeIconProps } from "@fortawesome/react-fontawesome";
|
|
2
|
+
export type ThemeProps = "primary" | "secondary" | "success" | "info" | "warning" | "danger" | "light" | "dark";
|
|
3
|
+
export interface IconProps extends FontAwesomeIconProps {
|
|
4
|
+
/** 支持框架主题,根据主题显示不同的颜色 */
|
|
5
|
+
theme?: ThemeProps;
|
|
6
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ChangeEvent, InputHTMLAttributes, ReactElement } from
|
|
2
|
-
import type { IconProp } from
|
|
3
|
-
export type InputSize =
|
|
4
|
-
export interface InputProps extends Omit<InputHTMLAttributes<HTMLElement>,
|
|
1
|
+
import type { ChangeEvent, InputHTMLAttributes, ReactElement } from "react";
|
|
2
|
+
import type { IconProp } from "@fortawesome/fontawesome-svg-core";
|
|
3
|
+
export type InputSize = "lg" | "sm";
|
|
4
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLElement>, "size"> {
|
|
5
5
|
/** 是否禁用 Input */
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
/** 设置 input 大小,支持 lg 或者是 sm */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { FC } from
|
|
2
|
-
import { type MenuProps } from
|
|
3
|
-
import { type SubMenuProps } from
|
|
4
|
-
import { type MenuItemProps } from
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import { type MenuProps } from "./menu";
|
|
3
|
+
import { type SubMenuProps } from "./subMenu";
|
|
4
|
+
import { type MenuItemProps } from "./menuItem";
|
|
5
5
|
export type IMenuComponent = FC<MenuProps> & {
|
|
6
6
|
Item: FC<MenuItemProps>;
|
|
7
7
|
SubMenu: FC<SubMenuProps>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
type MenuMode = 'horizontal' | 'vertical';
|
|
1
|
+
import type { FC, CSSProperties, ReactNode } from "react";
|
|
2
|
+
type MenuMode = "horizontal" | "vertical";
|
|
4
3
|
export interface MenuProps {
|
|
5
4
|
/**默认 active 的菜单项的索引值 */
|
|
6
5
|
defaultIndex?: string;
|
|
@@ -14,13 +13,6 @@ export interface MenuProps {
|
|
|
14
13
|
defaultOpenSubMenus?: string[];
|
|
15
14
|
children?: ReactNode;
|
|
16
15
|
}
|
|
17
|
-
interface IMenuContext {
|
|
18
|
-
index: string;
|
|
19
|
-
onSelect?: (selectedIndex: string) => void;
|
|
20
|
-
mode?: MenuMode;
|
|
21
|
-
defaultOpenSubMenus?: string[];
|
|
22
|
-
}
|
|
23
|
-
export declare const MenuContext: React.Context<IMenuContext>;
|
|
24
16
|
/**
|
|
25
17
|
* 为网站提供导航功能的菜单。支持横向纵向两种模式,支持下拉菜单。
|
|
26
18
|
*
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type MenuMode = "horizontal" | "vertical";
|
|
2
|
+
export interface IMenuContext {
|
|
3
|
+
index: string;
|
|
4
|
+
onSelect?: (selectedIndex: string) => void;
|
|
5
|
+
mode?: MenuMode;
|
|
6
|
+
defaultOpenSubMenus?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare const MenuContext: import("react").Context<IMenuContext>;
|
|
9
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CSSProperties } from
|
|
2
|
-
import type { ThemeProps } from
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { ThemeProps } from "../Icon/icon.types";
|
|
3
3
|
export interface ProgressProps {
|
|
4
4
|
percent: number;
|
|
5
5
|
strokeHeight?: number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { CSSTransitionProps } from "react-transition-group/CSSTransition";
|
|
3
|
+
export type AnimationName = "zoom-in-top" | "zoom-in-left" | "zoom-in-bottom" | "zoom-in-right";
|
|
4
|
+
export type TransitionProps = Omit<CSSTransitionProps<HTMLElement>, "timeout"> & {
|
|
5
|
+
animation?: AnimationName;
|
|
6
|
+
wrapper?: boolean;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
timeout: NonNullable<CSSTransitionProps<HTMLElement>["timeout"]>;
|
|
9
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type UploadFileStatus =
|
|
1
|
+
export type UploadFileStatus = "ready" | "uploading" | "success" | "error";
|
|
2
2
|
export interface UploadFile {
|
|
3
3
|
uid: string;
|
|
4
4
|
size: number;
|
|
@@ -6,8 +6,8 @@ export interface UploadFile {
|
|
|
6
6
|
status?: UploadFileStatus;
|
|
7
7
|
percent: number;
|
|
8
8
|
raw?: File;
|
|
9
|
-
response?:
|
|
10
|
-
error?:
|
|
9
|
+
response?: unknown;
|
|
10
|
+
error?: unknown;
|
|
11
11
|
}
|
|
12
12
|
export interface UploadProps {
|
|
13
13
|
/** 必选参数, 上传的地址 */
|
|
@@ -19,23 +19,19 @@ export interface UploadProps {
|
|
|
19
19
|
/** 文件上传时的钩子 */
|
|
20
20
|
onProgress?: (percentage: number, file: UploadFile) => void;
|
|
21
21
|
/** 文件上传成功时的钩子 */
|
|
22
|
-
onSuccess?: (data:
|
|
22
|
+
onSuccess?: (data: unknown, file: UploadFile) => void;
|
|
23
23
|
/** 文件上传失败时的钩子 */
|
|
24
|
-
onError?: (err:
|
|
24
|
+
onError?: (err: unknown, file: UploadFile) => void;
|
|
25
25
|
/** 文件状态改变时的钩子,上传成功或者失败时都会被调用 */
|
|
26
26
|
onChange?: (file: UploadFile) => void;
|
|
27
27
|
/** 文件列表移除文件时的钩子 */
|
|
28
28
|
onRemove?: (file: UploadFile) => void;
|
|
29
29
|
/** 设置上传的请求头部 */
|
|
30
|
-
headers?:
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
};
|
|
30
|
+
headers?: Record<string, string>;
|
|
33
31
|
/** 上传的文件字段名 */
|
|
34
32
|
name?: string;
|
|
35
33
|
/** 上传时附带的额外参数 */
|
|
36
|
-
data?:
|
|
37
|
-
[key: string]: any;
|
|
38
|
-
};
|
|
34
|
+
data?: Record<string, string>;
|
|
39
35
|
/** 是否发送 cookie 凭证信息 */
|
|
40
36
|
withCredentials?: boolean;
|
|
41
37
|
/** 可选参数, 接受上传的文件类型 */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FC } from
|
|
2
|
-
import type { UploadFile } from
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import type { UploadFile } from "./upload.types";
|
|
3
3
|
interface UploadListProps {
|
|
4
4
|
fileList: UploadFile[];
|
|
5
5
|
onRemove: (_file: UploadFile) => void;
|