@qsxy/element-plus-react 1.0.0-next.2 → 1.0.0-next.3

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 (131) hide show
  1. package/README.md +31 -0
  2. package/dist/Badge/typings.d.ts +10 -0
  3. package/dist/Breadcrumb/typings.d.ts +4 -0
  4. package/dist/Button/typings.d.ts +28 -0
  5. package/dist/Calendar/CalendarContext.d.ts +10 -0
  6. package/dist/Calendar/ShortCuts.d.ts +2 -0
  7. package/dist/Calendar/typings.d.ts +18 -0
  8. package/dist/Card/typings.d.ts +4 -0
  9. package/dist/Cascader/CascaderDropdown.d.ts +1 -0
  10. package/dist/Cascader/CascaderMenu.d.ts +7 -0
  11. package/dist/Cascader/typings.d.ts +80 -0
  12. package/dist/Cascader/useCascader.d.ts +72 -0
  13. package/dist/Checkbox/typings.d.ts +11 -0
  14. package/dist/CheckboxGroup/CheckboxGroup.d.ts +4 -0
  15. package/dist/CheckboxGroup/CheckboxGroupContext.d.ts +1 -0
  16. package/dist/Col/typings.d.ts +10 -0
  17. package/dist/Collapse/CollapseContext.d.ts +3 -0
  18. package/dist/Collapse/typings.d.ts +7 -0
  19. package/dist/ColorPicker/AlphaSlider.d.ts +7 -0
  20. package/dist/ColorPicker/HueSlider.d.ts +7 -0
  21. package/dist/ColorPicker/Predefine.d.ts +7 -0
  22. package/dist/ColorPicker/SvPanel.d.ts +7 -0
  23. package/dist/ColorPicker/typings.d.ts +9 -0
  24. package/dist/ConfigProvider/ConfigProvider.d.ts +5 -0
  25. package/dist/DatePicker/typings.d.ts +69 -0
  26. package/dist/DateTimePicker/typings.d.ts +1 -0
  27. package/dist/Descriptions/DescriptionsContext.d.ts +2 -0
  28. package/dist/Descriptions/typings.d.ts +13 -0
  29. package/dist/Dialog/DialogContext.d.ts +8 -0
  30. package/dist/Dialog/typings.d.ts +36 -0
  31. package/dist/Divider/Divider.d.ts +4 -0
  32. package/dist/Drawer/DrawerContext.d.ts +10 -0
  33. package/dist/Drawer/typings.d.ts +16 -0
  34. package/dist/Dropdown/DropdownContext.d.ts +2 -0
  35. package/dist/Dropdown/typings.d.ts +15 -0
  36. package/dist/Form/FormItem.d.ts +12 -0
  37. package/dist/Form/typings.d.ts +55 -0
  38. package/dist/Form/useForm.d.ts +22 -0
  39. package/dist/Form/utils/NameMap.d.ts +3 -0
  40. package/dist/Form/utils/validateUtil.d.ts +4 -0
  41. package/dist/Form/utils/valueUtil.d.ts +17 -0
  42. package/dist/Icon/typings.d.ts +7 -0
  43. package/dist/Input/typings.d.ts +61 -0
  44. package/dist/InputNumber/typings.d.ts +21 -0
  45. package/dist/Link/typings.d.ts +6 -1
  46. package/dist/Loading/typings.d.ts +5 -0
  47. package/dist/Message/Main.d.ts +7 -0
  48. package/dist/Message/index.d.ts +8 -0
  49. package/dist/Message/typings.d.ts +11 -0
  50. package/dist/MessageBox/index.d.ts +14 -0
  51. package/dist/MessageBox/typings.d.ts +50 -0
  52. package/dist/Notification/Main.d.ts +7 -0
  53. package/dist/Notification/index.d.ts +15 -0
  54. package/dist/Notification/typings.d.ts +13 -0
  55. package/dist/Pagination/typings.d.ts +28 -0
  56. package/dist/Popconfirm/typings.d.ts +10 -0
  57. package/dist/Popover/typings.d.ts +12 -0
  58. package/dist/Popper/typings.d.ts +7 -1
  59. package/dist/Progress/typings.d.ts +12 -0
  60. package/dist/Radio/typings.d.ts +7 -0
  61. package/dist/RadioGroup/typings.d.ts +1 -0
  62. package/dist/Row/RowContext.d.ts +1 -0
  63. package/dist/Row/typings.d.ts +4 -0
  64. package/dist/Scrollbar/typings.d.ts +20 -0
  65. package/dist/Select/typings.d.ts +33 -0
  66. package/dist/Skeleton/PlaceholderGraph.d.ts +4 -0
  67. package/dist/Skeleton/PlaceholderGrid.d.ts +4 -0
  68. package/dist/Skeleton/PlaceholderParagraph.d.ts +4 -0
  69. package/dist/Switch/typings.d.ts +15 -0
  70. package/dist/Table/Colgroup.d.ts +1 -0
  71. package/dist/Table/TableContext.d.ts +8 -0
  72. package/dist/Table/hooks/useSelection.d.ts +17 -0
  73. package/dist/Table/hooks/useTable.d.ts +7 -0
  74. package/dist/Table/treeUtil.d.ts +39 -0
  75. package/dist/Table/typings.d.ts +137 -1
  76. package/dist/Table/util.d.ts +10 -0
  77. package/dist/Tabs/typings.d.ts +38 -0
  78. package/dist/Tag/Tag.d.ts +1 -1
  79. package/dist/Tag/Tag.js +18 -26
  80. package/dist/Tag/typings.d.ts +10 -0
  81. package/dist/TimeLine/typings.d.ts +9 -0
  82. package/dist/TimePicker/typings.d.ts +13 -0
  83. package/dist/TimePicker/useTimePicker.d.ts +7 -0
  84. package/dist/Tooltip/Tooltip.js +8 -19
  85. package/dist/Tooltip/TooltipContext.d.ts +1 -0
  86. package/dist/Tooltip/typings.d.ts +14 -1
  87. package/dist/Transfer/ListItem.d.ts +1 -0
  88. package/dist/Transfer/typings/index.d.ts +27 -0
  89. package/dist/Transfer/typings/list.d.ts +25 -0
  90. package/dist/Transfer/typings/listBody.d.ts +1 -0
  91. package/dist/Transition/Transition.d.ts +10 -0
  92. package/dist/Transition/TransitionGroup.d.ts +59 -0
  93. package/dist/Transition/childMapping.d.ts +23 -0
  94. package/dist/Tree/NodeList.d.ts +3 -0
  95. package/dist/Tree/RCTree.d.ts +15 -0
  96. package/dist/Tree/Tree.d.ts +15 -0
  97. package/dist/Tree/TreeNode.d.ts +7 -0
  98. package/dist/Tree/contextTypes.d.ts +4 -0
  99. package/dist/Tree/typings.d.ts +3 -0
  100. package/dist/Tree/util.d.ts +17 -0
  101. package/dist/Tree/utils/KeyCode.d.ts +326 -0
  102. package/dist/Tree/utils/conductUtil.d.ts +6 -0
  103. package/dist/Tree/utils/dictUtil.d.ts +1 -0
  104. package/dist/Tree/utils/pickAttrs.d.ts +5 -0
  105. package/dist/Tree/utils/treeUtil.d.ts +25 -1
  106. package/dist/TreeSelect/Utils.d.ts +1 -0
  107. package/dist/TreeSelect/typings.d.ts +19 -0
  108. package/dist/Upload/typings.d.ts +34 -0
  109. package/dist/Upload/use-handlers.d.ts +1 -0
  110. package/dist/Util/Math.d.ts +34 -0
  111. package/dist/Util/base.d.ts +21 -0
  112. package/dist/Util/shallowEqual.d.ts +11 -0
  113. package/dist/Util/treeUtils.d.ts +8 -0
  114. package/dist/VirtualList/Filler.d.ts +5 -0
  115. package/dist/VirtualList/VirtualList.d.ts +3 -0
  116. package/dist/VirtualList/hooks/useLayoutEffect.d.ts +3 -0
  117. package/dist/VirtualList/utils/algorithmUtil.d.ts +17 -0
  118. package/dist/VirtualList/utils/findDOMNode.d.ts +3 -0
  119. package/dist/hooks/animationPropsUtils.d.ts +12 -0
  120. package/dist/hooks/htmlPropsUtils.d.ts +8 -0
  121. package/dist/hooks/popperPropsUtils.d.ts +12 -0
  122. package/dist/hooks/treePropsUtils.d.ts +12 -0
  123. package/dist/hooks/useChildrenInstance.d.ts +11 -0
  124. package/dist/hooks/useClassNames.d.ts +78 -0
  125. package/dist/hooks/useControlled.d.ts +8 -0
  126. package/dist/hooks/useForceUpdate.d.ts +1 -0
  127. package/dist/index.d.ts +1 -0
  128. package/dist/theme-chalk/link/index.scss +0 -85
  129. package/dist/types/common.d.ts +24 -0
  130. package/dist/types/type.d.ts +5 -0
  131. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # @qsxy/element-plus-react
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/element-plus-react.svg?style=flat)](https://npmjs.org/package/@qsxy/element-plus-react)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/element-plus-react.svg?style=flat)](https://npmjs.org/package/@qsxy/element-plus-react)
5
+
6
+ @qsxy/element-plus-react
7
+
8
+ ## Usage
9
+
10
+ TODO
11
+
12
+ ## Options
13
+
14
+ TODO
15
+
16
+ ## Development
17
+
18
+ ```bash
19
+ # install dependencies
20
+ $ npm i @qsxy/element-plus-react
21
+ ```
22
+
23
+ ```javascript
24
+ // how to use
25
+ import '@qsxy/element-plus-react/dist/index.css';
26
+ import { ElButton, ElLink } from '@qsxy/element-plus-react';
27
+ ```
28
+
29
+ ## LICENSE
30
+
31
+ MIT
@@ -1,14 +1,24 @@
1
1
  import React from 'react';
2
2
  import { AnimationEventProps, BaseProps, NativeProps, TypeAttributes } from '../types/common';
3
3
  export interface BadgeProps extends BaseProps, NativeProps, AnimationEventProps {
4
+ /** 显示值 */
4
5
  value?: string | number;
6
+ /** 最大值,超过最大值会显示 {max}+。 只有当 value 是数字类型时起作用。 */
5
7
  max?: number;
8
+ /** 是否显示小圆点。 */
6
9
  isDot?: boolean;
10
+ /** 是否隐藏 Badge。 */
7
11
  hidden?: Boolean;
12
+ /** 类型 */
8
13
  type?: TypeAttributes.Appearance;
14
+ /** 值为零时是否显示 Badge */
9
15
  showZero?: boolean;
16
+ /** 背景色 */
10
17
  color?: string;
18
+ /** badge 的偏移量 */
11
19
  offset?: [number, number];
20
+ /** 自定义 badge 样式 */
12
21
  badgeStyle?: React.CSSProperties;
22
+ /** 自定义 badge 类名 */
13
23
  badgeClass?: string;
14
24
  }
@@ -2,12 +2,16 @@ import React from 'react';
2
2
  import { RouteProps } from 'react-router-dom';
3
3
  import { BaseProps, NativeProps } from '../types/common';
4
4
  export interface BreadcrumbProps extends BaseProps, NativeProps {
5
+ /** 分隔符 */
5
6
  separator?: string | React.ReactElement<any>;
6
7
  }
7
8
  export interface BreadcrumbContextProps {
9
+ /** 分隔符 */
8
10
  separator: string | React.ReactElement<any>;
9
11
  }
10
12
  export interface BreadcrumbItemProps extends BaseProps, NativeProps {
13
+ /** 路由跳转目标,同 vue-router 的 to 属性 */
11
14
  to?: string | RouteProps;
15
+ /** 如果设置该属性为 true, 导航将不会留下历史记录 */
12
16
  onClick?: (to?: string | RouteProps) => void;
13
17
  }
@@ -2,36 +2,64 @@ import React from 'react';
2
2
  import { IconName } from '../Icon';
3
3
  import { BaseProps, NativeProps, TypeAttributes } from '../types/common';
4
4
  export interface ButtonProps extends Omit<React.AllHTMLAttributes<HTMLElement>, 'loading' | 'size' | 'icon' | 'style' | 'children'>, BaseProps, NativeProps {
5
+ /** 尺寸 */
5
6
  size?: TypeAttributes.Size;
7
+ /** 类型 */
6
8
  type?: TypeAttributes.Appearance;
9
+ /** 是否为朴素按钮 */
7
10
  plain?: boolean;
11
+ /** 是否为圆角按钮 */
8
12
  round?: boolean;
13
+ /** 是否为圆形按钮 */
9
14
  circle?: boolean;
15
+ /** 是否为文字按钮 */
10
16
  text?: boolean;
17
+ /** 是否显示文字按钮背景颜色 */
11
18
  bg?: boolean;
19
+ /** 是否为链接按钮 */
12
20
  link?: boolean;
21
+ /** 是否为虚线按钮 */
13
22
  dashed?: boolean;
23
+ /** 是否为加载中状态 */
14
24
  loading?: boolean;
25
+ /** 自定义加载中图标 */
15
26
  loadingIcon?: IconName;
27
+ /** 自定义加载中图标 */
16
28
  loadingSlot?: React.ReactElement;
29
+ /** 是否为激活状态 */
17
30
  active?: boolean;
31
+ /** 是否为禁用状态 */
18
32
  disabled?: boolean;
33
+ /** 自定义图标 */
19
34
  icon?: IconName | boolean;
35
+ /** 自定义颜色 */
20
36
  color?: TypeAttributes.Color;
37
+ /** Format button to appear inside a content bloc */
21
38
  block?: boolean;
39
+ /** 自动在两个中文字符之间插入空格 */
22
40
  autoInsertSpace?: boolean;
41
+ /** Providing a `href` will render an `<a>` element, _styled_ as a button */
23
42
  href?: string;
43
+ /** Where to display the linked URL */
24
44
  target?: string;
45
+ /** Defines HTML button type attribute */
25
46
  nativeType?: 'button' | 'reset' | 'submit';
26
47
  }
27
48
  export type ButtonRef = {
49
+ /** 按钮 html 元素 */
28
50
  ref: React.MutableRefObject<HTMLButtonElement>;
51
+ /** 按钮尺寸 */
29
52
  size: TypeAttributes.Size;
53
+ /** 类型 */
30
54
  type?: TypeAttributes.Appearance;
55
+ /** 是否为禁用状态 */
31
56
  disabled?: boolean;
57
+ /** 是否在两个字符之间插入空格 */
32
58
  shouldAddSpace?: boolean;
33
59
  };
34
60
  export type ButtonGroupProps = BaseProps & NativeProps & Pick<ButtonProps, 'disabled' | 'size' | 'type'> & {
61
+ /** 背景色 */
35
62
  bgColor?: string;
63
+ /** 边框颜色 */
36
64
  borderColor?: string;
37
65
  };
@@ -10,16 +10,26 @@ export interface CalendarContextProps {
10
10
  initialValue?: string | [v1: string, v2: string];
11
11
  value?: Dayjs;
12
12
  valueRange?: [value: Dayjs, value: Dayjs];
13
+ /** 显示类型 */
13
14
  dateType?: DateType | DateRangeType;
15
+ /** 是否展示“今天”按钮 */
14
16
  showToday?: boolean;
17
+ /** 是否展示“此刻”按钮 */
15
18
  showNow?: boolean;
19
+ /** 设置ISO周数,其中1为星期一,7为星期日 */
16
20
  isoWeek?: boolean;
21
+ /** 在范围选择器里取消两个日期面板之间的联动 */
17
22
  unlinkPanels?: boolean;
18
23
  popperInstRef?: RefObject<PopperOptionRef>;
24
+ /** 快捷方式 */
19
25
  shortcuts?: Shortcuts[];
26
+ /** 一个用来判断该日期是否被禁用的函数,接受一个 Date 对象作为参数。 应该返回一个 Boolean 值。 */
20
27
  disabledDate?: (time: Date) => boolean;
28
+ /** 关闭下拉框方法 */
21
29
  close?: () => void;
30
+ /** 单选框提交数据方法 */
22
31
  onChange?: (value: Dayjs, params?: ChangeParams) => void;
32
+ /** 日期范围框提交数据方法 */
23
33
  onChangeRange?: (value: [value: Dayjs, value: Dayjs], finish: boolean) => void;
24
34
  formatter?: (value: Dayjs, text: number) => React.ReactElement;
25
35
  }
@@ -4,7 +4,9 @@ import { ClassValue } from '../hooks/useClassNames';
4
4
  import { ChangeParams } from './CalendarContext';
5
5
  import { Shortcuts } from './typings';
6
6
  interface Props {
7
+ /** 快捷方式 */
7
8
  shortcuts: Shortcuts[];
9
+ /** 单选框提交数据方法 */
8
10
  onChange?: (value: Dayjs, params?: ChangeParams) => void;
9
11
  e: (...classes: ClassValue[]) => string;
10
12
  }
@@ -5,32 +5,50 @@ export type DateRangeType = 'daterange' | 'monthrange' | 'yearrange';
5
5
  export type RangePosition = 'left' | 'right';
6
6
  export type ValueRagne = [value: Dayjs, value: Dayjs];
7
7
  export type ValueRagneTemp = [value: Dayjs, value: Dayjs, value: Dayjs];
8
+ /** 快捷方式 */
8
9
  export interface Shortcuts {
9
10
  text: string;
10
11
  value: Date | (() => Date);
11
12
  }
12
13
  export interface CalendarProps extends BaseProps, NativeProps {
14
+ /** 是否显示时间 */
13
15
  hasTime?: boolean;
14
16
  }
15
17
  export interface HeaderProps {
18
+ /** */
16
19
  prefix?: string;
20
+ /** 年 */
17
21
  year?: number | string;
22
+ /** 月 */
18
23
  month?: number | string;
24
+ /** 是否禁用 */
19
25
  disabled?: boolean;
26
+ /** */
27
+ /** */
28
+ /** 是否显示月份 */
20
29
  showMonth?: boolean;
30
+ /** 是否显示后退按钮 */
21
31
  showBackward?: boolean;
32
+ /** 是否显示前进按钮 */
22
33
  showForward?: boolean;
34
+ /** 是否纯文本模式 */
23
35
  plain?: boolean;
36
+ /** 是否显示边框 */
24
37
  border?: boolean;
25
38
  postion?: RangePosition;
26
39
  disabledForward?: boolean;
27
40
  disabledBackward?: boolean;
28
41
  disabledForwards?: boolean;
29
42
  disabledBackwards?: boolean;
43
+ /** */
30
44
  onToggleView?: (type: DateType, postion?: RangePosition) => void;
45
+ /** */
31
46
  onMoveBackward?: () => void;
47
+ /** */
32
48
  onMoveForward?: () => void;
49
+ /** */
33
50
  onMoveBackwards?: () => void;
51
+ /** */
34
52
  onMoveForwards?: () => void;
35
53
  }
36
54
  export type YearPanelProps = {
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
2
  import { BaseProps, NativeProps } from '../types/common';
3
3
  export interface CardProps extends BaseProps, NativeProps<'--el-card-border-color' | '--el-card-border-radius' | '--el-card-padding' | '--el-card-bg-color'> {
4
+ /** 卡片的标题 你可以通过设置 header 来修改标题 */
4
5
  header?: string | React.ReactElement<any>;
6
+ /** 卡片页脚。 你既可以通过设置 footer 来修改卡片底部内容 */
5
7
  footer?: string | React.ReactElement<any>;
8
+ /** body 的 CSS 样式 */
6
9
  bodyStyle?: React.CSSProperties;
10
+ /** 设置阴影显示时机 */
7
11
  shadow?: 'always' | 'never' | 'hover';
8
12
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { OptionNode } from './typings';
3
3
  interface Props {
4
+ /** 用于分隔选项的字符 */
4
5
  separator: string;
5
6
  options: OptionNode[][];
6
7
  value: string[] | string[][];
@@ -8,5 +8,12 @@ interface Props {
8
8
  export interface CascaderMenuRef {
9
9
  scrollToSelected: () => void;
10
10
  }
11
+ /**
12
+ * @author Parker
13
+ * @CreateTime 2022/4/17 14:14:01
14
+ * @LastEditor Parker
15
+ * @ModifyTime 2025/2/22 16:22:21
16
+ * @Description
17
+ */
11
18
  declare const CascaderMenu: React.MemoExoticComponent<React.ForwardRefExoticComponent<Props & React.RefAttributes<CascaderMenuRef>>>;
12
19
  export default CascaderMenu;
@@ -5,75 +5,155 @@ import { DataNode, DirectoryTreeProps, Key } from '../Tree';
5
5
  import { AnimationEventProps, BaseProps, FormControlBaseProps, NativeProps } from '../types/common';
6
6
  export type ValueType = string[] | string[][];
7
7
  export interface CascaderProps<V = ValueType, S = DataNode> extends Omit<FormControlBaseProps<V>, 'onChange' | 'value' | 'defaultValue'>, BaseProps, NativeProps, AnimationEventProps, PopperOptions, Omit<DirectoryTreeProps<S>, 'children' | 'style' | 'expandedKeys' | 'className' | 'readOnly' | 'disabled'> {
8
+ /** 初始值 */
8
9
  defaultValue?: ValueType;
10
+ /** 值(可控) */
9
11
  value?: ValueType;
12
+ /** 可选项数据源,键名可通过 Props 属性配置 */
10
13
  options?: any[];
14
+ /** 配置选项 */
11
15
  props?: CascaderMenuProps;
16
+ /** 树形租金配置选项 */
12
17
  treeMenuProps?: TreeMenuProps;
18
+ /** 是否禁用 */
13
19
  disabled?: boolean;
20
+ /** 是否可以清空选项 */
14
21
  clearable?: boolean;
22
+ /** 输入框中是否显示选中值的完整路径 */
15
23
  showAllLevels?: boolean;
24
+ /** 用于分隔选项的字符 */
16
25
  separator?: string;
26
+ /** 是否可搜索 */
17
27
  filterable?: boolean;
28
+ /** 自定义搜索方法 */
18
29
  filterMethod?: (val: ValueType, searchText: string) => boolean;
30
+ /** 占位符 */
19
31
  placeholder?: string;
32
+ /** 选项为空时显示的文字 */
20
33
  noDataText?: string;
34
+ /** 搜索条件无匹配时显示的文字 */
21
35
  noMatchText?: string;
36
+ /** 是否正在从远程获取数据 */
22
37
  loading?: boolean;
38
+ /** 远程加载时显示的文字 */
23
39
  loadingText?: string;
40
+ /** */
24
41
  required?: boolean;
42
+ /** 表单校验错误提示 */
25
43
  error?: boolean;
44
+ /** 表单校验警告提示 */
26
45
  warning?: boolean;
46
+ /** 多选时是否将选中值按文字的形式展示 */
27
47
  collapseTags?: boolean;
48
+ /** 需要显示的 Tag 的最大数量 只有当 collapseTags 设置为 true 时才会生效。 */
28
49
  maxCollapseTags?: number;
50
+ /** 当鼠标悬停于折叠标签的文本时,是否显示所有选中的标签。 要使用此属性,collapseTags属性必须设定为 true */
29
51
  collapseTagsTooltip?: boolean;
52
+ /** 鼠标悬停于折叠标签的文本格式化函数, 要使用此属性,collapseTags属性必须设定为 true */
30
53
  collapseTips?: (collapseNum: number, total: number) => string;
54
+ /** 是否纯文本模式,即无边框 */
31
55
  plain?: boolean;
56
+ /** 输入框头部内容,只对 type="text" 有效 */
32
57
  prefix?: React.ReactElement<any> | string | number;
58
+ /** 输入框尾部内容,只对 type="text" 有效 */
33
59
  suffix?: React.ReactElement<any> | string | number;
60
+ /** 输入框前置内容,只对 type="text" 有效 */
34
61
  prepend?: React.ReactElement<any> | string | number;
62
+ /** 输入框后置内容,只对 type="text" 有效 */
35
63
  append?: React.ReactElement | string | number;
36
64
  expandedKeys?: Key[][];
37
65
  lable?: string;
66
+ /** 是否追加到body下 */
38
67
  appendToBody?: boolean;
68
+ /** 选中值发生变化时触发 */
39
69
  onChange?: (value: ValueType, level?: number, label?: string | string[], node?: S[] | S[][]) => void;
70
+ /** 是否可以选择 */
40
71
  shouldSelect?: (node?: object, level?: number) => boolean;
41
72
  labelFormatter?: (level?: number, node?: object[]) => string;
42
73
  }
43
74
  export interface CascaderMenuProps {
75
+ /** 次级菜单的展开方式 */
44
76
  expandTrigger?: 'click' | 'hover';
77
+ /** 是否多选 */
45
78
  multiple?: boolean;
79
+ /** 是否严格的遵守父子节点不互相关联 */
46
80
  checkStrictly?: boolean;
81
+ /** 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值 */
47
82
  emitPath?: boolean;
83
+ /** 是否动态加载子节点,需与 lazyLoad 方法结合使用 */
48
84
  lazy?: boolean;
85
+ /** 加载动态数据的方法,仅在 lazy 为 true 时有效 */
49
86
  lazyLoad?: (node: object, resolve?: (value: object[], isTree?: boolean) => void, reject?: () => void) => void;
87
+ /** 指定选项的值为选项对象的某个属性值 */
50
88
  valueKey?: string;
89
+ /** 指定选项标签为选项对象的某个属性值 */
51
90
  labelKey?: string;
91
+ /** 指定选项的子选项为选项对象的某个属性值 */
52
92
  childrenKey?: string;
93
+ /** 指定选项的禁用为选项对象的某个属性值 */
53
94
  disabledKey?: string;
95
+ /** 指定选项的叶子节点的标志位为选项对象的某个属性值 */
54
96
  leafKey?: string;
55
97
  }
56
98
  export interface TreeMenuProps {
99
+ /** 指定选项的值为选项对象的某个属性值 */
57
100
  valueKey?: string;
101
+ /** 指定选项标签为选项对象的某个属性值 */
58
102
  labelKey?: string;
103
+ /** 指定选项的子选项为选项对象的某个属性值 */
59
104
  childrenKey?: string;
105
+ /** 指定选项的禁用为选项对象的某个属性值 */
60
106
  disabledKey?: string;
107
+ /** 指定选项的叶子节点的标志位为选项对象的某个属性值 */
61
108
  leafKey?: string;
62
109
  }
63
110
  export interface CascaderRef {
64
111
  inputInstance?: InputRef;
65
112
  setLabel: (label: string) => void;
66
113
  onClear: () => void;
114
+ /** 重置懒加载的节点,适用于动态懒加载配置 */
67
115
  resetNodes: () => void;
68
116
  setVisible: (visible: boolean) => void;
69
117
  }
70
118
  export interface OptionNode extends Object {
119
+ /**
120
+ * 主键
121
+ * @private
122
+ */
71
123
  __id: string;
124
+ /**
125
+ * 父级节点ID
126
+ * @private
127
+ */
72
128
  __pId: string;
129
+ /**
130
+ * 层级
131
+ * @private
132
+ */
73
133
  __level?: number;
134
+ /**
135
+ * 是否叶子节点
136
+ * @private
137
+ */
74
138
  __leaf?: boolean;
139
+ /**
140
+ * 是否已勾选
141
+ * @private
142
+ */
75
143
  __checked?: boolean;
144
+ /**
145
+ * 是否半选
146
+ * @private
147
+ */
76
148
  __indeterminate?: boolean;
149
+ /**
150
+ * 时子节点集合
151
+ * @private
152
+ */
77
153
  children?: OptionNode[];
154
+ /**
155
+ * 树形组件时子节点集合
156
+ * @private
157
+ */
78
158
  treeChildren?: boolean;
79
159
  }
@@ -1,29 +1,101 @@
1
1
  import { Key } from '../Tree';
2
2
  import { CascaderProps, OptionNode } from './typings';
3
+ /**
4
+ * @author Parker
5
+ * @CreateTime 2022/4/17 16:02:49
6
+ * @LastEditor Parker
7
+ * @ModifyTime 2022/11/20 13:05:51
8
+ * @Description
9
+ */
3
10
  export declare const useCascader: (initialData: object[], props: CascaderProps, value: string[] | string[][]) => {
11
+ /** 最高层级 */
4
12
  allLevel: number;
13
+ /** 选项数据 */
5
14
  optionData: Record<string, OptionNode[]>;
15
+ /**
16
+ * 懒加载时存储option
17
+ * @param nodes
18
+ * @param level 层级
19
+ */
6
20
  storeOptionData: (nodes: object[], level: number, parent: OptionNode, { isTree, isCover }: {
7
21
  isTree?: boolean;
8
22
  isCover?: boolean;
9
23
  }) => OptionNode[];
24
+ /**
25
+ * 获取选中的值
26
+ * @param level 层级
27
+ * @returns
28
+ */
10
29
  getSelectedValue: () => string[];
30
+ /**
31
+ * 获取任意层级选中的值
32
+ * @param level 层级
33
+ * @returns
34
+ */
11
35
  getValueOfLevel: (level?: number) => string;
36
+ /**
37
+ * 获取选中的文本
38
+ * @param level 层级
39
+ * @returns
40
+ */
12
41
  getSelectedLabel: (labelFormatter?: (node?: OptionNode[]) => string) => string;
42
+ /**
43
+ * 设置任意层级节点的标签
44
+ * @param level 层级
45
+ * @param value
46
+ */
13
47
  setSelectedNode: (level: number, node: OptionNode) => void;
14
48
  setSelectedValue: (level: number, val: string) => void;
15
49
  getSelectedNode: () => OptionNode[];
50
+ /**
51
+ * 设置选中节点
52
+ * @param level 层级
53
+ * @param node 当前节点
54
+ * @param checked 是否选中
55
+ */
16
56
  setCheckedNode: (level: number, node: OptionNode, checked: boolean) => void;
17
57
  getCheckedNodes: () => OptionNode[][];
18
58
  getCheckedValue: () => string[][];
19
59
  getCheckedLabel: () => any[][];
20
60
  loopGetParent: (level: number, node: OptionNode, result?: OptionNode[]) => OptionNode[];
61
+ /**
62
+ * 获取任意节点的option数据
63
+ * @param level 层级
64
+ * @returns
65
+ */
21
66
  getOptions: (level: number) => OptionNode[];
67
+ /** 清空值 */
22
68
  clearSelected: () => void;
69
+ /**
70
+ * 设置节点是否为叶子节点
71
+ * @param node
72
+ * @param isLeaf
73
+ */
23
74
  setNodeLeaf: (node: OptionNode, isLeaf: boolean) => void;
75
+ /**
76
+ * 获取数据类型
77
+ * @param level 层级
78
+ * @returns
79
+ */
24
80
  getDataType: (level: number) => any;
81
+ /**
82
+ * 获取树数据
83
+ * @param level 层级
84
+ * @returns
85
+ */
25
86
  getTreeData: (level: number) => any[];
87
+ /**
88
+ * 获取扩展key
89
+ * @param level 层级
90
+ * @returns
91
+ */
26
92
  getExpandedKeys: (level: number) => Key[];
93
+ /**
94
+ * 设置扩展key
95
+ * @param level 层级
96
+ * @param keys
97
+ * @returns
98
+ */
27
99
  setExpandedKeys: (level: number, keys: Key[]) => void;
28
100
  handleSearch: (searchText: string) => OptionNode[][];
29
101
  resetNodes: () => void;
@@ -7,15 +7,26 @@ export type CheckboxRef = {
7
7
  setChecked: (value: boolean) => void;
8
8
  };
9
9
  export interface CheckboxProps<V = ValueType> extends Omit<React.AllHTMLAttributes<HTMLElement>, 'value' | 'defaultValue' | 'loading' | 'size' | 'icon' | 'style' | 'onChange' | 'children'>, Omit<FormControlBaseProps<V>, 'onChange'>, BaseProps, NativeProps {
10
+ /** tooltip 提示*/
10
11
  title?: string;
12
+ /** Inline layout */
11
13
  inline?: boolean;
14
+ /** 是否只读 */
12
15
  readOnly?: boolean;
16
+ /** 是否选中 */
13
17
  checked?: boolean;
18
+ /** 默认是否选中 */
14
19
  defaultChecked?: boolean;
20
+ /** 是否中间状态 */
15
21
  indeterminate?: boolean;
22
+ /** 原生 name 属性 */
16
23
  name?: string;
24
+ /** 点击checkbox时是否阻止默认事件 */
17
25
  prevent?: boolean;
26
+ /** 当绑定值变化时触发的事件 */
18
27
  onChange?: (checked: boolean, value: ValueType, event: React.ChangeEvent<HTMLInputElement>) => void;
28
+ /** 点击checkbox顶级div事件 */
19
29
  onClick?: (event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void;
30
+ /** 点击checkbox事件 */
20
31
  onCheckboxClick?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
21
32
  }
@@ -3,9 +3,13 @@ import type { ValueType } from '../Checkbox/index';
3
3
  import { BaseProps, FormControlBaseProps, NativeProps, TypeAttributes } from '../types/common';
4
4
  export interface CheckboxGroupProps<V = ValueType[] | boolean> extends FormControlBaseProps<V>, BaseProps, NativeProps {
5
5
  name?: string;
6
+ /** 尺寸 */
6
7
  size?: TypeAttributes.Size;
8
+ /** 单个CheckBox时获取Boolean类型的值 */
7
9
  getBooleanOnSingle?: boolean;
10
+ /** 可被勾选的 checkbox 的最小数量 */
8
11
  min?: number;
12
+ /** 可被勾选的 checkbox 的最大数量 */
9
13
  max?: number;
10
14
  }
11
15
  declare const CheckboxGroup: FC<CheckboxGroupProps>;
@@ -9,6 +9,7 @@ export interface CheckboxGroupContextValue {
9
9
  disabled?: boolean;
10
10
  readOnly?: boolean;
11
11
  plaintext?: boolean;
12
+ /** 尺寸 */
12
13
  size?: TypeAttributes.Size;
13
14
  onChange?: (value: any, checked: boolean, event: any) => void;
14
15
  }
@@ -3,14 +3,24 @@ export type MediaType = keyof Pick<ColProps, 'span' | 'offset' | 'push' | 'pull'
3
3
  export type MediaLayout = Partial<Record<MediaType, number>>;
4
4
  export type MediaSize = Pick<ColProps, 'xs' | 'sm' | 'md' | 'lg' | 'xl'>;
5
5
  export interface ColProps extends BaseProps, NativeProps {
6
+ /** 栅格占据的列数 */
6
7
  span?: number;
8
+ /** 栅格左侧的间隔格数 */
7
9
  offset?: number;
10
+ /** 栅格向右移动格数 */
8
11
  push?: number;
12
+ /** 栅格向左移动格数 */
9
13
  pull?: number;
14
+ /** <768px 响应式栅格数或者栅格属性对象 */
10
15
  xs?: number | MediaLayout;
16
+ /** ≥768px 响应式栅格数或者栅格属性对象 */
11
17
  sm?: number | MediaLayout;
18
+ /** ≥992px 响应式栅格数或者栅格属性对象 */
12
19
  md?: number | MediaLayout;
20
+ /** ≥1200px 响应式栅格数或者栅格属性对象 */
13
21
  lg?: number | MediaLayout;
22
+ /** ≥1920px 响应式栅格数或者栅格属性对象 */
14
23
  xl?: number | MediaLayout;
24
+ /** 自定义元素标签 */
15
25
  tag?: string;
16
26
  }
@@ -1,9 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { CollapseProps } from './typings';
3
3
  interface CollapseContextProps {
4
+ /** 当前激活的面板(可控模式:如果是手风琴模式,绑定值类型需要为string,否则为array) */
4
5
  value: CollapseProps['activeName'];
5
6
  setValue: (value: CollapseProps['activeName']) => void;
7
+ /** 是否手风琴模式 */
6
8
  accordion: boolean;
9
+ /** 当前激活面板改变时触发(如果是手风琴模式,参数 activeNames 类型为string,否则为array) */
7
10
  onChange: (activeNames: string | string[]) => void;
8
11
  }
9
12
  export declare const CollapseContext: import("react").Context<CollapseContextProps>;
@@ -1,13 +1,20 @@
1
1
  import React from 'react';
2
2
  import { BaseProps, NativeProps } from '../types/common';
3
3
  export interface CollapseProps extends BaseProps, NativeProps<'--el-collapse-border-color' | '--el-collapse-header-height' | '--el-collapse-header-bg-color' | '--el-collapse-header-text-color' | '--el-collapse-header-font-size' | '--el-collapse-content-bg-color' | '--el-collapse-content-font-size' | '--el-collapse-content-text-color' | '--el-transition-duration' | '--el-collapse-item-margin'> {
4
+ /** 当前激活的面板(如果是手风琴模式,绑定值类型需要为string,否则为array) */
4
5
  defaultActiveName?: string | string[];
6
+ /** 当前激活的面板(可控模式:如果是手风琴模式,绑定值类型需要为string,否则为array) */
5
7
  activeName?: string | string[];
8
+ /** 是否手风琴模式 */
6
9
  accordion?: boolean;
10
+ /** 当前激活面板改变时触发(如果是手风琴模式,参数 activeNames 类型为string,否则为array) */
7
11
  onChange?: (activeNames: string | string[]) => void;
8
12
  }
9
13
  export interface CollapseItemProps extends BaseProps, NativeProps {
14
+ /** 唯一标志符 */
10
15
  name: string;
16
+ /** 面板标题 */
11
17
  title?: string | React.ReactElement;
18
+ /** 是否禁用 */
12
19
  disabled?: boolean;
13
20
  }
@@ -8,5 +8,12 @@ interface Props {
8
8
  export interface AlphaSliderRef {
9
9
  update: () => void;
10
10
  }
11
+ /**
12
+ * @author Parker
13
+ * @CreateTime 2022/5/14 18:16:52
14
+ * @LastEditor Parker
15
+ * @ModifyTime 2022/5/14 22:17:13
16
+ * @Description Element Plus 颜色选择器组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
17
+ */
11
18
  declare const AlphaSlider: React.ForwardRefExoticComponent<Props & React.RefAttributes<AlphaSliderRef>>;
12
19
  export default AlphaSlider;
@@ -8,5 +8,12 @@ interface Props {
8
8
  export interface HueSliderRef {
9
9
  update: () => void;
10
10
  }
11
+ /**
12
+ * @author Parker
13
+ * @CreateTime 2022/5/14 16:16:37
14
+ * @LastEditor Parker
15
+ * @ModifyTime 2022/11/20 11:55:00
16
+ * @Description Element Plus 颜色选择器组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
17
+ */
11
18
  declare const HueSlider: React.ForwardRefExoticComponent<Props & React.RefAttributes<HueSliderRef>>;
12
19
  export default HueSlider;