@cloudtower/eagle 0.32.14 → 0.32.17

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.
@@ -1,16 +1,97 @@
1
- import { Meta } from "@storybook/react";
2
- import React from "react";
3
- declare const meta: Meta;
4
- export default meta;
5
- export declare const Basic: {
6
- (): React.JSX.Element;
7
- story: {
8
- name: string;
9
- parameters: {
10
- design: {
11
- type: string;
12
- url: string;
13
- };
1
+ import Select from "../../../src/core/Select";
2
+ import type { StoryObj } from "@storybook/react";
3
+ /**
4
+ * Select 组件是基于 antd Select 的封装,提供了更符合设计规范的样式和交互。
5
+ *
6
+ * ### 参数说明
7
+ *
8
+ * | 参数 | 说明 | 类型 | 默认值 |
9
+ * | --- | --- | --- | --- |
10
+ * | size | 选择器大小,large 用于表单场景,small 用于表格等紧凑场景 | 'large' \| 'middle' \| 'small' | 'middle' |
11
+ * | loading | 加载状态,显示加载中的动画效果 | boolean | false |
12
+ * | isLoadingValue | 是否正在加载选项值,用于异步加载选项时的加载状态 | boolean | false |
13
+ * | disabled | 是否禁用选择器,禁用后不可点击选择 | boolean | false |
14
+ * | mode | 设置选择模式,multiple 为多选,tags 为自由输入多选 | 'multiple' \| 'tags' | - |
15
+ * | showSearch | 是否可搜索,开启后可通过输入关键字过滤选项 | boolean | false |
16
+ * | danger | 错误状态,用于表单校验失败等场景 | boolean | false |
17
+ * | placeholder | 选择框默认文本 | string | - |
18
+ * | value | 指定当前选中的条目 | string \| string[] | - |
19
+ * | defaultValue | 指定默认选中的条目 | string \| string[] | - |
20
+ * | onChange | 选中值发生变化时的回调 | function(value, option) | - |
21
+ *
22
+ * 更多属性请参考 antd Select 组件文档
23
+ */
24
+ declare const meta: {
25
+ component: import("../../../src/core").SelectComponentType<any, HTMLElement>;
26
+ title: "Core/Select | 选择器";
27
+ args: {
28
+ placeholder: string;
29
+ options: ({
30
+ value: string;
31
+ label: string;
32
+ disabled?: undefined;
33
+ } | {
34
+ value: string;
35
+ label: string;
36
+ disabled: true;
37
+ })[];
38
+ input: {
39
+ value: string;
14
40
  };
15
41
  };
16
42
  };
43
+ export default meta;
44
+ type Story = StoryObj<typeof Select>;
45
+ /**
46
+ * Select 组件提供了三种尺寸:
47
+ * - large: 适用于表单中的主要选择器
48
+ * - middle: 默认尺寸,适用于大多数场景
49
+ * - small: 适用于表格等紧凑型界面
50
+ */
51
+ export declare const Basic: Story;
52
+ /**
53
+ * Select 组件支持在选项中添加前缀和后缀图标:
54
+ * - prefix: 在选项文本前显示图标,常用于表示状态或类型
55
+ * - suffix: 在选项文本后显示图标,常用于显示额外信息
56
+ */
57
+ export declare const WithIcons: Story;
58
+ /**
59
+ * 多选模式下可以选择多个选项,选中的选项会以 Tag 的形式展示。
60
+ * 支持以下特性:
61
+ * - 可以通过点击 Tag 的关闭按钮删除已选项
62
+ * - 可以通过键盘删除键(Backspace)删除最后一个已选项
63
+ * - 支持通过搜索快速定位选项
64
+ */
65
+ export declare const Multiple: Story;
66
+ /**
67
+ * Select 组件提供了两种加载状态:
68
+ * 1. loading: 原生的加载中
69
+ * 2. isLoadingValue: value 在加载,select 不能点击
70
+ */
71
+ export declare const Loading: Story;
72
+ /**
73
+ * 可搜索模式下,用户可以输入关键字过滤选项。
74
+ * 可以通过 filterOption 属性自定义搜索逻辑。
75
+ */
76
+ export declare const SearchSelect: Story;
77
+ /**
78
+ * Select 支持自定义触发器,可以替换默认的下拉箭头图标。
79
+ * 常见用法是使用自定义图标来表达特定的筛选含义。
80
+ */
81
+ export declare const CustomTrigger: Story;
82
+ /**
83
+ * 错误状态有两种实现方式:
84
+ * 1. 使用 className="select-error" 添加错误样式
85
+ * 2. 使用 danger 属性(推荐)
86
+ */
87
+ export declare const Error: Story;
88
+ /**
89
+ * 禁用状态下,选择器不可点击,显示为灰色。
90
+ */
91
+ export declare const Disabled: Story;
92
+ /**
93
+ * Select 组件可以通过特定的样式类实现组合效果:
94
+ * - LeftEndSelectStyle: 左侧圆角
95
+ * - RightEndSelectStyle: 右侧圆角
96
+ */
97
+ export declare const Combined: Story;