@alifd/chat 0.3.39 → 0.3.40-beta.1

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 (241) hide show
  1. package/es/ai-loading/types.d.ts +1 -0
  2. package/es/button/button.d.ts +1 -2
  3. package/es/button/button.js +13 -19
  4. package/es/button/group.js +5 -42
  5. package/es/button/main.scss +36 -77
  6. package/es/card/main.scss +1 -1
  7. package/es/checkbox-group/main.scss +6 -7
  8. package/es/checkbox-group/types.d.ts +6 -0
  9. package/es/code-view/index.d.ts +11 -0
  10. package/es/code-view/index.js +63 -0
  11. package/es/code-view/main.scss +54 -0
  12. package/es/code-view/style.d.ts +4 -0
  13. package/es/code-view/style.js +4 -0
  14. package/es/code-view/types.d.ts +27 -0
  15. package/es/code-view/types.js +1 -0
  16. package/es/collapse/index.d.ts +157 -0
  17. package/es/collapse/index.js +20 -0
  18. package/es/collapse/main.scss +95 -0
  19. package/es/collapse/style.d.ts +2 -0
  20. package/es/collapse/style.js +2 -0
  21. package/es/collapse/types.d.ts +82 -0
  22. package/es/collapse/types.js +2 -0
  23. package/es/core/variables.scss +27 -12
  24. package/es/date-picker/DatePicker.d.ts +5 -0
  25. package/es/date-picker/DatePicker.js +15 -0
  26. package/es/date-picker/MonthPicker.d.ts +4 -0
  27. package/es/date-picker/MonthPicker.js +15 -0
  28. package/es/date-picker/RangePicker.d.ts +4 -0
  29. package/es/date-picker/RangePicker.js +17 -0
  30. package/es/date-picker/YearPicker.d.ts +4 -0
  31. package/es/date-picker/YearPicker.js +15 -0
  32. package/es/date-picker/index.d.ts +5 -23
  33. package/es/date-picker/index.js +11 -29
  34. package/es/date-picker/main.scss +23 -1
  35. package/es/date-picker/style.d.ts +1 -0
  36. package/es/date-picker/style.js +1 -0
  37. package/es/date-picker/types.d.ts +161 -81
  38. package/es/float-button/hooks/useAutoAlign.d.ts +1 -1
  39. package/es/form/style.d.ts +0 -1
  40. package/es/form/style.js +2 -1
  41. package/es/form/types.d.ts +3 -517
  42. package/es/form/types.js +5 -1
  43. package/es/html-render/index.d.ts +1 -1
  44. package/es/html-render/index.js +204 -99
  45. package/es/html-render/main.scss +27 -8
  46. package/es/html-render/style.d.ts +1 -0
  47. package/es/html-render/style.js +1 -0
  48. package/es/icon/index.d.ts +1 -1
  49. package/es/index.d.ts +3 -0
  50. package/es/index.js +4 -1
  51. package/es/input/index.d.ts +1 -1
  52. package/es/input/index.js +16 -6
  53. package/es/input/main.scss +25 -0
  54. package/es/input/style.d.ts +1 -0
  55. package/es/input/style.js +1 -0
  56. package/es/input/types.d.ts +58 -15
  57. package/es/markdown/index.d.ts +1 -2
  58. package/es/markdown/index.js +26 -15
  59. package/es/markdown/main.scss +4 -3
  60. package/es/markdown/style.d.ts +2 -1
  61. package/es/markdown/style.js +2 -1
  62. package/es/markdown/types.d.ts +20 -9
  63. package/es/message/index.d.ts +4 -4
  64. package/es/person-picker/index.d.ts +3 -190
  65. package/es/person-picker/index.js +23 -21
  66. package/es/person-picker/main.scss +15 -1
  67. package/es/person-picker/types.d.ts +53 -11
  68. package/es/radio-group/index.d.ts +1 -1
  69. package/es/radio-group/index.js +9 -3
  70. package/es/radio-group/main.scss +13 -5
  71. package/es/radio-group/types.d.ts +5 -3
  72. package/es/reference/index.d.ts +1 -1
  73. package/es/reference/index.js +14 -15
  74. package/es/reference/main.scss +1 -1
  75. package/es/reference/types.d.ts +1 -0
  76. package/es/select/button.d.ts +3 -0
  77. package/es/select/button.js +70 -0
  78. package/es/select/index.d.ts +79 -79
  79. package/es/select/index.js +13 -57
  80. package/es/select/main.scss +22 -4
  81. package/es/select/types.d.ts +108 -1
  82. package/es/step/index.js +2 -2
  83. package/es/step/main.scss +115 -66
  84. package/es/step/types.d.ts +13 -2
  85. package/es/table/index.d.ts +12 -0
  86. package/es/table/index.js +23 -0
  87. package/es/table/main.scss +30 -0
  88. package/es/table/style.d.ts +2 -0
  89. package/es/table/style.js +2 -0
  90. package/es/table/types.d.ts +98 -0
  91. package/es/table/types.js +1 -0
  92. package/es/tag/index.d.ts +5 -3
  93. package/es/tag/index.js +18 -2
  94. package/es/tag/main.scss +20 -4
  95. package/es/tag/types.d.ts +55 -0
  96. package/es/text/index.js +67 -22
  97. package/es/text/main.scss +4 -1
  98. package/es/text/types.d.ts +8 -0
  99. package/es/time-picker/index.d.ts +6 -15
  100. package/es/time-picker/index.js +71 -24
  101. package/es/time-picker/main.scss +19 -1
  102. package/es/time-picker/style.d.ts +1 -0
  103. package/es/time-picker/style.js +1 -0
  104. package/es/time-picker/types.d.ts +133 -8
  105. package/es/tool-status/index.d.ts +1 -1
  106. package/es/tool-status/index.js +1 -1
  107. package/es/tool-status/main.scss +2 -1
  108. package/es/tool-status/types.d.ts +7 -2
  109. package/es/utils/func.d.ts +1 -0
  110. package/es/utils/func.js +13 -0
  111. package/es/utils/github-dark.scss +137 -0
  112. package/es/utils/github.scss +137 -0
  113. package/es/utils/hoc/main.scss +166 -0
  114. package/es/utils/hoc/withLabel.d.ts +94 -0
  115. package/es/utils/hoc/withLabel.js +57 -0
  116. package/es/utils/index.d.ts +1 -0
  117. package/es/utils/index.js +1 -0
  118. package/lib/ai-loading/types.d.ts +1 -0
  119. package/lib/button/button.d.ts +1 -2
  120. package/lib/button/button.js +13 -19
  121. package/lib/button/group.js +4 -41
  122. package/lib/button/main.scss +36 -77
  123. package/lib/card/main.scss +1 -1
  124. package/lib/checkbox-group/main.scss +6 -7
  125. package/lib/checkbox-group/types.d.ts +6 -0
  126. package/lib/code-view/index.d.ts +11 -0
  127. package/lib/code-view/index.js +66 -0
  128. package/lib/code-view/main.scss +54 -0
  129. package/lib/code-view/style.d.ts +4 -0
  130. package/lib/code-view/style.js +6 -0
  131. package/lib/code-view/types.d.ts +27 -0
  132. package/lib/code-view/types.js +2 -0
  133. package/lib/collapse/index.d.ts +157 -0
  134. package/lib/collapse/index.js +22 -0
  135. package/lib/collapse/main.scss +95 -0
  136. package/lib/collapse/style.d.ts +2 -0
  137. package/lib/collapse/style.js +4 -0
  138. package/lib/collapse/types.d.ts +82 -0
  139. package/lib/collapse/types.js +3 -0
  140. package/lib/core/variables.scss +27 -12
  141. package/lib/date-picker/DatePicker.d.ts +5 -0
  142. package/lib/date-picker/DatePicker.js +17 -0
  143. package/lib/date-picker/MonthPicker.d.ts +4 -0
  144. package/lib/date-picker/MonthPicker.js +17 -0
  145. package/lib/date-picker/RangePicker.d.ts +4 -0
  146. package/lib/date-picker/RangePicker.js +19 -0
  147. package/lib/date-picker/YearPicker.d.ts +4 -0
  148. package/lib/date-picker/YearPicker.js +17 -0
  149. package/lib/date-picker/index.d.ts +5 -23
  150. package/lib/date-picker/index.js +10 -27
  151. package/lib/date-picker/main.scss +23 -1
  152. package/lib/date-picker/style.d.ts +1 -0
  153. package/lib/date-picker/style.js +1 -0
  154. package/lib/date-picker/types.d.ts +161 -81
  155. package/lib/float-button/hooks/useAutoAlign.d.ts +1 -1
  156. package/lib/form/style.d.ts +0 -1
  157. package/lib/form/style.js +1 -2
  158. package/lib/form/types.d.ts +3 -517
  159. package/lib/form/types.js +4 -1
  160. package/lib/html-render/index.d.ts +1 -1
  161. package/lib/html-render/index.js +203 -98
  162. package/lib/html-render/main.scss +27 -8
  163. package/lib/html-render/style.d.ts +1 -0
  164. package/lib/html-render/style.js +1 -0
  165. package/lib/icon/index.d.ts +1 -1
  166. package/lib/index.d.ts +3 -0
  167. package/lib/index.js +8 -2
  168. package/lib/input/index.d.ts +1 -1
  169. package/lib/input/index.js +16 -6
  170. package/lib/input/main.scss +25 -0
  171. package/lib/input/style.d.ts +1 -0
  172. package/lib/input/style.js +1 -0
  173. package/lib/input/types.d.ts +58 -15
  174. package/lib/markdown/index.d.ts +1 -2
  175. package/lib/markdown/index.js +26 -15
  176. package/lib/markdown/main.scss +4 -3
  177. package/lib/markdown/style.d.ts +2 -1
  178. package/lib/markdown/style.js +2 -1
  179. package/lib/markdown/types.d.ts +20 -9
  180. package/lib/message/index.d.ts +4 -4
  181. package/lib/person-picker/index.d.ts +3 -190
  182. package/lib/person-picker/index.js +22 -20
  183. package/lib/person-picker/main.scss +15 -1
  184. package/lib/person-picker/types.d.ts +53 -11
  185. package/lib/radio-group/index.d.ts +1 -1
  186. package/lib/radio-group/index.js +8 -2
  187. package/lib/radio-group/main.scss +13 -5
  188. package/lib/radio-group/types.d.ts +5 -3
  189. package/lib/reference/index.d.ts +1 -1
  190. package/lib/reference/index.js +17 -18
  191. package/lib/reference/main.scss +1 -1
  192. package/lib/reference/types.d.ts +1 -0
  193. package/lib/select/button.d.ts +3 -0
  194. package/lib/select/button.js +74 -0
  195. package/lib/select/index.d.ts +79 -79
  196. package/lib/select/index.js +11 -55
  197. package/lib/select/main.scss +22 -4
  198. package/lib/select/types.d.ts +108 -1
  199. package/lib/step/index.js +2 -2
  200. package/lib/step/main.scss +115 -66
  201. package/lib/step/types.d.ts +13 -2
  202. package/lib/table/index.d.ts +12 -0
  203. package/lib/table/index.js +25 -0
  204. package/lib/table/main.scss +30 -0
  205. package/lib/table/style.d.ts +2 -0
  206. package/lib/table/style.js +4 -0
  207. package/lib/table/types.d.ts +98 -0
  208. package/lib/table/types.js +2 -0
  209. package/lib/tag/index.d.ts +5 -3
  210. package/lib/tag/index.js +17 -1
  211. package/lib/tag/main.scss +20 -4
  212. package/lib/tag/types.d.ts +55 -0
  213. package/lib/text/index.js +66 -21
  214. package/lib/text/main.scss +4 -1
  215. package/lib/text/types.d.ts +8 -0
  216. package/lib/time-picker/index.d.ts +6 -15
  217. package/lib/time-picker/index.js +71 -23
  218. package/lib/time-picker/main.scss +19 -1
  219. package/lib/time-picker/style.d.ts +1 -0
  220. package/lib/time-picker/style.js +1 -0
  221. package/lib/time-picker/types.d.ts +133 -8
  222. package/lib/tool-status/index.d.ts +1 -1
  223. package/lib/tool-status/index.js +1 -1
  224. package/lib/tool-status/main.scss +2 -1
  225. package/lib/tool-status/types.d.ts +7 -2
  226. package/lib/utils/func.d.ts +1 -0
  227. package/lib/utils/func.js +15 -0
  228. package/lib/utils/github-dark.scss +137 -0
  229. package/lib/utils/github.scss +137 -0
  230. package/lib/utils/hoc/main.scss +166 -0
  231. package/lib/utils/hoc/withLabel.d.ts +94 -0
  232. package/lib/utils/hoc/withLabel.js +60 -0
  233. package/lib/utils/index.d.ts +1 -0
  234. package/lib/utils/index.js +1 -0
  235. package/package.json +49 -4
  236. package/es/form/index.d.ts +0 -23
  237. package/es/form/index.js +0 -33
  238. package/es/form/main.scss +0 -5
  239. package/lib/form/index.d.ts +0 -23
  240. package/lib/form/index.js +0 -35
  241. package/lib/form/main.scss +0 -5
