Skip to content

Commit

Permalink
feat: add cjs bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyuuu committed Mar 10, 2023
1 parent 9b6ceff commit 73155eb
Show file tree
Hide file tree
Showing 41 changed files with 668 additions and 664 deletions.
12 changes: 8 additions & 4 deletions dist/components/Button/button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,32 @@ interface BaseButtonProps {
/**点击跳转的地址,指定此属性 button 的行为和 a 链接一致 */
href?: string
}
type NativeButtonProps = BaseButtonProps &
React.ButtonHTMLAttributes<HTMLElement>
type AnchorButtonProps = BaseButtonProps &
React.ButtonHTMLAttributes<HTMLElement>
export type ButtonProps = Partial<AnchorButtonProps>
export type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>
/**
* >按钮用于开始一个即时操作。
*
* ### 何时使用
* 标记了一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。
* 在violetUI我们提供了7种按钮
* 在violet-design我们提供了6种按钮
*
* - 默认按钮:用于没有主次之分的一组行动点。
* - 主按钮:用于主行动点,一个操作区域只能有一个主按钮。
* - 危险按钮:删除/移动/修改权限等危险操作,一般需要二次确认。
* - 链接按钮:一般用于链接,即导航至某位置。
* - 图标按钮:可以通过Icon组件,为按钮提供各式各样的图标选择。
* - 虚线按钮:常用于添加操作。
* - 禁用按钮:行动点不可用的时候,一般需要文案解释。
*
*
* 除了默认按钮尺寸,还提供了两种尺寸配合使用
* 除了默认Mid Button尺寸,还提供了两种尺寸可供自由组合
* - Large Button
* - Samll Button
*
* 所有按钮都提供了disabled属性,用于行动点不可用的时候,一般需要文案解释。
*
*/
export declare const Button: {
(props: ButtonProps): JSX.Element
Expand Down
6 changes: 6 additions & 0 deletions dist/components/DatePicker/DatePicker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export type Props = DatePickerProps &
PickerProps
/**
* 输入或选择日期/时间的控件。
* - 支持日期、时间、日期时间选择
* - 支持用户手动输入日期&时间,并完成数值校验
* - 支持设定不可选日期
* - 支持设定日期展示格式
* - 支持国际化
* - 支持定制日期单元格样式及日期单元格内容
*/
export declare class DatePicker extends React.Component<Props, State> {
static defaultProps: {
Expand Down
3 changes: 0 additions & 3 deletions dist/components/Form/form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ export type IFormRef = Omit<
'fields' | 'dispatch' | 'form'
>
export declare const FormContext: React.Context<IFormContext>
/**
* >高性能表单控件,自带数据域管理。包含数据录入、校验以及对应样式。
// /* eslint-disable react/display-name */
/**
* > 表单控件, 带数据与管理功能, 包含数据录入、校验等
*
Expand Down
26 changes: 9 additions & 17 deletions dist/components/Icon/icon.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
import { FC } from 'react'
import { FontAwesomeIconProps } from '@fortawesome/react-fontawesome'
export type ThemeProps =
| 'primary'
| 'secondary'
| 'success'
| 'info'
| 'warning'
| 'danger'
| 'light'
| 'dark'
import { FC } from 'react';
import { FontAwesomeIconProps } from '@fortawesome/react-fontawesome';
export type ThemeProps = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'light' | 'dark';
export interface IconProps extends FontAwesomeIconProps {
/** 支持框架主题 根据主题显示不同的颜色 */
theme?: ThemeProps
/** 支持框架主题 根据主题显示不同的颜色 */
theme?: ThemeProps;
}
/**
* 提供了一套常用的图标集合 基于 react-fontawesome。
*
* 支持 react-fontawesome的所有属性 可以在这里查询 https://github.com/FortAwesome/react-fontawesome#basic
* ###何时使用
*需要使用图标表达或装饰时
*
* 支持 fontawesome 所有 free-solid-icons,可以在这里查看所有图标 https://fontawesome.com/icons?d=gallery&s=solid&m=free
*/
export declare const Icon: FC<IconProps>
export default Icon
export declare const Icon: FC<IconProps>;
export default Icon;
4 changes: 2 additions & 2 deletions dist/components/Icon/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import Icon from './icon'
export default Icon
import Icon from './icon';
export default Icon;
4 changes: 2 additions & 2 deletions dist/components/Input/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import Input from './input'
export default Input
import Input from './input';
export default Input;
37 changes: 17 additions & 20 deletions dist/components/Input/input.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import React, { ReactElement, InputHTMLAttributes, ChangeEvent } from 'react'
import { IconProp } from '@fortawesome/fontawesome-svg-core'
export type InputSize = 'lg' | 'sm' | 'md'
export interface InputProps
extends Omit<InputHTMLAttributes<HTMLElement>, 'size'> {
/**是否禁用 Input */
disabled?: boolean
/**设置 input 大小,支持 lg、sm、md */
size?: InputSize
/**添加图标,在右侧悬浮添加一个图标,用于提示 */
icon?: IconProp
/**添加前缀 用于配置一些固定组合 */
prepend?: string | ReactElement
/**添加后缀 用于配置一些固定组合 */
append?: string | ReactElement
onChange?: (e: ChangeEvent<HTMLInputElement>) => void
import React, { ReactElement, InputHTMLAttributes, ChangeEvent } from 'react';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
export type InputSize = 'lg' | 'sm' | 'md';
export interface InputProps extends Omit<InputHTMLAttributes<HTMLElement>, 'size'> {
/**是否禁用 Input */
disabled?: boolean;
/**设置 input 大小,支持 lg、sm、md */
size?: InputSize;
/**添加图标,在右侧悬浮添加一个图标,用于提示 */
icon?: IconProp;
/**添加前缀 用于配置一些固定组合 */
prepend?: string | ReactElement;
/**添加后缀 用于配置一些固定组合 */
append?: string | ReactElement;
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
}
/**
* Input 输入框 通过鼠标或键盘输入内容,是最基础的表单域的包装。
Expand All @@ -23,7 +22,5 @@ export interface InputProps
*
* 支持 HTMLInput 的所有基本属性
*/
export declare const Input: React.ForwardRefExoticComponent<
InputProps & React.RefAttributes<HTMLInputElement>
>
export default Input
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
export default Input;
4 changes: 2 additions & 2 deletions dist/components/InputNumber/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import InputNumber from './inputNumber'
export default InputNumber
import InputNumber from './inputNumber';
export default InputNumber;
58 changes: 29 additions & 29 deletions dist/components/InputNumber/inputNumber.d.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import React from 'react'
type Status = 'default' | 'error' | 'warning' | 'success'
import React from 'react';
type Status = 'default' | 'error' | 'warning' | 'success';
export interface IInputNumberProps {
placeholder?: string
/** 自动获取焦点 */
autoFocus?: boolean
/** 是否显示增减按钮 */
controls?: boolean
/** 禁用 */
disabled?: boolean
/** 是否启用键盘快捷行为 */
keyboard?: boolean
/** 最大值 */
max?: number
/** 最小值 */
min?: number
/** 设置校验状态 */
status?: Status
/** 输入框大小 */
size?: 'default' | 'small' | 'large'
/** 每次改变步数 */
step?: number
/** 当前值 */
value?: string
/** 变化回调 */
onChange?: (value: string) => void
/** 按下回车的回调 */
onPressEnter?: () => void
placeholder?: string;
/** 自动获取焦点 */
autoFocus?: boolean;
/** 是否显示增减按钮 */
controls?: boolean;
/** 禁用 */
disabled?: boolean;
/** 是否启用键盘快捷行为 */
keyboard?: boolean;
/** 最大值 */
max?: number;
/** 最小值 */
min?: number;
/** 设置校验状态 */
status?: Status;
/** 输入框大小 */
size?: 'default' | 'small' | 'large';
/** 每次改变步数 */
step?: number;
/** 当前值 */
value?: string;
/** 变化回调 */
onChange?: (value: string) => void;
/** 按下回车的回调 */
onPressEnter?: () => void;
}
/**
* > 通过鼠标或键盘,输入范围内的数值。
*
* ### 何时使用
* 当需要获取标准数值时。
*/
export declare const InputNumber: React.FC<IInputNumberProps>
export default InputNumber
export declare const InputNumber: React.FC<IInputNumberProps>;
export default InputNumber;
18 changes: 9 additions & 9 deletions dist/components/Menu/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FC } from 'react'
import { IMenuProps } from './menu'
import { ISubMenuProps } from './subMenu/subMenu'
import { IMenuItemProps } from './menuItem'
import { FC } from 'react';
import { IMenuProps } from './menu';
import { ISubMenuProps } from './subMenu/subMenu';
import { IMenuItemProps } from './menuItem';
export type IMenuComponent = FC<IMenuProps> & {
Item: FC<IMenuItemProps>
SubMenu: FC<ISubMenuProps>
}
declare const TransMenu: IMenuComponent
export default TransMenu
Item: FC<IMenuItemProps>;
SubMenu: FC<ISubMenuProps>;
};
declare const TransMenu: IMenuComponent;
export default TransMenu;
40 changes: 20 additions & 20 deletions dist/components/Menu/menu.d.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import React, { ReactNode } from 'react'
type selectCallback = (selectIndex: string) => void
type Mode = 'vertical' | 'horizontal'
import React, { ReactNode } from 'react';
type selectCallback = (selectIndex: string) => void;
type Mode = 'vertical' | 'horizontal';
export interface IMenuProps {
/** 添加自定义类名 */
className?: string
/** 设置点击触发的回调函数 */
onSelect?: selectCallback
/** 自定义样式 */
style?: React.CSSProperties
/** 设置默认高亮选项 */
defaultIndex?: string
/** 横向 or 纵向 */
mode?: Mode
children?: ReactNode
/** 添加自定义类名 */
className?: string;
/** 设置点击触发的回调函数 */
onSelect?: selectCallback;
/** 自定义样式 */
style?: React.CSSProperties;
/** 设置默认高亮选项 */
defaultIndex?: string;
/** 横向 or 纵向 */
mode?: Mode;
children?: ReactNode;
}
export interface IMenuContext {
index: string
onSelect?: selectCallback
mode: Mode
index: string;
onSelect?: selectCallback;
mode: Mode;
}
export declare const MenuContext: React.Context<IMenuContext>
export declare const MenuContext: React.Context<IMenuContext>;
/**
* > 为页面和功能提供导航的菜单列表。
*
Expand All @@ -31,5 +31,5 @@ export declare const MenuContext: React.Context<IMenuContext>
* ### 开发者注意事项
* Menu组件的使用,需搭配 `Menu.Item`/`Menu.SubMenu` 作为子组件来进行开发
*/
export declare const Menu: React.FC<IMenuProps>
export default Menu
export declare const Menu: React.FC<IMenuProps>;
export default Menu;
16 changes: 8 additions & 8 deletions dist/components/Menu/menuItem.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { ReactNode } from 'react'
import React, { ReactNode } from 'react';
export interface IMenuItemProps {
style?: React.CSSProperties
className?: string
disabled?: boolean
index?: string
children?: ReactNode
style?: React.CSSProperties;
className?: string;
disabled?: boolean;
index?: string;
children?: ReactNode;
}
export declare const MenuItem: React.FC<IMenuItemProps>
export default MenuItem
export declare const MenuItem: React.FC<IMenuItemProps>;
export default MenuItem;
14 changes: 7 additions & 7 deletions dist/components/Menu/subMenu/subMenu.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { ReactNode } from 'react'
import React, { ReactNode } from 'react';
export interface ISubMenuProps {
index?: string
title: string
className?: string
children?: ReactNode
index?: string;
title: string;
className?: string;
children?: ReactNode;
}
export declare const SubMenu: React.FC<ISubMenuProps & React.PropsWithChildren>
export default SubMenu
export declare const SubMenu: React.FC<ISubMenuProps & React.PropsWithChildren>;
export default SubMenu;
4 changes: 2 additions & 2 deletions dist/components/Progress/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import Progress from './progress'
export default Progress
import Progress from './progress';
export default Progress;
54 changes: 27 additions & 27 deletions dist/components/Progress/progress.d.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import React, { ReactNode } from 'react'
export type ProgressType = 'line' | 'circle'
export type ProgressStatus = 'success' | 'exception' | 'normal' | 'active'
export type ProgressSize = 'lg' | 'md' | 'sm'
import React, { ReactNode } from 'react';
export type ProgressType = 'line' | 'circle';
export type ProgressStatus = 'success' | 'exception' | 'normal' | 'active';
export type ProgressSize = 'lg' | 'md' | 'sm';
export interface ProgressProps {
/**百分比*/
percent?: number
/**是否呈现进度和状态标志*/
showInfo?: boolean
/**进度条状态*/
status?: ProgressStatus
/**进度条颜色*/
strokeColor?: string
/**stroke-linecap的样式*/
strokeLinecap?: string
/**是否已经完成(达到100%)*/
success?: boolean
/**圆环特有属性:内部圆环颜色*/
innerColor?: string
/**进度条样式*/
type?: ProgressType
/**大小*/
size?: ProgressSize
/**类名*/
className?: string
children?: ReactNode
/**百分比*/
percent?: number;
/**是否呈现进度和状态标志*/
showInfo?: boolean;
/**进度条状态*/
status?: ProgressStatus;
/**进度条颜色*/
strokeColor?: string;
/**stroke-linecap的样式*/
strokeLinecap?: string;
/**是否已经完成(达到100%)*/
success?: boolean;
/**圆环特有属性:内部圆环颜色*/
innerColor?: string;
/**进度条样式*/
type?: ProgressType;
/**大小*/
size?: ProgressSize;
/**类名*/
className?: string;
children?: ReactNode;
}
/**
* > 展示工作流的进度
Expand All @@ -33,5 +33,5 @@ export interface ProgressProps {
*
*
*/
export declare const Progress: React.FC<ProgressProps>
export default Progress
export declare const Progress: React.FC<ProgressProps>;
export default Progress;
Loading

0 comments on commit 73155eb

Please sign in to comment.