@cloudtower/eagle 490.0.8 → 490.0.9

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 (248) hide show
  1. package/dist/cjs/core/AccordionCard/index.js +4 -1
  2. package/dist/cjs/core/Alert/index.js +4 -2
  3. package/dist/cjs/core/Arch/index.js +5 -3
  4. package/dist/cjs/core/Avatar/index.js +3 -1
  5. package/dist/cjs/core/Banner/index.js +16 -3
  6. package/dist/cjs/core/BasicCTError/index.js +25 -12
  7. package/dist/cjs/core/Bit/index.js +4 -3
  8. package/dist/cjs/core/BitPerSecond/index.js +4 -3
  9. package/dist/cjs/core/BlankState/index.js +14 -12
  10. package/dist/cjs/core/Bps/index.js +4 -3
  11. package/dist/cjs/core/Breadcrumb/index.js +4 -1
  12. package/dist/cjs/core/ButtonGroup/index.js +3 -1
  13. package/dist/cjs/core/Byte/index.js +6 -5
  14. package/dist/cjs/core/BytePerSecond/index.js +4 -3
  15. package/dist/cjs/core/Card/index.js +7 -3
  16. package/dist/cjs/core/Checkbox/index.js +1 -1
  17. package/dist/cjs/core/ConfigProvider/index.js +1 -1
  18. package/dist/cjs/core/DetailCard/index.js +7 -3
  19. package/dist/cjs/core/DonutChart/index.js +3 -1
  20. package/dist/cjs/core/DropdownMenu/index.js +9 -4
  21. package/dist/cjs/core/Duration/index.js +7 -6
  22. package/dist/cjs/core/Empty/index.js +6 -3
  23. package/dist/cjs/core/Error/index.js +4 -1
  24. package/dist/cjs/core/FailedLoad/index.js +4 -1
  25. package/dist/cjs/core/Fields/FieldsBoolean/index.js +11 -2
  26. package/dist/cjs/core/Fields/FieldsDateTime/index.js +5 -1
  27. package/dist/cjs/core/Fields/FieldsDateTimeRange/index.js +6 -3
  28. package/dist/cjs/core/Fields/FieldsEnum/index.js +5 -3
  29. package/dist/cjs/core/Fields/FieldsFloat/index.js +6 -3
  30. package/dist/cjs/core/Fields/FieldsInt/index.js +6 -3
  31. package/dist/cjs/core/Fields/FieldsInteger/index.js +6 -3
  32. package/dist/cjs/core/Fields/FieldsString/index.js +14 -4
  33. package/dist/cjs/core/Fields/FieldsTextArea/index.js +6 -3
  34. package/dist/cjs/core/Fields/FieldsTimePicker/index.js +7 -4
  35. package/dist/cjs/core/FormItem/index.js +15 -1
  36. package/dist/cjs/core/Frequency/index.js +4 -3
  37. package/dist/cjs/core/ImmersiveDialog/index.js +15 -4
  38. package/dist/cjs/core/Input/index.js +15 -3
  39. package/dist/cjs/core/InputInteger/index.js +15 -3
  40. package/dist/cjs/core/InputNumber/index.js +15 -3
  41. package/dist/cjs/core/InputPassword/index.js +15 -3
  42. package/dist/cjs/core/LegacySelect/index.js +18 -4
  43. package/dist/cjs/core/LineChart/index.js +2 -0
  44. package/dist/cjs/core/LocalUpload/LocalUpload.js +45 -32
  45. package/dist/cjs/core/Metric/index.js +3 -1
  46. package/dist/cjs/core/Nav/index.js +5 -2
  47. package/dist/cjs/core/Pagination/index.js +7 -1
  48. package/dist/cjs/core/Percent/index.js +4 -3
  49. package/dist/cjs/core/Progress/index.js +5 -3
  50. package/dist/cjs/core/Radio/index.js +15 -7
  51. package/dist/cjs/core/Second/index.js +4 -2
  52. package/dist/cjs/core/SimplePagination/index.js +7 -1
  53. package/dist/cjs/core/SmallDialog/SmallDialog.js +10 -4
  54. package/dist/cjs/core/SmallDialog/SmallDialog.widget.js +1 -1
  55. package/dist/cjs/core/Speed/index.js +4 -3
  56. package/dist/cjs/core/StepProgress/index.js +3 -1
  57. package/dist/cjs/core/Switch/index.js +5 -3
  58. package/dist/cjs/core/Tab/Tab.js +8 -3
  59. package/dist/cjs/core/Table/index.js +4 -2
  60. package/dist/cjs/core/TextArea/index.js +21 -3
  61. package/dist/cjs/core/Time/index.js +9 -8
  62. package/dist/cjs/core/TimePicker/index.js +1 -9
  63. package/dist/cjs/core/TimeZoneSelect/index.js +3 -1
  64. package/dist/cjs/core/Timeline/index.js +74 -59
  65. package/dist/cjs/core/Truncate/index.js +3 -1
  66. package/dist/cjs/core/WizardDialog/index.js +9 -4
  67. package/dist/cjs/coreX/BarChart/index.js +2 -2
  68. package/dist/cjs/coreX/CheckPointList/index.js +2 -2
  69. package/dist/cjs/coreX/Dialogs/DeleteDialog/DeleteDialog.js +1 -1
  70. package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
  71. package/dist/cjs/hooks/useAntdPatchEnLocales.js +1 -1
  72. package/dist/cjs/hooks/useCTErrorMsg.js +3 -3
  73. package/dist/cjs/stats1.html +1 -1
  74. package/dist/components.css +3578 -3578
  75. package/dist/esm/core/AccordionCard/index.js +4 -1
  76. package/dist/esm/core/Alert/index.js +4 -2
  77. package/dist/esm/core/Arch/index.js +5 -3
  78. package/dist/esm/core/Avatar/index.js +3 -1
  79. package/dist/esm/core/Banner/index.js +16 -3
  80. package/dist/esm/core/BasicCTError/index.js +25 -12
  81. package/dist/esm/core/Bit/index.js +4 -3
  82. package/dist/esm/core/BitPerSecond/index.js +4 -3
  83. package/dist/esm/core/BlankState/index.js +14 -12
  84. package/dist/esm/core/Bps/index.js +4 -3
  85. package/dist/esm/core/Breadcrumb/index.js +4 -1
  86. package/dist/esm/core/ButtonGroup/index.js +3 -1
  87. package/dist/esm/core/Byte/index.js +6 -5
  88. package/dist/esm/core/BytePerSecond/index.js +4 -3
  89. package/dist/esm/core/Card/index.js +7 -3
  90. package/dist/esm/core/Checkbox/index.js +1 -1
  91. package/dist/esm/core/ConfigProvider/index.js +1 -1
  92. package/dist/esm/core/DetailCard/index.js +7 -3
  93. package/dist/esm/core/DonutChart/index.js +3 -1
  94. package/dist/esm/core/DropdownMenu/index.js +9 -4
  95. package/dist/esm/core/Duration/index.js +7 -6
  96. package/dist/esm/core/Empty/index.js +6 -3
  97. package/dist/esm/core/Error/index.js +4 -1
  98. package/dist/esm/core/FailedLoad/index.js +4 -1
  99. package/dist/esm/core/Fields/FieldsBoolean/index.js +11 -2
  100. package/dist/esm/core/Fields/FieldsDateTime/index.js +5 -1
  101. package/dist/esm/core/Fields/FieldsDateTimeRange/index.js +6 -3
  102. package/dist/esm/core/Fields/FieldsEnum/index.js +5 -3
  103. package/dist/esm/core/Fields/FieldsFloat/index.js +6 -3
  104. package/dist/esm/core/Fields/FieldsInt/index.js +6 -3
  105. package/dist/esm/core/Fields/FieldsInteger/index.js +6 -3
  106. package/dist/esm/core/Fields/FieldsString/index.js +14 -4
  107. package/dist/esm/core/Fields/FieldsTextArea/index.js +6 -3
  108. package/dist/esm/core/Fields/FieldsTimePicker/index.js +7 -4
  109. package/dist/esm/core/FormItem/index.js +15 -1
  110. package/dist/esm/core/Frequency/index.js +4 -3
  111. package/dist/esm/core/ImmersiveDialog/index.js +17 -6
  112. package/dist/esm/core/Input/index.js +15 -3
  113. package/dist/esm/core/InputInteger/index.js +15 -3
  114. package/dist/esm/core/InputNumber/index.js +15 -3
  115. package/dist/esm/core/InputPassword/index.js +15 -3
  116. package/dist/esm/core/LegacySelect/index.js +18 -4
  117. package/dist/esm/core/LineChart/index.js +2 -0
  118. package/dist/esm/core/LocalUpload/LocalUpload.js +45 -32
  119. package/dist/esm/core/Metric/index.js +3 -1
  120. package/dist/esm/core/Nav/index.js +5 -2
  121. package/dist/esm/core/Pagination/index.js +7 -1
  122. package/dist/esm/core/Percent/index.js +4 -3
  123. package/dist/esm/core/Progress/index.js +5 -3
  124. package/dist/esm/core/Radio/index.js +15 -7
  125. package/dist/esm/core/Second/index.js +4 -2
  126. package/dist/esm/core/SimplePagination/index.js +7 -1
  127. package/dist/esm/core/SmallDialog/SmallDialog.js +10 -4
  128. package/dist/esm/core/SmallDialog/SmallDialog.widget.js +1 -1
  129. package/dist/esm/core/Speed/index.js +4 -3
  130. package/dist/esm/core/StepProgress/index.js +3 -1
  131. package/dist/esm/core/Switch/index.js +5 -3
  132. package/dist/esm/core/Tab/Tab.js +8 -3
  133. package/dist/esm/core/Table/index.js +4 -2
  134. package/dist/esm/core/TextArea/index.js +21 -3
  135. package/dist/esm/core/Time/index.js +9 -8
  136. package/dist/esm/core/TimePicker/index.js +1 -9
  137. package/dist/esm/core/TimeZoneSelect/index.js +3 -1
  138. package/dist/esm/core/Timeline/index.js +74 -59
  139. package/dist/esm/core/Truncate/index.js +3 -1
  140. package/dist/esm/core/WizardDialog/index.js +9 -4
  141. package/dist/esm/coreX/BarChart/index.js +1 -1
  142. package/dist/esm/coreX/CheckPointList/index.js +1 -1
  143. package/dist/esm/coreX/Dialogs/DeleteDialog/DeleteDialog.js +1 -1
  144. package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
  145. package/dist/esm/hooks/useAntdPatchEnLocales.js +1 -1
  146. package/dist/esm/hooks/useCTErrorMsg.js +3 -3
  147. package/dist/esm/stats1.html +1 -1
  148. package/dist/linaria.merged.scss +4680 -4680
  149. package/dist/src/core/AccordionCard/accordionCard.type.d.ts +1 -0
  150. package/dist/src/core/Alert/alert.type.d.ts +1 -0
  151. package/dist/src/core/Antd5Flex/index.d.ts +1 -1
  152. package/dist/src/core/Arch/arch.type.d.ts +1 -0
  153. package/dist/src/core/AutoComplete/AutoComplete.d.ts +4 -1
  154. package/dist/src/core/Avatar/avatar.type.d.ts +1 -0
  155. package/dist/src/core/Banner/banner.types.d.ts +2 -1
  156. package/dist/src/core/BasicCTError/BasicCTError.type.d.ts +8 -2
  157. package/dist/src/core/BlankState/index.d.ts +1 -1
  158. package/dist/src/core/BlankState/type.d.ts +1 -0
  159. package/dist/src/core/Breadcrumb/breadcrumb.type.d.ts +2 -0
  160. package/dist/src/core/Button/button.type.d.ts +1 -0
  161. package/dist/src/core/Card/index.d.ts +8 -0
  162. package/dist/src/core/Cascader/cascader.type.d.ts +2 -0
  163. package/dist/src/core/Checkbox/index.d.ts +1 -1
  164. package/dist/src/core/DetailCard/detailCard.type.d.ts +1 -0
  165. package/dist/src/core/DonutChart/index.d.ts +1 -0
  166. package/dist/src/core/DropdownMenu/dropdownMenu.type.d.ts +2 -0
  167. package/dist/src/core/DropdownMenu/index.d.ts +1 -0
  168. package/dist/src/core/Duration/duration.type.d.ts +11 -3
  169. package/dist/src/core/Empty/index.d.ts +2 -1
  170. package/dist/src/core/Error/index.d.ts +2 -1
  171. package/dist/src/core/FailedLoad/index.d.ts +1 -0
  172. package/dist/src/core/Fields/FieldsBoolean/index.d.ts +1 -1
  173. package/dist/src/core/Fields/FieldsDateTime/index.d.ts +1 -1
  174. package/dist/src/core/Fields/FieldsEnum/fieldsEnum.type.d.ts +1 -0
  175. package/dist/src/core/Fields/FieldsEnum/index.d.ts +1 -1
  176. package/dist/src/core/Fields/FieldsFloat/index.d.ts +1 -1
  177. package/dist/src/core/Fields/FieldsInt/index.d.ts +1 -1
  178. package/dist/src/core/Fields/FieldsInteger/index.d.ts +1 -1
  179. package/dist/src/core/Fields/FieldsString/index.d.ts +1 -1
  180. package/dist/src/core/Fields/FieldsTextArea/index.d.ts +1 -1
  181. package/dist/src/core/Fields/FieldsTimePicker/index.d.ts +1 -1
  182. package/dist/src/core/Fields/__test__/data-testid.test.d.ts +1 -0
  183. package/dist/src/core/Fields/fields.type.d.ts +2 -1
  184. package/dist/src/core/Fields/index.d.ts +13 -9
  185. package/dist/src/core/FormItem/index.d.ts +3 -1
  186. package/dist/src/core/ImmersiveDialog/type.d.ts +5 -0
  187. package/dist/src/core/Input/input.type.d.ts +5 -0
  188. package/dist/src/core/InputPassword/index.d.ts +7 -2
  189. package/dist/src/core/LegacySelect/select.type.d.ts +1 -0
  190. package/dist/src/core/Legend/legend.type.d.ts +2 -0
  191. package/dist/src/core/LineChart/type.d.ts +4 -0
  192. package/dist/src/core/LocalUpload/LocalUpload.type.d.ts +4 -0
  193. package/dist/src/core/Metric/index.d.ts +1 -0
  194. package/dist/src/core/Nav/nav.type.d.ts +2 -0
  195. package/dist/src/core/Pagination/pagination.type.d.ts +1 -0
  196. package/dist/src/core/Progress/progress.type.d.ts +4 -0
  197. package/dist/src/core/Radio/index.d.ts +3 -1
  198. package/dist/src/core/Radio/radio.type.d.ts +2 -0
  199. package/dist/src/core/SearchInput/SearchInput.type.d.ts +4 -0
  200. package/dist/src/core/SegmentControl/segmentControl.type.d.ts +2 -0
  201. package/dist/src/core/SimplePagination/simplePagination.type.d.ts +1 -0
  202. package/dist/src/core/SmallDialog/SmallDialog.type.d.ts +5 -0
  203. package/dist/src/core/SmallDialog/index.d.ts +1 -1
  204. package/dist/src/core/StepProgress/stepProgress.type.d.ts +1 -0
  205. package/dist/src/core/Steps/steps.type.d.ts +1 -0
  206. package/dist/src/core/Switch/switch.type.d.ts +1 -0
  207. package/dist/src/core/Tab/Tab.type.d.ts +4 -0
  208. package/dist/src/core/Table/table.type.d.ts +6 -2
  209. package/dist/src/core/TextArea/textArea.type.d.ts +1 -0
  210. package/dist/src/core/Time/index.d.ts +1 -1
  211. package/dist/src/core/Time/time.type.d.ts +5 -0
  212. package/dist/src/core/TimePicker/index.d.ts +2 -0
  213. package/dist/src/core/TimeZoneSelect/timeZoneSelect.type.d.ts +1 -0
  214. package/dist/src/core/Timeline/Timeline.type.d.ts +2 -0
  215. package/dist/src/core/Timeline/index.d.ts +1 -1
  216. package/dist/src/core/Truncate/index.d.ts +1 -0
  217. package/dist/src/core/Units/units.type.d.ts +10 -0
  218. package/dist/src/core/WizardDialog/type.d.ts +2 -0
  219. package/dist/src/core/__test__/data-testid.test.d.ts +1 -0
  220. package/dist/src/coreX/CheckPointList/checkpointlist.type.d.ts +1 -1
  221. package/dist/src/coreX/index.d.ts +1 -1
  222. package/dist/src/utils/index.d.ts +2 -2
  223. package/dist/stories/docs/core/Alert.stories.d.ts +1 -0
  224. package/dist/stories/docs/core/Arch.stories.d.ts +3 -0
  225. package/dist/stories/docs/core/AutoComplete.stories.d.ts +3 -1
  226. package/dist/stories/docs/core/Banner.stories.d.ts +2 -2
  227. package/dist/stories/docs/core/BasicCTError.stories.d.ts +1 -1
  228. package/dist/stories/docs/core/Bit.stories.d.ts +3 -0
  229. package/dist/stories/docs/core/BitPerSecond.stories.d.ts +3 -0
  230. package/dist/stories/docs/core/BlankState.stories.d.ts +1 -1
  231. package/dist/stories/docs/core/Bps.stories.d.ts +3 -0
  232. package/dist/stories/docs/core/Byte.stories.d.ts +3 -0
  233. package/dist/stories/docs/core/BytePerSecond.stories.d.ts +3 -0
  234. package/dist/stories/docs/core/Card.stories.d.ts +1 -0
  235. package/dist/stories/docs/core/FieldsBoolean.stories.d.ts +2 -0
  236. package/dist/stories/docs/core/FieldsString.stories.d.ts +4 -0
  237. package/dist/stories/docs/core/FieldsTimePicker.stories.d.ts +2 -0
  238. package/dist/stories/docs/core/Frequency.stories.d.ts +3 -0
  239. package/dist/stories/docs/core/ImmersiveDialog.stories.d.ts +1 -0
  240. package/dist/stories/docs/core/InputPassword.stories.d.ts +1 -3
  241. package/dist/stories/docs/core/Percent.stories.d.ts +5 -0
  242. package/dist/stories/docs/core/Speed.stories.d.ts +3 -0
  243. package/dist/stories/docs/core/Table.stories.d.ts +1 -1
  244. package/dist/stories/docs/core/Timeline.stories.d.ts +1 -1
  245. package/dist/stories/docs/core/WizardDialog.stories.d.ts +2 -0
  246. package/dist/stories/docs/coreX/KubeConfigModal.stories.d.ts +1 -1
  247. package/dist/style.css +3578 -3578
  248. package/package.json +4 -4
