@next-bricks/presentational 1.21.9 → 1.21.11

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 (107) hide show
  1. package/dist/bricks.json +1 -1
  2. package/dist/chunks/1614.5ce43617.js +2 -0
  3. package/dist/chunks/1614.5ce43617.js.map +1 -0
  4. package/dist/chunks/{1889.4559a6f7.js → 1889.01e1c38a.js} +2 -2
  5. package/dist/chunks/{1889.4559a6f7.js.map → 1889.01e1c38a.js.map} +1 -1
  6. package/dist/chunks/3171.7708784b.js +2 -0
  7. package/dist/chunks/3171.7708784b.js.map +1 -0
  8. package/dist/chunks/5399.2ab60504.js +2 -0
  9. package/dist/chunks/5399.2ab60504.js.map +1 -0
  10. package/dist/chunks/5552.f77213dd.js +2 -0
  11. package/dist/chunks/5552.f77213dd.js.map +1 -0
  12. package/dist/chunks/7116.05a51bac.js +2 -0
  13. package/dist/chunks/7116.05a51bac.js.map +1 -0
  14. package/dist/chunks/7455.0f5298ce.js +3 -0
  15. package/dist/chunks/7455.0f5298ce.js.LICENSE.txt +11 -0
  16. package/dist/chunks/7455.0f5298ce.js.map +1 -0
  17. package/dist/chunks/948.b8effe9f.js +3 -0
  18. package/dist/chunks/948.b8effe9f.js.map +1 -0
  19. package/dist/chunks/code-wrapper.40655769.js.map +1 -1
  20. package/dist/chunks/{eo-card-item.fbff6f7e.js → eo-card-item.f56c41e5.js} +3 -3
  21. package/dist/chunks/eo-card-item.f56c41e5.js.map +1 -0
  22. package/dist/chunks/eo-carousel-text.d8e8c2c9.js.map +1 -1
  23. package/dist/chunks/{eo-code-block.7efe5647.js → eo-code-block.a7162247.js} +2 -2
  24. package/dist/chunks/eo-code-block.a7162247.js.map +1 -0
  25. package/dist/chunks/eo-code-display.ffd79558.js.map +1 -1
  26. package/dist/chunks/eo-current-time.7cbef918.js.map +1 -1
  27. package/dist/chunks/{eo-descriptions.b8320ca9.js → eo-descriptions.1ab98c43.js} +3 -3
  28. package/dist/chunks/{eo-descriptions.b8320ca9.js.map → eo-descriptions.1ab98c43.js.map} +1 -1
  29. package/dist/chunks/eo-humanize-time.2397ce6e.js.map +1 -1
  30. package/dist/chunks/{eo-info-card-item.0d15cb28.js → eo-info-card-item.e6403b4d.js} +3 -3
  31. package/dist/chunks/eo-info-card-item.e6403b4d.js.map +1 -0
  32. package/dist/chunks/{eo-loading-step.834e0aa3.js → eo-loading-step.259d7985.js} +3 -3
  33. package/dist/chunks/{eo-loading-step.834e0aa3.js.map → eo-loading-step.259d7985.js.map} +1 -1
  34. package/dist/chunks/eo-pagination.16fd816a.js.map +1 -1
  35. package/dist/chunks/eo-statistics-card.410b5416.js.map +1 -1
  36. package/dist/chunks/{main.7a4b0b01.js → main.519bfa38.js} +2 -2
  37. package/dist/chunks/main.519bfa38.js.map +1 -0
  38. package/dist/examples.json +13 -13
  39. package/dist/{index.db5144bf.js → index.71ea98e1.js} +2 -2
  40. package/dist/index.71ea98e1.js.map +1 -0
  41. package/dist/manifest.json +49 -39
  42. package/dist/types.json +2 -2
  43. package/dist-types/card-item/index.d.ts +8 -4
  44. package/dist-types/carousel-text/index.d.ts +1 -1
  45. package/dist-types/code-block/index.d.ts +12 -3
  46. package/dist-types/code-display/index.d.ts +0 -1
  47. package/dist-types/code-wrapper/index.d.ts +7 -2
  48. package/dist-types/current-time/index.d.ts +1 -1
  49. package/dist-types/descriptions/index.d.ts +4 -3
  50. package/dist-types/humanize-time/index.d.ts +8 -8
  51. package/dist-types/info-card-item/index.d.ts +10 -9
  52. package/dist-types/loading-step/index.d.ts +8 -8
  53. package/dist-types/pagination/index.d.ts +7 -0
  54. package/dist-types/statistics-card/index.d.ts +2 -2
  55. package/docs/eo-alert.md +65 -1
  56. package/docs/eo-alert.react.md +127 -0
  57. package/docs/eo-card-item.md +179 -210
  58. package/docs/eo-card-item.react.md +578 -0
  59. package/docs/eo-carousel-text.md +49 -2
  60. package/docs/eo-carousel-text.react.md +62 -0
  61. package/docs/eo-code-block.md +135 -4
  62. package/docs/eo-code-block.react.md +146 -0
  63. package/docs/eo-code-display.md +97 -1
  64. package/docs/eo-code-display.react.md +116 -0
  65. package/docs/eo-code-wrapper.md +108 -0
  66. package/docs/eo-code-wrapper.react.md +100 -0
  67. package/docs/eo-current-time.md +40 -1
  68. package/docs/eo-current-time.react.md +53 -0
  69. package/docs/eo-descriptions.md +74 -4
  70. package/docs/eo-descriptions.react.md +329 -0
  71. package/docs/eo-divider.md +105 -17
  72. package/docs/eo-divider.react.md +129 -0
  73. package/docs/eo-humanize-time.md +89 -42
  74. package/docs/eo-humanize-time.react.md +109 -0
  75. package/docs/eo-info-card-item.md +129 -183
  76. package/docs/eo-info-card-item.react.md +188 -0
  77. package/docs/eo-loading-step.md +96 -1
  78. package/docs/eo-loading-step.react.md +102 -0
  79. package/docs/eo-pagination.md +74 -1
  80. package/docs/eo-pagination.react.md +93 -0
  81. package/docs/eo-statistics-card.md +175 -456
  82. package/docs/eo-statistics-card.react.md +376 -0
  83. package/package.json +2 -2
  84. package/dist/chunks/3171.3bb3ff80.js +0 -2
  85. package/dist/chunks/3171.3bb3ff80.js.map +0 -1
  86. package/dist/chunks/4837.3ae6253e.js +0 -2
  87. package/dist/chunks/4837.3ae6253e.js.map +0 -1
  88. package/dist/chunks/5045.b0f85f6b.js +0 -2
  89. package/dist/chunks/5045.b0f85f6b.js.map +0 -1
  90. package/dist/chunks/5399.23640b2d.js +0 -2
  91. package/dist/chunks/5399.23640b2d.js.map +0 -1
  92. package/dist/chunks/5552.5d29c532.js +0 -2
  93. package/dist/chunks/5552.5d29c532.js.map +0 -1
  94. package/dist/chunks/7218.4acefe69.js +0 -2
  95. package/dist/chunks/7218.4acefe69.js.map +0 -1
  96. package/dist/chunks/948.817a1ef0.js +0 -3
  97. package/dist/chunks/948.817a1ef0.js.map +0 -1
  98. package/dist/chunks/eo-card-item.fbff6f7e.js.map +0 -1
  99. package/dist/chunks/eo-code-block.7efe5647.js.map +0 -1
  100. package/dist/chunks/eo-info-card-item.0d15cb28.js.map +0 -1
  101. package/dist/chunks/main.7a4b0b01.js.map +0 -1
  102. package/dist/index.db5144bf.js.map +0 -1
  103. /package/dist/chunks/{948.817a1ef0.js.LICENSE.txt → 948.b8effe9f.js.LICENSE.txt} +0 -0
  104. /package/dist/chunks/{eo-card-item.fbff6f7e.js.LICENSE.txt → eo-card-item.f56c41e5.js.LICENSE.txt} +0 -0
  105. /package/dist/chunks/{eo-descriptions.b8320ca9.js.LICENSE.txt → eo-descriptions.1ab98c43.js.LICENSE.txt} +0 -0
  106. /package/dist/chunks/{eo-info-card-item.0d15cb28.js.LICENSE.txt → eo-info-card-item.e6403b4d.js.LICENSE.txt} +0 -0
  107. /package/dist/chunks/{eo-loading-step.834e0aa3.js.LICENSE.txt → eo-loading-step.259d7985.js.LICENSE.txt} +0 -0