@@ -1,123 +1,203 @@
1
- import type React from 'react';
1
+ import type { Dayjs } from 'dayjs';
2
+ import type { WithLabelProps } from '../utils/hoc/withLabel';
2
3
  /**
3
- * 按钮类型
4
- * @api
4
+ * 时间选择器配置
5
5
  */
6
- export type ButtonSize = 'small' | 'medium' | 'large';
6
+ export interface ShowTimeConfig {
7
+ format?: string;
8
+ defaultValue?: Dayjs | string;
9
+ }
7
10
  /**
8
- * @api Button.Group
11
+ * @api DatePicker属性
9
12
  */
10
- export interface GroupProps extends React.HTMLAttributes<HTMLElement> {
13
+ export interface DatePickerProps {
14
+ /**
15
+ * 日期格式
16
+ * @en Date format
17
+ * @defaultValue 'YYYY-MM-DD'
18
+ */
19
+ format?: string;
20
+ /**
21
+ * 选择的日期值
22
+ * @en Selected date value
23
+ */
24
+ value?: Dayjs | null;
25
+ /**
26
+ * 默认日期值
27
+ * @en Default date value
28
+ */
29
+ defaultValue?: Dayjs | null;
30
+ /**
31
+ * 日期值改变时的回调
32
+ * @en Callback when date changes
33
+ */
34
+ onChange?: (date: Dayjs | null, dateString: string) => void;
35
+ /**
36
+ * 是否显示时间选择
37
+ * @en Whether to show time picker
38
+ */
39
+ showTime?: boolean;
40
+ /**
41
+ * 时间面板配置
42
+ * @en Time panel configuration
43
+ */
44
+ timePanelProps?: ShowTimeConfig;
45
+ /**
46
+ * 占位符文本
47
+ * @en Placeholder text
48
+ */
49
+ placeholder?: string;
11
50
  /**
12
- * 统一设置 Button 组件的按钮大小
51
+ * 自定义类名
52
+ * @en Custom className
13
53
  */
14
- size?: ButtonSize;
54
+ className?: string;
55
+ /**
56
+ * 大小
57
+ * @en Size
58
+ */
59
+ size?: 'small' | 'medium' | 'large';
15
60
  }
16
- type HTMLAttributesWeak = Omit<React.ButtonHTMLAttributes<HTMLElement>, 'type' | 'onClick'>;
17
61
  /**
18
- * @api Button
62
+ * @api YearPicker属性
19
63
  */
20
- export interface ButtonProps extends HTMLAttributesWeak {
64
+ export interface YearPickerProps {
21
65
  /**
22
- * 按钮的类型
23
- * @en Typeo of button
24
- * @defaultValue 'normal'
66
+ * 年份格式
67
+ * @en Year format
68
+ * @defaultValue 'YYYY'
25
69
  */
26
- type?: 'primary' | 'secondary' | 'normal';
70
+ format?: string;
27
71
  /**
28
- * @deprecated use `warning` `text` `ghost` insteaded
29
- * @skip
72
+ * 选择的年份值
73
+ * @en Selected year value
30
74
  */
31
- shape?: 'warning' | 'text' | 'ghost';
75
+ value?: Dayjs | null;
32
76
  /**
33
- * 按钮的尺寸
34
- * @en Size of button
35
- * @defaultValue 'medium'
77
+ * 默认年份值
78
+ * @en Default year value
36
79
  */
37
- size?: ButtonSize;
80
+ defaultValue?: Dayjs | null;
38
81
  /**
39
- * 按钮中可配置的 Icon
40
- * @en Available icons in button
41
- * @example
42
- * \{ loading: <Icon type="loading"/> \}
82
+ * 年份值改变时的回调
83
+ * @en Callback when year changes
43
84
  */
44
- icons?: {
45
- loading?: React.ReactNode;
46
- };
85
+ onChange?: (date: Dayjs | null, dateString: string) => void;
47
86
  /**
48
- * 按钮中 Icon 的尺寸
49
- * @en Size of icon in button
50
- * @defaultValue 默认根据 size 自动映射,映射规则:
51
- * size:large -\> `small`
52
- * size:medium -\> `xs`
53
- * size:small -\> `xs`
87
+ * 占位符文本
88
+ * @en Placeholder text
54
89
  */
55
- iconSize?: number | 'xxs' | 'xs' | 'small' | 'medium' | 'large' | 'xl' | 'xxl' | 'xxxl' | 'inherit';
90
+ placeholder?: string;
56
91
  /**
57
- * button 标签的 type 值
58
- * @en Original html type for button element
59
- * @defaultValue 'button'
60
- * @remarks 仅当 component = 'button' 时使用
92
+ * 自定义类名
93
+ * @en Custom className
61
94
  */
62
- htmlType?: 'submit' | 'reset' | 'button';
95
+ className?: string;
96
+ /**
97
+ * 大小
98
+ * @en Size
99
+ */
100
+ size?: 'small' | 'medium' | 'large';
101
+ }
102
+ /**
103
+ * @api MonthPicker属性
104
+ */
105
+ export interface MonthPickerProps {
106
+ /**
107
+ * 月份格式
108
+ * @en Month format
109
+ * @defaultValue 'YYYY-MM'
110
+ */
111
+ format?: string;
112
+ /**
113
+ * 选择的月份值
114
+ * @en Selected month value
115
+ */
116
+ value?: Dayjs | null;
117
+ /**
118
+ * 默认月份值
119
+ * @en Default month value
120
+ */
121
+ defaultValue?: Dayjs | null;
122
+ /**
123
+ * 月份值改变时的回调
124
+ * @en Callback when month changes
125
+ */
126
+ onChange?: (date: Dayjs | null, dateString: string) => void;
127
+ /**
128
+ * 占位符文本
129
+ * @en Placeholder text
130
+ */
131
+ placeholder?: string;
132
+ /**
133
+ * 自定义类名
134
+ * @en Custom className
135
+ */
136
+ className?: string;
137
+ /**
138
+ * 大小
139
+ * @en Size
140
+ */
141
+ size?: 'small' | 'medium' | 'large';
142
+ }
143
+ /**
144
+ * @api RangePicker属性
145
+ */
146
+ export interface RangePickerProps {
63
147
  /**
64
- * 最终渲染的 jsx 标签标签类型
65
- * @en The jsx tag to be rendered
66
- * @remarks 直接去掉原先的 ReactNode 类型,因为即使传递了非法类型运行时也会报错,不如在类型提示阶段就将错误抛出
148
+ * 日期格式
149
+ * @en Date format
150
+ * @defaultValue 'YYYY-MM-DD'
67
151
  */
68
- component?: 'button' | 'a' | React.ComponentType<unknown>;
152
+ format?: string;
69
153
  /**
70
- * 设置按钮的载入状态
71
- * @en Loading state of a button
72
- * @defaultValue false
154
+ * 选择器模式
155
+ * @en Picker mode
156
+ * @defaultValue 'date'
73
157
  */
74
- loading?: boolean;
158
+ mode?: 'date' | 'month' | 'year';
75
159
  /**
76
- * 是否为幽灵按钮
77
- * @en Setting ghost button
78
- * @defaultValue false
160
+ * 时间范围值
161
+ * @en Date range value
79
162
  */
80
- ghost?: true | false | 'light' | 'dark';
163
+ value?: [Dayjs | null, Dayjs | null];
81
164
  /**
82
- * 是否为文本按钮
83
- * @en Is text button
84
- * @defaultValue false
165
+ * 默认时间范围值
166
+ * @en Default date range value
85
167
  */
86
- text?: boolean;
168
+ defaultValue?: [Dayjs | null, Dayjs | null];
87
169
  /**
88
- * 是否为警告按钮
89
- * @en Is warning button
90
- * @defaultValue false
170
+ * 时间范围值改变时的回调
171
+ * @en Callback when date range changes
91
172
  */
92
- warning?: boolean;
173
+ onChange?: (dates: [Dayjs | null, Dayjs | null], dateStrings: [string, string]) => void;
93
174
  /**
94
- * 是否禁用
95
- * @en Is disabled
96
- * @defaultValue false
175
+ * 是否显示时间选择
176
+ * @en Whether to show time picker
97
177
  */
98
- disabled?: boolean;
178
+ showTime?: boolean;
99
179
  /**
100
- * 点击按钮的回调
101
- * @en Callback of click event
180
+ * 时间面板配置
181
+ * @en Time panel configuration
102
182
  */
103
- onClick?: React.MouseEventHandler;
183
+ timePanelProps?: ShowTimeConfig;
104
184
  /**
105
- * 'a' 标签的 href 属性
106
- * @remarks 仅在 component = 'a' 时使用
107
- * @skip
185
+ * 占位符文本
186
+ * @en Placeholder text
108
187
  */
109
- href?: string;
188
+ placeholder?: string | [string, string];
110
189
  /**
111
- * 'a' 标签的 target 属性
112
- * @remarks 仅在 component = 'a' 时使用
113
- * @skip
190
+ * 自定义类名
191
+ * @en Custom className
114
192
  */
115
- target?: string;
193
+ className?: string;
116
194
  /**
117
- * 'ReactRouterLink' 组件的 to 属性
118
- * @remarks 仅在 component 支持 to 属性时使用
119
- * @skip
195
+ * 大小
196
+ * @en Size
120
197
  */
121
- to?: string;
198
+ size?: 'small' | 'medium' | 'large';
122
199
  }
123
- export {};
200
+ export type DatePickerWithLabelProps = DatePickerProps & WithLabelProps;
201
+ export type YearPickerWithLabelProps = YearPickerProps & WithLabelProps;
202
+ export type MonthPickerWithLabelProps = MonthPickerProps & WithLabelProps;
203
+ export type RangePickerWithLabelProps = RangePickerProps & WithLabelProps;
@@ -11,7 +11,7 @@ trigger: HTMLElement | null, // 触发器dom
11
11
  defaultMaxHeight?: number;
12
12
  safeAreaMargin?: Margin;
13
13
  }): {
14
- align: "r" | "b" | "br" | "rt" | "tr" | "t" | "l" | "tl" | "bl" | "lt" | "lb" | "rb" | undefined;
14
+ align: "b" | "br" | "rt" | "tr" | "r" | "t" | "l" | "tl" | "bl" | "lt" | "lb" | "rb" | undefined;
15
15
  update: (dom?: HTMLElement | null | undefined) => void;
16
16
  maxHeight: number;
17
17
  };
@@ -1 +0,0 @@
1
- import '@alifd/next/lib/input/style2';
package/es/form/style.js CHANGED
@@ -1 +1,2 @@
1
- import '@alifd/next/lib/input/style2';
1
+ "use strict";
2
+ // 展示 Form demo 所必须的文件