@@ -6,4 +6,5 @@ export interface IAccordionCardProps {
6
6
  defaultExpand?: boolean;
7
7
  mountOnEnter?: boolean;
8
8
  unmountOnExit?: boolean;
9
+ "data-testid"?: string;
9
10
  }
@@ -3,5 +3,6 @@ import { AlertProps as AntdAlertProps } from "antd/lib/alert";
3
3
  export type AlertProps = Omit<AntdAlertProps, "type"> & {
4
4
  type?: AntdAlertProps["type"] | "normal";
5
5
  action?: React.ReactNode;
6
+ "data-testid"?: string;
6
7
  };
7
8
  export type AlertComponentType = React.FunctionComponent<AlertProps>;
@@ -1,2 +1,2 @@
1
- export { Flex as Antd5Flex } from "antd5";
2
1
  export type { FlexProps as Antd5FlexProps } from "antd5";
2
+ export { Flex as Antd5Flex } from "antd5";
@@ -5,4 +5,5 @@ export declare enum Architecture {
5
5
  }
6
6
  export type ArchComponentType = React.FC<{
7
7
  architecture?: Architecture;
8
+ "data-testid"?: string;
8
9
  }>;
@@ -1,3 +1,6 @@
1
1
  import { AutoCompleteProps } from "antd5";