@@ -0,0 +1,578 @@
1
+ ---
2
+ tagName: eo-card-item
3
+ displayName: WrappedEoCardItem
4
+ description: 信息类卡片 —— 通用卡片
5
+ category: card-info
6
+ source: "@next-bricks/presentational"
7
+ ---
8
+
9
+ # WrappedEoCardItem
10
+
11
+ > 信息类卡片 —— 通用卡片
12
+
13
+ ## 导入
14
+
15
+ ```tsx
16
+ import { WrappedEoCardItem } from "@easyops/wrapped-components";
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
22
+ | --------------- | ------------------------- | ---- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
23
+ | cardTitle | `string` | 是 | - | 卡片标题 |
24
+ | description | `string` | 否 | - | 描述信息 |
25
+ | hasHeader | `boolean` | 否 | - | 是否有顶部小标题区域,开启后会显示 `auxiliaryText` 辅助文字 |
26
+ | auxiliaryText | `string` | 否 | - | 顶部辅助文字,在 `hasHeader` 为 `true` 时展示 |
27
+ | avatar | `IconAvatar \| ImgAvatar` | 否 | - | 图标或图片,支持图标头像(IconAvatar)和图片头像(ImgAvatar)两种形式 |
28
+ | avatarPosition | `"content" \| "cover"` | 否 | - | 头像的放置位置,设为 `cover` 时头像显示在封面区域,否则显示在内容区域 |
29
+ | avatarPlacement | `"left" \| "title-left"` | 否 | `"left"` | 图标对齐方式,`left` 在内容左侧,`title-left` 紧靠标题左侧。`avatarPosition` 不为 `cover` 时有效 |
30
+ | url | `string \| object` | 否 | - | 链接地址,使用内部路由跳转 |
31
+ | href | `string` | 否 | - | 设置后使用原生 `<a>` 标签跳转,通常用于外链 |
32
+ | target | `string` | 否 | - | 链接跳转目标,如 `_blank` |
33
+ | actions | `ActionType[]` | 否 | - | 操作按钮组 |
34
+ | showActions | `"always" \| "hover"` | 否 | `"always"` | 操作按钮组的展示时机,`always` 始终展示,`hover` 悬停时展示 |
35
+ | selected | `boolean` | 否 | - | 是否处于选中状态 |
36
+ | styleType | `"grayish"` | 否 | - | 卡片样式类型,设为 `grayish` 时使用灰色调样式 |
37
+ | hasCover | `boolean` | 否 | - | 是否启用封面区域 |
38
+ | coverImage | `string` | 否 | - | 封面背景图片 URL |
39
+ | coverColor | `string` | 否 | - | 封面纯色背景颜色 |
40
+ | coverImageSize | `string` | 否 | - | 封面图片尺寸,同 CSS `background-size`,参考 [MDN](https://developer.mozilla.org/zh-CN/docs/Web/CSS/background-size) |
41
+ | tagConfig | `TagConfig` | 否 | - | 徽标配置,可设置文本、图标、背景色和字体颜色。`bgColor` 支持预设色值(blue/cyan/geekblue/grayblue/gray/green/orange/purple/red/yellow)或自定义颜色值 |
42
+ | borderColor | `string` | 否 | - | 卡片边框颜色,支持预设色值(同 `tagConfig.bgColor`)或自定义颜色值 |
43
+ | stacked | `boolean` | 否 | - | 是否展示堆叠效果(在卡片后方渲染两层装饰层) |
44
+ | cardStyle | `CSSProperties` | 否 | - | 卡片外层容器样式 |
45
+ | cardBodyStyle | `CSSProperties` | 否 | - | 卡片内容区域样式 |
46
+ | cardTitleStyle | `CSSProperties` | 否 | - | 卡片标题样式 |
47
+
48
+ ## Events
49
+
50
+ | 事件 | detail | 说明 |
51
+ | ------------- | ------------------ | ------------------ |
52
+ | onActionClick | `SimpleActionType` | 操作按钮点击时触发 |
53
+ | onTagClick | - | 徽标点击时触发 |
54
+
55
+ ## Slots
56
+
57
+ | 名称 | 说明 |
58
+ | --------------- | --------------------------------------------------------------------- |
59
+ | (默认) | 内容区域,通常放置卡片自定义内容 |
60
+ | title-suffix | 标题后缀区域,通常放置状态标签等内容 |
61
+ | expanded-area-1 | 扩展区域 1,通常放置标签信息 |
62
+ | expanded-area-2 | 扩展区域 2,通常放置操作和其他属性信息(图标/头像/小字描述/统计信息) |
63
+
64
+ ## Examples
65
+
66
+ ### Basic
67
+
68
+ 展示带图标、描述、顶部辅助文字和操作按钮的基本卡片。
69
+
70
+ ```tsx preview
71
+ <WrappedEoCardItem
72
+ style={{ width: 300 }}
73
+ hasHeader
74
+ auxiliaryText="初级应用"
75
+ cardTitle="资源监控微应用"
76
+ description="资源监控微应用相关前后台"
77
+ url="/test"
78
+ target="_blank"
79
+ avatar={{
80
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
81
+ color: "#167be0",
82
+ size: 20,
83
+ bgColor: "var(--theme-geekblue-background)",
84
+ }}
85
+ actions={[
86
+ {
87
+ icon: { lib: "antd", theme: "outlined", icon: "star" },
88
+ isDropdown: false,
89
+ event: "collect",
90
+ },
91
+ {
92
+ icon: { lib: "antd", icon: "copy", theme: "outlined" },
93
+ text: "复制链接",
94
+ isDropdown: true,
95
+ event: "copy",
96
+ },
97
+ {
98
+ icon: { lib: "antd", icon: "download", theme: "outlined" },
99
+ text: "下载",
100
+ isDropdown: true,
101
+ disabled: true,
102
+ event: "download",
103
+ },
104
+ ]}
105
+ />
106
+ ```
107
+
108
+ ### showActions
109
+
110
+ 通过 `showActions="hover"` 使操作按钮仅在鼠标悬停时显示。
111
+
112
+ ```tsx preview
113
+ <WrappedEoCardItem
114
+ style={{ width: 300 }}
115
+ hasHeader
116
+ auxiliaryText="初级应用"
117
+ cardTitle="资源监控微应用"
118
+ description="资源监控微应用相关前后台"
119
+ avatar={{
120
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
121
+ color: "#167be0",
122
+ size: 20,
123
+ bgColor: "var(--theme-geekblue-background)",
124
+ }}
125
+ actions={[
126
+ {
127
+ icon: { lib: "antd", theme: "outlined", icon: "star" },
128
+ isDropdown: false,
129
+ event: "collect",
130
+ },
131
+ {
132
+ icon: { lib: "antd", icon: "copy", theme: "outlined" },
133
+ text: "复制链接",
134
+ isDropdown: true,
135
+ event: "copy",
136
+ },
137
+ {
138
+ icon: { lib: "antd", icon: "download", theme: "outlined" },
139
+ text: "下载",
140
+ isDropdown: true,
141
+ disabled: true,
142
+ event: "download",
143
+ },
144
+ ]}
145
+ showActions="hover"
146
+ />
147
+ ```
148
+
149
+ ### Cover
150
+
151
+ 通过 `hasCover` 启用封面区域,可使用图片或纯色背景,并支持将头像放置在封面上。
152
+
153
+ ```tsx preview
154
+ <div style={{ display: "flex", gap: 16 }}>
155
+ <WrappedEoCardItem
156
+ style={{ width: 280 }}
157
+ hasCover
158
+ coverImage="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
159
+ cardTitle="信息卡片"
160
+ description="这是一只可爱的北极熊"
161
+ url="/test"
162
+ target="_blank"
163
+ />
164
+ <WrappedEoCardItem
165
+ style={{ width: 280 }}
166
+ hasCover
167
+ coverColor="#167be0"
168
+ cardTitle="资源监控微应用"
169
+ description="资源监控微应用相关前后台"
170
+ url="/test"
171
+ target="_blank"
172
+ avatarPosition="cover"
173
+ avatar={{
174
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
175
+ color: "#fff",
176
+ }}
177
+ actions={[
178
+ {
179
+ icon: {
180
+ lib: "antd",
181
+ theme: "outlined",
182
+ icon: "star",
183
+ startColor: "#fff",
184
+ endColor: "#fff",
185
+ },
186
+ isDropdown: false,
187
+ event: "collect",
188
+ },
189
+ {
190
+ icon: { lib: "antd", icon: "copy", theme: "outlined" },
191
+ text: "复制链接",
192
+ isDropdown: true,
193
+ event: "copy",
194
+ },
195
+ {
196
+ icon: { lib: "antd", icon: "download", theme: "outlined" },
197
+ text: "下载",
198
+ isDropdown: true,
199
+ disabled: true,
200
+ event: "download",
201
+ },
202
+ ]}
203
+ />
204
+ </div>
205
+ ```
206
+
207
+ ### coverImageSize
208
+
209
+ 通过 `coverImageSize` 控制封面图片的显示尺寸。
210
+
211
+ ```tsx preview
212
+ <div style={{ display: "flex", gap: 16 }}>
213
+ <WrappedEoCardItem
214
+ style={{ width: 280 }}
215
+ hasCover
216
+ coverImage="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
217
+ coverImageSize="cover"
218
+ cardTitle="cover 模式"
219
+ description="图片铺满封面区域"
220
+ />
221
+ <WrappedEoCardItem
222
+ style={{ width: 280 }}
223
+ hasCover
224
+ coverImage="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
225
+ coverImageSize="contain"
226
+ cardTitle="contain 模式"
227
+ description="图片完整显示在封面区域"
228
+ />
229
+ </div>
230
+ ```
231
+
232
+ ### avatarPlacement
233
+
234
+ 通过 `avatarPlacement="title-left"` 将图标紧靠标题左侧显示。
235
+
236
+ ```tsx preview
237
+ <WrappedEoCardItem
238
+ avatarPlacement="title-left"
239
+ style={{ width: 300 }}
240
+ cardTitle="资源监控微应用"
241
+ description="资源监控微应用相关前后台"
242
+ url="/test"
243
+ target="_blank"
244
+ avatar={{
245
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
246
+ }}
247
+ />
248
+ ```
249
+
250
+ ### selected
251
+
252
+ 通过 `selected` 高亮选中状态,支持默认样式和 `grayish` 样式类型。
253
+
254
+ ```tsx preview
255
+ <div style={{ display: "flex", gap: 16 }}>
256
+ <WrappedEoCardItem
257
+ selected
258
+ style={{ width: 300 }}
259
+ cardTitle="资源监控微应用"
260
+ description="资源监控微应用相关前后台"
261
+ avatar={{
262
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
263
+ size: 20,
264
+ }}
265
+ />
266
+ <WrappedEoCardItem
267
+ styleType="grayish"
268
+ selected
269
+ style={{ width: 300 }}
270
+ cardTitle="资源监控微应用"
271
+ description="资源监控微应用相关前后台"
272
+ avatar={{
273
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
274
+ size: 20,
275
+ }}
276
+ />
277
+ </div>
278
+ ```
279
+
280
+ ### borderColor
281
+
282
+ 通过 `borderColor` 设置卡片边框颜色,支持预设色值和自定义颜色,可配合 `selected` 使用。
283
+
284
+ ```tsx preview
285
+ <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
286
+ <WrappedEoCardItem
287
+ borderColor="blue"
288
+ style={{ width: 300 }}
289
+ cardTitle="资源监控微应用"
290
+ description="资源监控微应用相关前后台"
291
+ avatar={{
292
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
293
+ size: 20,
294
+ }}
295
+ />
296
+ <WrappedEoCardItem
297
+ borderColor="blue"
298
+ selected
299
+ style={{ width: 300 }}
300
+ cardTitle="资源监控微应用"
301
+ description="资源监控微应用相关前后台"
302
+ avatar={{
303
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
304
+ size: 20,
305
+ }}
306
+ />
307
+ </div>
308
+ ```
309
+
310
+ ### tagConfig
311
+
312
+ 通过 `tagConfig` 在卡片右上角显示徽标,支持文字类型(`text`)和图标类型(`icon`),以及预设色值和自定义颜色。点击徽标触发 `onTagClick` 回调。
313
+
314
+ ```tsx preview
315
+ function TagExample() {
316
+ const [starred, setStarred] = React.useState(false);
317
+
318
+ return (
319
+ <>
320
+ <div style={{ marginBottom: 10 }}>Text Tag</div>
321
+ <div
322
+ style={{
323
+ display: "grid",
324
+ gridTemplateColumns: "repeat(4, 1fr)",
325
+ gap: 16,
326
+ }}
327
+ >
328
+ <WrappedEoCardItem
329
+ tagConfig={{ text: "禁用", bgColor: "gray" }}
330
+ cardTitle="资源监控微应用"
331
+ description="资源监控微应用相关前后台"
332
+ />
333
+ <WrappedEoCardItem
334
+ tagConfig={{ text: "蓝色", bgColor: "blue" }}
335
+ cardTitle="资源监控微应用"
336
+ description="资源监控微应用相关前后台"
337
+ />
338
+ <WrappedEoCardItem
339
+ tagConfig={{ text: "绿色", bgColor: "green" }}
340
+ cardTitle="资源监控微应用"
341
+ description="资源监控微应用相关前后台"
342
+ />
343
+ <WrappedEoCardItem
344
+ tagConfig={{
345
+ text: "自定义",
346
+ bgColor: "rgb(228 236 183)",
347
+ color: "#000",
348
+ }}
349
+ cardTitle="资源监控微应用"
350
+ description="资源监控微应用相关前后台"
351
+ />
352
+ </div>
353
+ <div style={{ margin: 10 }}>Icon Tag</div>
354
+ <div
355
+ style={{
356
+ display: "grid",
357
+ gridTemplateColumns: "repeat(4, 1fr)",
358
+ gap: 16,
359
+ }}
360
+ >
361
+ <WrappedEoCardItem
362
+ tagConfig={{
363
+ icon: { lib: "antd", icon: "info-circle", theme: "outlined" },
364
+ bgColor: "blue",
365
+ }}
366
+ cardTitle="资源监控微应用"
367
+ description="资源监控微应用相关前后台"
368
+ url="/test"
369
+ target="_blank"
370
+ />
371
+ <WrappedEoCardItem
372
+ tagConfig={{
373
+ icon: { lib: "antd", icon: "check-circle", theme: "outlined" },
374
+ bgColor: "green",
375
+ }}
376
+ cardTitle="资源监控微应用"
377
+ description="资源监控微应用相关前后台"
378
+ url="/test"
379
+ target="_blank"
380
+ />
381
+ <WrappedEoCardItem
382
+ tagConfig={
383
+ starred
384
+ ? {
385
+ icon: {
386
+ lib: "antd",
387
+ icon: "star",
388
+ theme: "filled",
389
+ startColor: "yellow",
390
+ endColor: "yellow",
391
+ },
392
+ bgColor: "blue",
393
+ }
394
+ : {
395
+ icon: { lib: "antd", icon: "star", theme: "filled" },
396
+ bgColor: "blue",
397
+ }
398
+ }
399
+ cardTitle="资源监控微应用"
400
+ description="资源监控微应用相关前后台"
401
+ url="/test"
402
+ target="_blank"
403
+ onTagClick={() => setStarred(true)}
404
+ />
405
+ </div>
406
+ </>
407
+ );
408
+ }
409
+ ```
410
+
411
+ ### styleType
412
+
413
+ 使用 `styleType="grayish"` 展示灰色调卡片样式。
414
+
415
+ ```tsx preview
416
+ <WrappedEoCardItem
417
+ styleType="grayish"
418
+ style={{ width: 300 }}
419
+ cardTitle="资源监控微应用"
420
+ description="资源监控微应用相关前后台"
421
+ url="/test"
422
+ target="_blank"
423
+ avatar={{
424
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
425
+ size: 20,
426
+ }}
427
+ />
428
+ ```
429
+
430
+ ### stacked
431
+
432
+ 通过 `stacked` 为卡片添加堆叠视觉效果,适合表示卡片组。
433
+
434
+ ```tsx preview
435
+ <div style={{ display: "flex", flexDirection: "column", gap: 18 }}>
436
+ <WrappedEoCardItem
437
+ stacked
438
+ style={{ width: 300 }}
439
+ cardTitle="资源监控微应用"
440
+ description="资源监控微应用相关前后台"
441
+ avatar={{
442
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
443
+ size: 20,
444
+ }}
445
+ />
446
+ <WrappedEoCardItem
447
+ stacked
448
+ styleType="grayish"
449
+ style={{ width: 300 }}
450
+ cardTitle="资源监控微应用"
451
+ description="资源监控微应用相关前后台"
452
+ avatar={{
453
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
454
+ size: 20,
455
+ }}
456
+ />
457
+ <WrappedEoCardItem
458
+ stacked
459
+ borderColor="blue"
460
+ style={{ width: 300 }}
461
+ cardTitle="资源监控微应用"
462
+ description="资源监控微应用相关前后台"
463
+ avatar={{
464
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
465
+ size: 20,
466
+ }}
467
+ />
468
+ </div>
469
+ ```
470
+
471
+ ### cardStyle
472
+
473
+ 通过 `cardStyle`、`cardBodyStyle`、`cardTitleStyle` 自定义卡片各区域的样式。
474
+
475
+ ```tsx preview
476
+ <div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
477
+ <WrappedEoCardItem
478
+ style={{ width: 280 }}
479
+ cardStyle={{ backgroundColor: "var(--palette-gray-blue-6)" }}
480
+ cardTitle="自定义背景色"
481
+ description="通过 cardStyle 设置卡片背景"
482
+ />
483
+ <WrappedEoCardItem
484
+ style={{ width: 280 }}
485
+ cardBodyStyle={{ padding: "20px 24px" }}
486
+ cardTitleStyle={{ fontSize: 18, fontWeight: "bold" }}
487
+ cardTitle="自定义内容区和标题样式"
488
+ description="通过 cardBodyStyle 和 cardTitleStyle 调整布局"
489
+ />
490
+ </div>
491
+ ```
492
+
493
+ ### Slots
494
+
495
+ 利用 `title-suffix` 展示标题后缀标签,`expanded-area-1` 展示标签列表,`expanded-area-2` 展示底部操作栏。
496
+
497
+ ```tsx preview
498
+ <WrappedEoCardItem
499
+ style={{ width: 300 }}
500
+ hasHeader
501
+ auxiliaryText="初级应用"
502
+ cardTitle="资源监控微应用"
503
+ description="资源监控微应用相关前后台"
504
+ avatar={{
505
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
506
+ color: "#167be0",
507
+ size: 20,
508
+ bgColor: "var(--theme-geekblue-background)",
509
+ }}
510
+ >
511
+ <WrappedEoTag slot="title-suffix" color="green">
512
+ 已启用
513
+ </WrappedEoTag>
514
+ <WrappedEoTagList
515
+ slot="expanded-area-1"
516
+ size="small"
517
+ list={[
518
+ { text: "IT 资源管理", key: "IT_resource_management", color: "gray" },
519
+ { text: "资源套餐", key: "resource_package", color: "gray" },
520
+ ]}
521
+ />
522
+ <WrappedEoFlexLayout
523
+ slot="expanded-area-2"
524
+ style={{ width: "100%" }}
525
+ justifyContent="space-between"
526
+ alignItems="center"
527
+ >
528
+ <span style={{ color: "var(--text-color-secondary)" }}>
529
+ 张元 更新于 2 小时前
530
+ </span>
531
+ <WrappedEoSwitch size="small" />
532
+ </WrappedEoFlexLayout>
533
+ </WrappedEoCardItem>
534
+ ```
535
+
536
+ ### onActionClick
537
+
538
+ 监听 `onActionClick` 事件获取被点击的操作按钮信息。
539
+
540
+ ```tsx preview
541
+ function ActionExample() {
542
+ const [lastAction, setLastAction] = React.useState(null);
543
+
544
+ return (
545
+ <>
546
+ {lastAction && (
547
+ <div style={{ marginBottom: 8 }}>
548
+ 上次点击的操作:<strong>{lastAction.event}</strong>
549
+ </div>
550
+ )}
551
+ <WrappedEoCardItem
552
+ style={{ width: 300 }}
553
+ cardTitle="资源监控微应用"
554
+ description="资源监控微应用相关前后台"
555
+ avatar={{
556
+ icon: { lib: "easyops", category: "default", icon: "monitor" },
557
+ size: 20,
558
+ }}
559
+ actions={[
560
+ {
561
+ icon: { lib: "antd", theme: "outlined", icon: "edit" },
562
+ text: "编辑",
563
+ isDropdown: true,
564
+ event: "edit",
565
+ },
566
+ {
567
+ icon: { lib: "antd", icon: "delete", theme: "outlined" },
568
+ text: "删除",
569
+ isDropdown: true,
570
+ event: "delete",
571
+ },
572
+ ]}
573
+ onActionClick={(action) => setLastAction(action)}
574
+ />
575
+ </>
576
+ );
577
+ }
578
+ ```
@@ -1,11 +1,58 @@
1
- 构件 `eo-carousel-text`
1
+ ---
2
+ tagName: eo-carousel-text
3
+ displayName: EoCarouselText
4
+ description: 文字跑马灯构件,文本内容从右向左循环滚动展示,支持自定义速度、字体大小和字体颜色。
5
+ category: ""
6
+ source: "@next-bricks/presentational"
7
+ ---
8
+
9
+ # eo-carousel-text
10
+
11
+ > 文字跑马灯构件,文本内容从右向左循环滚动展示,支持自定义速度、字体大小和字体颜色。
12
+
13
+ ## Props
14
+
15
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
16
+ | -------------- | --------------------------- | ---- | ----------------------------- | ------------------- |
17
+ | text | `string` | 是 | `""` | 展示内容 |
18
+ | containerWidth | `CSSProperties["width"]` | 否 | `"100%"` | 容器宽度 |
19
+ | fontSize | `CSSProperties["fontSize"]` | 否 | `"var(--normal-font-size)"` | 字体大小 |
20
+ | fontColor | `CSSProperties["color"]` | 否 | `"var(--text-color-default)"` | 字体颜色 |
21
+ | speed | `number` | 否 | `100` | 移动速度,单位 px/s |
2
22
 
3
23
  ## Examples
4
24
 
5
25
  ### Basic
6
26
 
27
+ 展示默认样式的文字跑马灯。
28
+
29
+ ```yaml preview
30
+ brick: eo-carousel-text
31
+ properties:
32
+ text: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
33
+ ```
34
+
35
+ ### Custom Speed
36
+
37
+ 调整滚动速度,使文字以更慢的速度滚动。
38
+
39
+ ```yaml preview
40
+ brick: eo-carousel-text
41
+ properties:
42
+ text: 这是一段自定义速度的跑马灯文字,速度设置为每秒 50 像素。
43
+ speed: 50
44
+ ```
45
+
46
+ ### Custom Style
47
+
48
+ 自定义字体大小、字体颜色和容器宽度。
49
+
7
50
  ```yaml preview