2
2
  import React from "react";
3
- export declare const AutoComplete: React.FC<AutoCompleteProps>;
3
+ export declare const AutoComplete: React.FC<AutoCompleteProps & {
4
+ /** Test ID for automated testing */
5
+ "data-testid"?: string;
6
+ }>;
@@ -8,4 +8,5 @@ export type AvatarProps = {
8
8
  * 背景色
9
9
  */
10
10
  background?: "light-blue" | "dark-blue";
11
+ "data-testid"?: string;
11
12
  };
@@ -18,9 +18,10 @@ import { ButtonProps } from "../Button";
18
18
  * }
19
19
  * }
20
20
  */
21
- export type BannerProps = HTMLAttributes<"DIV"> & {
21
+ export type BannerProps = HTMLAttributes<HTMLDivElement> & {
22
22
  type: "error" | "info" | "warning";
23
23
  message: string;
24
+ "data-testid"?: string;
24
25
  btnProps?: Pick<ButtonProps, "onClick"> & {
25
26
  text: string;
26
27
  hide?: boolean;
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import { CTError } from "../../utils/cterror";
3
1
  import { UseCTErrorMsgOptions } from "../../hooks/useCTErrorMsg";
2
+ import { CTError } from "../../utils/cterror";
3
+ import React from "react";
4
4
  /**
5
5
  * 错误详情渲染器的 props
6
6
  */
@@ -20,6 +20,8 @@ export interface ErrorContainerRenderProps {
20
20
  children?: React.ReactNode;
21
21
  /** 错误信息 */
22
22
  errorMsgs: (string | undefined)[];
23
+ /** 测试标识符 */
24
+ "data-testid"?: string;
23
25
  }
24
26
  /**
25
27
  * BasicCTError 组件的 props
@@ -53,4 +55,8 @@ export interface BasicCTErrorProps {
53
55
  * 用于配置国际化命名空间和其他翻译选项
54
56
  */
55
57
  errorMsgOptions?: UseCTErrorMsgOptions;
58
+ /**
59
+ * 测试标识符,用于自动化测试定位元素
60
+ */
61
+ "data-testid"?: string;
56
62
  }
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { IBlankStateProps } from "./type";
3
- declare const BlankState: (props: IBlankStateProps) => React.JSX.Element;
3
+ declare const BlankState: ({ className, style, width, height, title, description, action, backgroundColor, size, "data-testid": dataTestId, }: IBlankStateProps) => React.JSX.Element;
4
4
  export default BlankState;
@@ -46,4 +46,5 @@ export interface IBlankStateProps {
46
46
  */
47
47
  onClick: () => void;
48
48
  };
49
+ "data-testid"?: string;
49
50
  }
@@ -4,8 +4,10 @@ export interface BreadcrumbLink {
4
4
  id?: string;
5
5
  resource: string;
6
6
  tab?: string;
7
+ "data-testid"?: string;
7
8
  onClick: React.MouseEventHandler<HTMLSpanElement>;
8
9
  }
9
10
  export interface IBreadcrumbProps {
10
11
  items: BreadcrumbLink[];
12
+ "data-testid"?: string;
11
13
  }
@@ -10,6 +10,7 @@ export type ButtonProps = {
10
10
  } & Omit<AntdButtonProps, "type" | "icon">;
11
11
  export type ButtonGroupType = {
12
12
  className?: string;
13
+ "data-testid"?: string;
13
14
  size?: SizeType;
14
15
  options: Array<Omit<ButtonProps, "shape" | "size" | "icon"> & {
15
16
  key: string;
@@ -7,6 +7,10 @@ export type CardProps = {
7
7
  className?: string;
8
8
  hoverable?: boolean;
9
9
  shadow?: boolean;
10
+ /**
11
+ * 用于测试的标识符,会传递到卡片根容器元素。
12
+ */
13
+ "data-testid"?: string;
10
14
  } & React.DOMAttributes<HTMLDivElement>;
11
15
  declare const Card: React.ForwardRefExoticComponent<{
12
16
  collapsible?: boolean | undefined;
@@ -16,6 +20,10 @@ declare const Card: React.ForwardRefExoticComponent<{
16
20
  className?: string | undefined;
17
21
  hoverable?: boolean | undefined;
18
22
  shadow?: boolean | undefined;
23
+ /**
24
+ * 用于测试的标识符,会传递到卡片根容器元素。
25
+ */
26
+ "data-testid"?: string | undefined;
19
27
  } & React.DOMAttributes<HTMLDivElement> & {
20
28
  children?: React.ReactNode;
21
29
  } & React.RefAttributes<HTMLDivElement>>;
@@ -16,6 +16,8 @@ export type PresetCascaderRenderProps = {
16
16
  };
17
17
  };
18
18
  export type CascaderProps = Antd5CascaderProps & {
19
+ /** Test ID for automated testing */
20
+ "data-testid"?: string;
19
21
  /**
20
22
  * 自定义下拉菜单内容,具体可以参考[antd5](https://ant.design/components/cascader-cn/#API)
21
23
  * 注意:如果需要自定义下拉菜单,会覆盖掉已有的 header / footer 表现。
@@ -3,6 +3,6 @@ import React, { ReactNode } from "react";
3
3
  declare const Checkbox: React.FC<CheckboxProps & {
4
4
  description?: ReactNode;
5
5
  compact?: boolean;
6
- "data-test"?: string;
6
+ "data-testid"?: string;
7
7
  }>;
8
8
  export default Checkbox;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export interface IDetailCardProps {
3
3
  title?: React.ReactNode;
4
+ "data-testid"?: string;
4
5
  }
@@ -8,6 +8,7 @@ export declare enum DonutChartColor {
8
8
  PURPLE = "purple"
9
9
  }
10
10
  export type IDonutChartProps = {
11
+ "data-testid"?: string;
11
12
  /**
12
13
  * 默认支持单色系展示,如果是单色系直接传入颜色类型
13
14
  */
@@ -9,6 +9,7 @@ export interface IDropDownMenuItem {
9
9
  onClick?: () => void;
10
10
  danger?: boolean;
11
11
  tooltip?: string;
12
+ "data-testid"?: string;
12
13
  }
13
14
  export type Placement = "topLeft" | "topCenter" | "topRight" | "bottomLeft" | "bottomCenter" | "bottomRight";
14
15
  export interface IDropdownMenuProps {
@@ -25,4 +26,5 @@ export interface IDropdownMenuProps {
25
26
  slotsElements: {
26
27
  trigger?: (args: object) => string | React.ReactNode;
27
28
  };
29
+ "data-testid"?: string;
28
30
  }
@@ -10,6 +10,7 @@ interface IItem {
10
10
  onClick?: () => void;
11
11
  danger?: boolean;
12
12
  tooltip?: string;
13
+ "data-testid"?: string;
13
14
  }
14
15
  export declare const RenderMenuItem: (item: IItem & {
15
16
  title?: string;
@@ -4,6 +4,11 @@ import { DurationUnitType, FormatDurationItem } from "../../utils/formatDuration
4
4
  import { RawValue } from "../Units/units.type";
5
5
  /**
6
6
  * Duration 组件的属性类型
7
+ *
8
+ * data-testid 在空态(Empty)和 noUnitOnZero 分支生效。
9
+ * 默认渲染分支(多单位拼接)和 contentRender 分支返回 Fragment,不支持 data-testid。
10
+ * 需要 data-testid 时,请在 Duration 外层自行包一层 wrapper 并设置 data-testid。
11
+ * 使用 contentRender 时,也可在 contentRender 返回的根元素上自行设置 data-testid。
7
12
  */
8
13
  export interface DurationProps extends Omit<RawValue, "decimals"> {
9
14
  /**
@@ -25,13 +30,15 @@ export interface DurationProps extends Omit<RawValue, "decimals"> {
25
30
  */
26
31
  emptyProps?: IEmptyProps;
27
32
  /**
28
- * 自定义返回结果的渲染
29
- * 当提供此函数时,将使用自定义渲染函数来渲染持续时间,而不是使用默认的渲染方式
33
+ * 自定义返回结果的渲染。
34
+ * 当提供此函数时,将使用自定义渲染函数来渲染持续时间,而不是使用默认的渲染方式。
35
+ * 注意:使用 contentRender 时,组件不会透传 data-testid,
36
+ * 调用方需要在返回的根元素上自行设置 data-testid。
30
37
  * @param parts 格式化后的持续时间数组,每个元素包含 value 和 unit
31
38
  * @returns 自定义的 React 节点
32
39
  * @example
33
40
  * contentRender={(parts) => (
34
- * <div>
41
+ * <div data-testid="my-duration">
35
42
  * {parts.map((part, i) => (
36
43
  * <span key={i}>{part.value} {part.unit}</span>
37
44
  * ))}
@@ -39,4 +46,5 @@ export interface DurationProps extends Omit<RawValue, "decimals"> {
39
46
  * )}
40
47
  */
41
48
  contentRender?: (parts: FormatDurationItem[]) => React.ReactNode;
49
+ "data-testid"?: string;
42
50
  }
@@ -1,7 +1,8 @@
1
1
  import React, { CSSProperties } from "react";
2
2
  export interface IEmptyProps {
3
+ "data-testid"?: string;
3
4
  className?: string;
4
5
  style?: CSSProperties;
5
6
  }
6
- declare const Empty: (props: IEmptyProps) => React.JSX.Element;
7
+ declare const Empty: ({ className, style, "data-testid": dataTestId, }: IEmptyProps) => React.JSX.Element;
7
8
  export default Empty;
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- declare const Error: ({ error }: {
2
+ declare const Error: ({ error, "data-testid": dataTestId, }: {
3
3
  error: unknown;
4
+ "data-testid"?: string | undefined;
4
5
  }) => React.JSX.Element;
5
6
  export default Error;
@@ -5,5 +5,6 @@ declare const FailedLoad: React.FC<{
5
5
  refetchText?: string;
6
6
  className?: string;
7
7
  title?: string;
8
+ "data-testid"?: string;
8
9
  }>;
9
10
  export default FailedLoad;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { FieldBaseProps } from "../fields.type";
3
- declare const FieldsBoolean: ({ input, children, ...props }: FieldBaseProps) => React.JSX.Element;
3
+ declare const FieldsBoolean: ({ input, children, "data-testid": dataTestId, ...props }: FieldBaseProps) => React.JSX.Element;
4
4
  export default FieldsBoolean;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { FieldBaseProps } from "../fields.type";
3
- declare const FieldsDateTime: ({ input }: FieldBaseProps) => React.JSX.Element;
3
+ declare const FieldsDateTime: ({ input, "data-testid": dataTestId, }: FieldBaseProps) => React.JSX.Element;
4
4
  export default FieldsDateTime;
@@ -16,4 +16,5 @@ export type EnumProps<V = any, T extends HTMLElement = HTMLElement> = {
16
16
  disabled?: boolean;
17
17
  className?: string;
18
18
  dropdownClassName?: string;
19
+ "data-testid"?: string;
19
20
  } & BaseEnumProps;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import { EnumProps } from "./fieldsEnum.type";
3
- declare const FieldsEnum: ({ meta: __, enumValues, emptyLabel, ...restProps }: EnumProps) => React.JSX.Element;
3
+ declare const FieldsEnum: ({ meta: __, enumValues, emptyLabel, "data-testid": dataTestId, ...restProps }: EnumProps) => React.JSX.Element;
4
4
  export default FieldsEnum;
5
5
  export * from "./fieldsEnum.type";
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { FloatFieldProps } from "../../../spec";
3
- declare const FieldsFloat: ({ input, meta, onBlur, autoComplete, ...props }: FloatFieldProps) => React.JSX.Element;
3
+ declare const FieldsFloat: ({ input, meta, onBlur, autoComplete, "data-testid": dataTestId, ...props }: FloatFieldProps) => React.JSX.Element;
4
4
  export default FieldsFloat;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import { IntFieldProps } from "./fieldsInt.type";
3
- declare const FieldsInt: ({ input, meta, onBlur, autoComplete, supportNegativeValue, ...props }: IntFieldProps) => React.JSX.Element;
3
+ declare const FieldsInt: ({ input, meta, onBlur, autoComplete, supportNegativeValue, "data-testid": dataTestId, ...props }: IntFieldProps) => React.JSX.Element;
4
4
  export default FieldsInt;
5
5
  export * from "./fieldsInt.type";
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { IntegerFieldProps } from "../../../spec";
3
- declare const FieldsInteger: ({ meta, input, onBlur, ...props }: IntegerFieldProps) => React.JSX.Element;
3
+ declare const FieldsInteger: ({ meta, input, onBlur, "data-testid": dataTestId, ...props }: IntegerFieldProps) => React.JSX.Element;
4
4
  export default FieldsInteger;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { FieldBaseProps } from "../fields.type";
3
3
  import { StringProps } from "./fieldsString.type";
4
- declare const FieldsString: ({ input, meta, autoComplete, size, tags, className, allowClear, tagsOverflow, onTagsAllowClearClick, onClick, maxLength, focusIndicator, ...props }: FieldBaseProps & StringProps) => React.JSX.Element;
4
+ declare const FieldsString: ({ input, meta, autoComplete, size, tags, className, allowClear, tagsOverflow, onTagsAllowClearClick, onClick, maxLength, focusIndicator, "data-testid": dataTestId, ...props }: FieldBaseProps & StringProps) => React.JSX.Element;
5
5
  export default FieldsString;
6
6
  export * from "./fieldsString.type";
@@ -1,5 +1,5 @@
1
1
  import { TextAreaProps } from "antd/lib/input";
2
2
  import React from "react";
3
3
  import { FieldBaseProps } from "../fields.type";
4
- declare const FieldsTextArea: ({ input, meta, onFocusChangeHeight, ...props }: FieldBaseProps & TextAreaProps) => React.JSX.Element;
4
+ declare const FieldsTextArea: ({ input, meta, onFocusChangeHeight, "data-testid": dataTestId, ...props }: FieldBaseProps & TextAreaProps) => React.JSX.Element;
5
5
  export default FieldsTextArea;
@@ -1,5 +1,5 @@
1
1
  import { TimePickerProps } from "antd/lib/time-picker";
2
2
  import React from "react";
3
3
  import { FieldBaseProps } from "../fields.type";
4
- declare const FieldsTimePicker: ({ input, meta, ...props }: FieldBaseProps & TimePickerProps) => React.JSX.Element;
4
+ declare const FieldsTimePicker: ({ input, meta, "data-testid": dataTestId, ...props }: FieldBaseProps & TimePickerProps) => React.JSX.Element;
5
5
  export default FieldsTimePicker;
@@ -29,7 +29,7 @@ export interface FieldState<FieldValue> {
29
29
  visited?: boolean;
30
30
  }
31
31
  export type FieldMetaState<FieldValue> = Pick<FieldState<FieldValue>, Exclude<keyof FieldState<FieldValue>, "blur" | "change" | "focus" | "name" | "value">>;
32
- interface FieldInputProps<FieldValue, T extends HTMLElement = HTMLElement> extends AnyObject {
32
+ export interface FieldInputProps<FieldValue, T extends HTMLElement = HTMLElement> extends AnyObject {
33
33
  name: string;
34
34
  onBlur: (event?: React.FocusEvent<T>) => void;
35
35
  onChange: (event: React.ChangeEvent<T> | any) => void;
@@ -47,5 +47,6 @@ export interface FieldRenderProps<FieldValue, T extends HTMLElement = HTMLElemen
47
47
  export type FieldBaseProps<V = any, T extends HTMLElement = HTMLElement> = FieldRenderProps<V, T> & {
48
48
  disabled?: boolean;
49
49
  className?: string;
50
+ "data-testid"?: string;
50
51
  };
51
52
  export {};
@@ -1,26 +1,30 @@
1
1
  /// <reference types="react" />
2
2
  declare const fields: {
3
- Int: ({ input, meta, onBlur, autoComplete, supportNegativeValue, ...props }: import("./FieldsInt").IntFieldProps) => import("react").JSX.Element;
4
- Integer: ({ meta, input, onBlur, ...props }: import("../..").IntegerFieldProps) => import("react").JSX.Element;
5
- Float: ({ input, meta, onBlur, autoComplete, ...props }: import("../..").FloatFieldProps) => import("react").JSX.Element;
6
- DateTime: ({ input }: import("./fields.type").FieldBaseProps) => import("react").JSX.Element;
7
- TimePicker: ({ input, meta, ...props }: import("./fields.type").FieldRenderProps<any, HTMLElement> & {
3
+ Int: ({ input, meta, onBlur, autoComplete, supportNegativeValue, "data-testid": dataTestId, ...props }: import("./FieldsInt").IntFieldProps) => import("react").JSX.Element;
4
+ Integer: ({ meta, input, onBlur, "data-testid": dataTestId, ...props }: import("../..").IntegerFieldProps) => import("react").JSX.Element;
5
+ Float: ({ input, meta, onBlur, autoComplete, "data-testid": dataTestId, ...props }: import("../..").FloatFieldProps) => import("react").JSX.Element;
6
+ DateTime: ({ input, "data-testid": dataTestId, }: import("./fields.type").FieldBaseProps) => import("react").JSX.Element;
7
+ TimePicker: ({ input, meta, "data-testid": dataTestId, ...props }: import("./fields.type").FieldRenderProps<any, HTMLElement> & {
8
8
  disabled?: boolean | undefined;
9
9
  className?: string | undefined;
10
+ "data-testid"?: string | undefined;
10
11
  } & import("antd/lib/time-picker").TimePickerProps) => import("react").JSX.Element;
11
- Enum: ({ meta: __, enumValues, emptyLabel, ...restProps }: import("./FieldsEnum").EnumProps) => import("react").JSX.Element;
12
- String: ({ input, meta, autoComplete, size, tags, className, allowClear, tagsOverflow, onTagsAllowClearClick, onClick, maxLength, focusIndicator, ...props }: import("./fields.type").FieldRenderProps<any, HTMLElement> & {
12
+ Enum: ({ meta: __, enumValues, emptyLabel, "data-testid": dataTestId, ...restProps }: import("./FieldsEnum").EnumProps) => import("react").JSX.Element;
13
+ String: ({ input, meta, autoComplete, size, tags, className, allowClear, tagsOverflow, onTagsAllowClearClick, onClick, maxLength, focusIndicator, "data-testid": dataTestId, ...props }: import("./fields.type").FieldRenderProps<any, HTMLElement> & {
13
14
  disabled?: boolean | undefined;
14
15
  className?: string | undefined;
16
+ "data-testid"?: string | undefined;
15
17
  } & import("./FieldsString").StringProps) => import("react").JSX.Element;
16
- Boolean: ({ input, children, ...props }: import("./fields.type").FieldBaseProps) => import("react").JSX.Element;
17
- TextArea: ({ input, meta, onFocusChangeHeight, ...props }: import("./fields.type").FieldRenderProps<any, HTMLElement> & {
18
+ Boolean: ({ input, children, "data-testid": dataTestId, ...props }: import("./fields.type").FieldBaseProps) => import("react").JSX.Element;
19
+ TextArea: ({ input, meta, onFocusChangeHeight, "data-testid": dataTestId, ...props }: import("./fields.type").FieldRenderProps<any, HTMLElement> & {
18
20
  disabled?: boolean | undefined;
19
21
  className?: string | undefined;
22
+ "data-testid"?: string | undefined;
20
23
  } & import("antd/lib/input").TextAreaProps) => import("react").JSX.Element;
21
24
  DateTimeRange: import("react").FC<import("./fields.type").FieldRenderProps<any, HTMLElement> & {
22
25
  disabled?: boolean | undefined;
23
26
  className?: string | undefined;
27
+ "data-testid"?: string | undefined;
24
28
  } & import("antd/lib/date-picker").DatePickerProps>;
25
29
  };
26
30
  export default fields;
@@ -1,4 +1,6 @@
1
1
  import { FormItemProps } from "antd/lib/form";
2
2
  import React from "react";
3
- declare const FormItem: (props: React.PropsWithChildren<FormItemProps>) => React.ReactElement;
3
+ declare const FormItem: (props: React.PropsWithChildren<FormItemProps> & {
4
+ "data-testid"?: string;
5
+ }) => React.ReactElement;
4
6
  export default FormItem;
@@ -148,4 +148,9 @@ export type ImmersiveDialogProps = React.PropsWithChildren<AntdModalProps & {
148
148
  * 失败时设 initializing=false 并设置 initializingError。
149
149
  */
150
150
  initializingError?: string | React.ReactNode;
151
+ /**
152
+ * 测试标识符前缀,用于自动化测试定位元素。
153
+ * 派生子 testid:`${testId}-cancel`、`${testId}-ok`、`${testId}-close`
154
+ */
155
+ "data-testid"?: string;
151
156
  }>;
@@ -12,7 +12,12 @@ export interface AdditionOptions {
12
12
  * 开启 control 后,不会显示 suffix
13
13
  */
14
14
  suffix?: string;
15
+ /**
16
+ * 数据测试 id
17
+ */
18
+ "data-testid"?: string;
15
19
  }
16
20
  export type InputProps = AntdInputProps & {
17
21
  error?: boolean;
22
+ "data-testid"?: string;
18
23
  };
@@ -1,10 +1,15 @@
1
1
  import { PasswordProps } from "antd/lib/input";
2
2
  import React from "react";
3
3
  export declare const AntdPasswordInputStyled: import("@linaria/react").StyledMeta & React.ForwardRefExoticComponent<PasswordProps & React.RefAttributes<unknown>>;
4
- declare const InputPassword: React.FC<PasswordProps & {
4
+ export type InputPasswordProps = PasswordProps & {
5
5
  /**
6
6
  * 使用变量控制是否显示 error 效果
7
7
  */
8
8
  error?: boolean;
9
- }>;
9
+ /**
10
+ * 数据测试 id
11
+ */
12
+ "data-testid"?: string;
13
+ };
14
+ declare const InputPassword: React.FC<InputPasswordProps>;
10
15
  export default InputPassword;
@@ -9,6 +9,7 @@ export type KitLegacySelectProps = {
9
9
  scrollBottomBuffer?: number;
10
10
  onScrollBottom?: () => void;
11
11
  selectLimit?: number;
12
+ "data-testid"?: string;
12
13
  } & AntdSelectProps<string>;
13
14
  export interface LooseFieldRenderProps<V, T extends HTMLElement> {
14
15
  input: {
@@ -22,4 +22,6 @@ export type LegendComponentType = React.FC<{
22
22
  key?: string | number;
23
23
  /** Callback function triggered when the legend item is clicked */
24
24
  onClick?: (e: React.MouseEvent<HTMLDivElement>, key?: string | number) => void;
25
+ /** Test ID for automated testing */
26
+ "data-testid"?: string;
25
27
  }>;
@@ -88,6 +88,10 @@ export interface ILineChartLegend {
88
88
  * @description 用于展示时序数据的折线图组件,支持多种展示模式和交互功能
89
89
  */
90
90
  export type LineChartProps = {
91
+ /**
92
+ * 数据测试 id
93
+ */
94
+ "data-testid"?: string;
91
95
  /**
92
96
  * 图表高度
93
97
  * @default 154
@@ -124,6 +124,10 @@ export type LocalUploadFileInfoProps = {
124
124
  export type LocalUploadProps = {
125
125
  /** 自定义类名 */
126
126
  className?: string;
127
+ /**
128
+ * 数据测试 id
129
+ */
130
+ "data-testid"?: string;
127
131
  /** 标签 */
128
132
  label?: React.ReactNode;
129
133
  /** 描述文本 */
@@ -12,6 +12,7 @@ export type MetricProps = {
12
12
  unit: TimeUnit;
13
13
  } | string;
14
14
  chartProps: Omit<IChartProps, "uuid">;
15
+ "data-testid"?: string;
15
16
  };
16
17
  declare const Metric: (props: MetricProps) => React.JSX.Element;
17
18
  export default Metric;
@@ -14,4 +14,6 @@ export type NavProps = {
14
14
  center?: React.ReactNode[];
15
15
  isScrolled?: boolean;
16
16
  navRef?: React.RefObject<HTMLHeadElement>;
17
+ className?: string;
18
+ "data-testid"?: string;
17
19
  };
@@ -1,4 +1,5 @@
1
1
  export interface PaginationProps {
2
+ "data-testid"?: string;
2
3
  current: number;
3
4
  count: number;
4
5
  size: number;
@@ -82,4 +82,8 @@ export type ProgressProps = {
82
82
  rightBottom?: React.ReactNode;
83
83
  size?: "small" | "large";
84
84
  style?: React.CSSProperties;
85
+ /**
86
+ * 用于测试的标识符,会传递到进度条根容器元素。
87
+ */
88
+ "data-testid"?: string;
85
89
  };
@@ -2,7 +2,9 @@ import { RadioGroupProps as AntdRadioGroupProps } from "antd/lib/radio";
2
2
  import React from "react";
3
3
  import { RadioButtonProps, RadioProps } from "./radio.type";
4
4
  declare const Radio: React.FC<RadioProps>;
5
- declare const RadioGroup: React.FC<AntdRadioGroupProps>;
5
+ declare const RadioGroup: React.FC<AntdRadioGroupProps & {
6
+ "data-testid"?: string;
7
+ }>;
6
8
  declare const RadioButton: React.FC<RadioButtonProps>;
7
9
  export { RadioButton, RadioGroup };
8
10
  export default Radio;
@@ -4,6 +4,7 @@ import { RadioButtonProps as AntdRadioButtonProps } from "antd/lib/radio/radioBu
4
4
  export type RadioProps = AntdRadioProps & {
5
5
  description?: React.ReactNode;
6
6
  compact?: boolean;
7
+ "data-testid"?: string;
7
8
  };
8
9
  export type RadioButtonProps = AntdRadioButtonProps & {
9
10
  type?: "input" | "input-number";
@@ -13,4 +14,5 @@ export type RadioButtonProps = AntdRadioButtonProps & {
13
14
  placeholder?: string;
14
15
  initialValue?: string | number;
15
16
  onInputChange?: (val: number | string | undefined) => void;
17
+ "data-testid"?: string;
16
18
  };
@@ -58,6 +58,10 @@ import { SrcType } from "../BaseIcon";
58
58
  * @see Cascader 级联选择器(内置了 SearchInput 作为搜索区域)
59
59
  */
60
60
  export type SearchInputProps = Omit<InputProps, "value" | "onChange"> & {
61
+ /**
62
+ * 数据测试 id
63
+ */
64
+ "data-testid"?: string;
61
65
  /**
62
66
  * 输入框的值,用于受控模式。
63
67
  * 配置 value 时,需把 debounceWait 设置为 0,否则输入时会有卡顿的问题
@@ -1,4 +1,6 @@
1
1
  import { SegmentedProps as AntdSegmentedProps } from "antd5";
2
2
  export interface ISegmentedControlProps extends Omit<AntdSegmentedProps, "ref"> {
3
3
  size?: "small" | "middle";
4
+ /** Test ID for automated testing */
5
+ "data-testid"?: string;
4
6
  }
@@ -4,4 +4,5 @@ export interface ISimplePaginationProps {
4
4
  count: number;
5
5
  size: number;
6
6
  onPageChange?: (page: number) => void;
7
+ "data-testid"?: string;
7
8
  }
@@ -175,4 +175,9 @@ export interface SmallDialogProps {
175
175
  * @default 2
176
176
  */
177
177
  initializingSkeletonRows?: number;
178
+ /**
179
+ * 测试标识符前缀,用于自动化测试定位元素。
180
+ * 派生子 testid:`${testId}-cancel`(取消按钮)、`${testId}-ok`(确认按钮)、`${testId}-close`(关闭按钮)
181
+ */
182
+ "data-testid"?: string;
178
183
  }
@@ -1,3 +1,3 @@
1
1
  export * from "./SmallDialog";
2
- export * from "./SmallDialog.type";
3
2
  export * from "./SmallDialog.style";
3
+ export * from "./SmallDialog.type";
@@ -2,4 +2,5 @@ export interface ICircleProgressProps {
2
2
  percent: number;
3
3
  color?: string;
4
4
  className?: string;
5
+ "data-testid"?: string;
5
6
  }
@@ -5,6 +5,7 @@ export type StepProps = {
5
5
  title: string;
6
6
  style?: React.CSSProperties;
7
7
  disabled?: boolean;
8
+ "data-testid"?: string;
8
9
  };
9
10
  export type IStepsProps = {
10
11
  className?: string;