8
51
  brick: eo-carousel-text
9
52
  properties:
10
- text: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
53
+ text: 这是一段自定义样式的跑马灯文字,使用了自定义颜色和字体大小。
54
+ fontSize: 18px
55
+ fontColor: "#1890ff"
56
+ containerWidth: 80%
57
+ speed: 80
11
58
  ```
@@ -0,0 +1,62 @@
1
+ ---
2
+ tagName: eo-carousel-text
3
+ displayName: WrappedEoCarouselText
4
+ description: 文字跑马灯构件,文本内容从右向左循环滚动展示,支持自定义速度、字体大小和字体颜色。
5
+ category: ""
6
+ source: "@next-bricks/presentational"
7
+ ---
8
+
9
+ # WrappedEoCarouselText
10
+
11
+ > 文字跑马灯构件,文本内容从右向左循环滚动展示,支持自定义速度、字体大小和字体颜色。
12
+
13
+ ## 导入
14
+
15
+ ```tsx
16
+ import { WrappedEoCarouselText } from "@easyops/wrapped-components";
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
22
+ | -------------- | --------------------------- | ---- | ----------------------------- | ------------------- |
23
+ | text | `string` | 是 | `""` | 展示内容 |
24
+ | containerWidth | `CSSProperties["width"]` | 否 | `"100%"` | 容器宽度 |
25
+ | fontSize | `CSSProperties["fontSize"]` | 否 | `"var(--normal-font-size)"` | 字体大小 |
26
+ | fontColor | `CSSProperties["color"]` | 否 | `"var(--text-color-default)"` | 字体颜色 |
27
+ | speed | `number` | 否 | `100` | 移动速度,单位 px/s |
28
+
29
+ ## Examples
30
+
31
+ ### Basic
32
+
33
+ 展示默认样式的文字跑马灯。
34
+
35
+ ```tsx preview
36
+ <WrappedEoCarouselText text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book." />
37
+ ```
38
+
39
+ ### Custom Speed
40
+
41
+ 调整滚动速度,使文字以更慢的速度滚动。
42
+
43
+ ```tsx preview
44
+ <WrappedEoCarouselText
45
+ text="这是一段自定义速度的跑马灯文字,速度设置为每秒 50 像素。"
46
+ speed={50}
47
+ />
48
+ ```
49
+
50
+ ### Custom Style
51
+
52
+ 自定义字体大小、字体颜色和容器宽度。
53
+
54
+ ```tsx preview
55
+ <WrappedEoCarouselText
56
+ text="这是一段自定义样式的跑马灯文字,使用了自定义颜色和字体大小。"
57
+ fontSize="18px"
58
+ fontColor="#1890ff"
59
+ containerWidth="80%"
60
+ speed={80}
61
+ />
62
+ ```