jianghu-ui 1.0.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.
- package/README.md +376 -0
- package/dist/jianghu-ui.css +2318 -0
- package/dist/jianghu-ui.js +2 -0
- package/dist/jianghu-ui.js.LICENSE.txt +1 -0
- package/package.json +56 -0
- package/src/Design.stories.mdx +195 -0
- package/src/Introduction.stories.mdx +148 -0
- package/src/components/JhAddressSelect/JhAddressSelect.md +250 -0
- package/src/components/JhAddressSelect/JhAddressSelect.stories.js +282 -0
- package/src/components/JhAddressSelect/JhAddressSelect.vue +261 -0
- package/src/components/JhCard/JhCard.md +246 -0
- package/src/components/JhCard/JhCard.stories.js +688 -0
- package/src/components/JhCard/JhCard.vue +604 -0
- package/src/components/JhCheckCard/JhCheckCard.md +245 -0
- package/src/components/JhCheckCard/JhCheckCard.stories.js +750 -0
- package/src/components/JhCheckCard/JhCheckCard.vue +476 -0
- package/src/components/JhConfirmDialog/JhConfirmDialog.md +70 -0
- package/src/components/JhConfirmDialog/JhConfirmDialog.stories.js +550 -0
- package/src/components/JhConfirmDialog/JhConfirmDialog.vue +181 -0
- package/src/components/JhDateRangePicker/JhDateRangePicker.md +56 -0
- package/src/components/JhDateRangePicker/JhDateRangePicker.stories.js +320 -0
- package/src/components/JhDateRangePicker/JhDateRangePicker.vue +307 -0
- package/src/components/JhDescriptions/JhDescriptions.md +724 -0
- package/src/components/JhDescriptions/JhDescriptions.stories.js +858 -0
- package/src/components/JhDescriptions/JhDescriptions.vue +933 -0
- package/src/components/JhDraggable/JhDraggable.md +66 -0
- package/src/components/JhDraggable/JhDraggable.stories.js +161 -0
- package/src/components/JhDraggable/JhDraggable.vue +254 -0
- package/src/components/JhDrawer/JhDrawer.md +68 -0
- package/src/components/JhDrawer/JhDrawer.stories.js +478 -0
- package/src/components/JhDrawer/JhDrawer.vue +281 -0
- package/src/components/JhDrawerForm/JhDrawerForm.md +69 -0
- package/src/components/JhDrawerForm/JhDrawerForm.stories.js +492 -0
- package/src/components/JhDrawerForm/JhDrawerForm.vue +297 -0
- package/src/components/JhEditableTable/JhEditableTable.md +507 -0
- package/src/components/JhEditableTable/JhEditableTable.stories.js +615 -0
- package/src/components/JhEditableTable/JhEditableTable.vue +685 -0
- package/src/components/JhFileInput/JhFileInput.md +56 -0
- package/src/components/JhFileInput/JhFileInput.stories.js +103 -0
- package/src/components/JhFileInput/JhFileInput.vue +253 -0
- package/src/components/JhForm/JhForm.md +676 -0
- package/src/components/JhForm/JhForm.stories.js +1375 -0
- package/src/components/JhForm/JhForm.vue +657 -0
- package/src/components/JhFormField/JhFormField.stories.js +217 -0
- package/src/components/JhFormField/JhFormField.vue +439 -0
- package/src/components/JhFormFields/JhFormFields.md +647 -0
- package/src/components/JhFormFields/JhFormFields.stories.js +922 -0
- package/src/components/JhFormFields/JhFormFields.vue +998 -0
- package/src/components/JhFormList/JhFormList.md +303 -0
- package/src/components/JhFormList/JhFormList.stories.js +661 -0
- package/src/components/JhFormList/JhFormList.vue +1127 -0
- package/src/components/JhJsonEditor/JhJsonEditor.md +54 -0
- package/src/components/JhJsonEditor/JhJsonEditor.stories.js +157 -0
- package/src/components/JhJsonEditor/JhJsonEditor.vue +178 -0
- package/src/components/JhLayout/JhLayout.md +580 -0
- package/src/components/JhLayout/JhLayout.stories.js +414 -0
- package/src/components/JhLayout/JhLayout.vue +387 -0
- package/src/components/JhList/JhList.md +441 -0
- package/src/components/JhList/JhList.stories.js +524 -0
- package/src/components/JhList/JhList.vue +571 -0
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.md +56 -0
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.stories.js +191 -0
- package/src/components/JhMarkdownEditor/JhMarkdownEditor.vue +188 -0
- package/src/components/JhMask/JhMask.md +62 -0
- package/src/components/JhMask/JhMask.stories.js +270 -0
- package/src/components/JhMask/JhMask.vue +123 -0
- package/src/components/JhMenu/JhMenu.md +85 -0
- package/src/components/JhMenu/JhMenu.stories.js +384 -0
- package/src/components/JhMenu/JhMenu.vue +545 -0
- package/src/components/JhModal/JhModal.md +68 -0
- package/src/components/JhModal/JhModal.stories.js +562 -0
- package/src/components/JhModal/JhModal.vue +235 -0
- package/src/components/JhModalForm/JhModalForm.md +69 -0
- package/src/components/JhModalForm/JhModalForm.stories.js +592 -0
- package/src/components/JhModalForm/JhModalForm.vue +298 -0
- package/src/components/JhPageContainer/JhPageContainer.md +409 -0
- package/src/components/JhPageContainer/JhPageContainer.stories.js +209 -0
- package/src/components/JhPageContainer/JhPageContainer.vue +72 -0
- package/src/components/JhQueryFilter/JhQueryFilter.md +77 -0
- package/src/components/JhQueryFilter/JhQueryFilter.stories.js +684 -0
- package/src/components/JhQueryFilter/JhQueryFilter.vue +429 -0
- package/src/components/JhScene/JhScene.md +64 -0
- package/src/components/JhScene/JhScene.stories.js +317 -0
- package/src/components/JhScene/JhScene.vue +376 -0
- package/src/components/JhStatisticCard/JhStatisticCard.md +363 -0
- package/src/components/JhStatisticCard/JhStatisticCard.stories.js +847 -0
- package/src/components/JhStatisticCard/JhStatisticCard.vue +459 -0
- package/src/components/JhStepsForm/JhStepsForm.md +666 -0
- package/src/components/JhStepsForm/JhStepsForm.stories.js +1224 -0
- package/src/components/JhStepsForm/JhStepsForm.vue +749 -0
- package/src/components/JhTable/JhTable.md +730 -0
- package/src/components/JhTable/JhTable.stories.js +1444 -0
- package/src/components/JhTable/JhTable.vue +2298 -0
- package/src/components/JhTableAttachment/JhTableAttachment.md +70 -0
- package/src/components/JhTableAttachment/JhTableAttachment.stories.js +198 -0
- package/src/components/JhTableAttachment/JhTableAttachment.vue +264 -0
- package/src/components/JhToast/JhToast.md +67 -0
- package/src/components/JhToast/JhToast.stories.js +386 -0
- package/src/components/JhToast/JhToast.vue +239 -0
- package/src/components/JhTreeSelect/JhTreeSelect.md +82 -0
- package/src/components/JhTreeSelect/JhTreeSelect.stories.js +391 -0
- package/src/components/JhTreeSelect/JhTreeSelect.vue +727 -0
- package/src/components/JhWaterMark/JhWaterMark.md +190 -0
- package/src/components/JhWaterMark/JhWaterMark.stories.js +675 -0
- package/src/components/JhWaterMark/JhWaterMark.vue +351 -0
- package/src/components/README.md +52 -0
- package/src/index.js +135 -0
- package/src/style/globalCSSJHV4.css +348 -0
- package/src/style/globalCSSVuetifyV4.css +637 -0
- package/src/style/storybook.css +4 -0
- package/src/tailwind.css +3 -0
- package/src/utils/vuetify.js +31 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# JhCard - 高级卡片组件
|
|
2
|
+
|
|
3
|
+
高级卡片组件,完全参考 [Ant Design ProCard](https://procomponents.ant.design/components/card/) 设计规范。
|
|
4
|
+
|
|
5
|
+
## 功能特性
|
|
6
|
+
|
|
7
|
+
- ✅ **标题和提示**: 支持标题、副标题、tooltip 提示信息
|
|
8
|
+
- ✅ **额外内容**: 支持右上角额外内容区域
|
|
9
|
+
- ✅ **边框控制**: 支持边框和标题分割线
|
|
10
|
+
- ✅ **幽灵模式**: 可取消背景色和 padding,适合页面布局
|
|
11
|
+
- ✅ **折叠功能**: 支持卡片内容折叠/展开
|
|
12
|
+
- ✅ **尺寸控制**: 支持 default 和 small 两种尺寸
|
|
13
|
+
- ✅ **加载状态**: 内置 loading 状态展示
|
|
14
|
+
- ✅ **操作项**: 底部操作按钮区域,自动分割线
|
|
15
|
+
- ✅ **布局模式**: 支持居中布局
|
|
16
|
+
- ✅ **分栏布局**: 支持垂直和水平分栏,自动分割线
|
|
17
|
+
- ✅ **栅格布局**: 支持 24 栅格系统,支持数字、像素、百分比
|
|
18
|
+
- ✅ **间距控制**: 支持 gutter 设置栅格间距
|
|
19
|
+
- ✅ **Flex 布局**: 支持 direction 控制 flex 方向
|
|
20
|
+
- ✅ **悬浮效果**: 支持鼠标悬浮阴影效果
|
|
21
|
+
- ✅ **标签页**: 支持内置标签页功能
|
|
22
|
+
|
|
23
|
+
## 基本用法
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<template>
|
|
27
|
+
<jh-card
|
|
28
|
+
title="卡片标题"
|
|
29
|
+
tooltip="这是提示信息"
|
|
30
|
+
extra="额外内容"
|
|
31
|
+
>
|
|
32
|
+
<div>卡片内容</div>
|
|
33
|
+
</jh-card>
|
|
34
|
+
</template>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## API
|
|
38
|
+
|
|
39
|
+
### Props
|
|
40
|
+
|
|
41
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| title | 标题 | string | - |
|
|
44
|
+
| subTitle | 副标题 | string | - |
|
|
45
|
+
| tooltip | 标题旁边的提示信息 | string | - |
|
|
46
|
+
| extra | 右上角额外内容 | string | - |
|
|
47
|
+
| bordered | 是否有边框 | boolean | true |
|
|
48
|
+
| headerBordered | 标题和内容之间是否有分割线 | boolean | false |
|
|
49
|
+
| ghost | 幽灵模式,取消背景色和 padding | boolean | false |
|
|
50
|
+
| collapsible | 是否可折叠 | boolean | false |
|
|
51
|
+
| defaultCollapsed | 默认是否折叠 | boolean | false |
|
|
52
|
+
| size | 尺寸 | 'default' \| 'small' | 'default' |
|
|
53
|
+
| loading | 加载状态 | boolean | false |
|
|
54
|
+
| actions | 底部操作按钮配置 | Array | [] |
|
|
55
|
+
| layout | 布局方式 | 'default' \| 'center' | 'default' |
|
|
56
|
+
| direction | Flex 方向 | 'row' \| 'column' | 'row' |
|
|
57
|
+
| split | 分栏模式 | '' \| 'vertical' \| 'horizontal' | '' |
|
|
58
|
+
| colSpan | 栅格占比,支持数字(0-24)、像素值、百分比 | number \| string | 24 |
|
|
59
|
+
| gutter | 栅格间距 | number \| [number, number] | 0 |
|
|
60
|
+
| tabs | 标签页配置 | object | null |
|
|
61
|
+
| hoverable | 鼠标悬浮时是否有阴影效果 | boolean | false |
|
|
62
|
+
| bodyStyle | 自定义内容区样式 | object | {} |
|
|
63
|
+
| headStyle | 自定义头部样式 | object | {} |
|
|
64
|
+
|
|
65
|
+
### Events
|
|
66
|
+
|
|
67
|
+
| 事件名 | 说明 | 回调参数 |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| collapse | 折叠状态改变时触发 | (collapsed: boolean) |
|
|
70
|
+
| tab-change | 标签页切换时触发 | (key: string \| number) |
|
|
71
|
+
|
|
72
|
+
### Slots
|
|
73
|
+
|
|
74
|
+
| 名称 | 说明 |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| default | 卡片内容 |
|
|
77
|
+
| title | 自定义标题 |
|
|
78
|
+
| extra | 自定义右上角内容 |
|
|
79
|
+
|
|
80
|
+
## 使用示例
|
|
81
|
+
|
|
82
|
+
### 基础卡片
|
|
83
|
+
|
|
84
|
+
```vue
|
|
85
|
+
<jh-card
|
|
86
|
+
title="默认尺寸"
|
|
87
|
+
tooltip="这是提示"
|
|
88
|
+
extra="extra"
|
|
89
|
+
>
|
|
90
|
+
<div>Card content</div>
|
|
91
|
+
</jh-card>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 小尺寸卡片
|
|
95
|
+
|
|
96
|
+
```vue
|
|
97
|
+
<jh-card
|
|
98
|
+
title="小尺寸卡片"
|
|
99
|
+
size="small"
|
|
100
|
+
>
|
|
101
|
+
<div>Card content</div>
|
|
102
|
+
</jh-card>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 带分割线的标题
|
|
106
|
+
|
|
107
|
+
```vue
|
|
108
|
+
<jh-card
|
|
109
|
+
title="标题"
|
|
110
|
+
header-bordered
|
|
111
|
+
>
|
|
112
|
+
<div>Card content</div>
|
|
113
|
+
</jh-card>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 可折叠卡片
|
|
117
|
+
|
|
118
|
+
```vue
|
|
119
|
+
<jh-card
|
|
120
|
+
title="可折叠卡片"
|
|
121
|
+
collapsible
|
|
122
|
+
>
|
|
123
|
+
<div>Card content</div>
|
|
124
|
+
</jh-card>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 加载状态
|
|
128
|
+
|
|
129
|
+
```vue
|
|
130
|
+
<jh-card
|
|
131
|
+
title="加载中"
|
|
132
|
+
loading
|
|
133
|
+
>
|
|
134
|
+
<div>Card content</div>
|
|
135
|
+
</jh-card>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 操作项
|
|
139
|
+
|
|
140
|
+
```vue
|
|
141
|
+
<jh-card
|
|
142
|
+
title="Actions 操作项"
|
|
143
|
+
:actions="[
|
|
144
|
+
{ icon: 'mdi-cog', text: '设置', onClick: () => {} },
|
|
145
|
+
{ icon: 'mdi-pencil', text: '编辑', onClick: () => {} },
|
|
146
|
+
]"
|
|
147
|
+
>
|
|
148
|
+
<div>Card content</div>
|
|
149
|
+
</jh-card>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 栅格布局
|
|
153
|
+
|
|
154
|
+
```vue
|
|
155
|
+
<jh-card :gutter="8">
|
|
156
|
+
<jh-card :col-span="12" bordered>
|
|
157
|
+
colSpan - 12
|
|
158
|
+
</jh-card>
|
|
159
|
+
<jh-card :col-span="6" bordered>
|
|
160
|
+
colSpan - 6
|
|
161
|
+
</jh-card>
|
|
162
|
+
<jh-card :col-span="6" bordered>
|
|
163
|
+
colSpan - 6
|
|
164
|
+
</jh-card>
|
|
165
|
+
</jh-card>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 左右分栏
|
|
169
|
+
|
|
170
|
+
```vue
|
|
171
|
+
<jh-card
|
|
172
|
+
title="左右分栏"
|
|
173
|
+
split="vertical"
|
|
174
|
+
bordered
|
|
175
|
+
>
|
|
176
|
+
<jh-card title="左侧" col-span="30%">
|
|
177
|
+
左侧内容
|
|
178
|
+
</jh-card>
|
|
179
|
+
<jh-card title="右侧">
|
|
180
|
+
右侧内容
|
|
181
|
+
</jh-card>
|
|
182
|
+
</jh-card>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 上下分栏
|
|
186
|
+
|
|
187
|
+
```vue
|
|
188
|
+
<jh-card
|
|
189
|
+
title="上下分栏"
|
|
190
|
+
split="horizontal"
|
|
191
|
+
bordered
|
|
192
|
+
>
|
|
193
|
+
<jh-card title="上部">
|
|
194
|
+
上部内容
|
|
195
|
+
</jh-card>
|
|
196
|
+
<jh-card title="下部">
|
|
197
|
+
下部内容
|
|
198
|
+
</jh-card>
|
|
199
|
+
</jh-card>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 幽灵模式
|
|
203
|
+
|
|
204
|
+
```vue
|
|
205
|
+
<jh-card ghost>
|
|
206
|
+
<div>无背景色和 padding</div>
|
|
207
|
+
</jh-card>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### 居中布局
|
|
211
|
+
|
|
212
|
+
```vue
|
|
213
|
+
<jh-card layout="center" style="min-height: 200px;">
|
|
214
|
+
<div>内容居中</div>
|
|
215
|
+
</jh-card>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 悬浮效果
|
|
219
|
+
|
|
220
|
+
```vue
|
|
221
|
+
<jh-card hoverable>
|
|
222
|
+
<div>鼠标悬浮时有阴影</div>
|
|
223
|
+
</jh-card>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## 设计规范
|
|
227
|
+
|
|
228
|
+
本组件完全参考 Ant Design ProCard 的设计规范:
|
|
229
|
+
|
|
230
|
+
1. **布局灵活**: 支持栅格、分栏、嵌套等多种布局方式
|
|
231
|
+
2. **样式统一**: 遵循 Ant Design 设计语言
|
|
232
|
+
3. **功能完整**: 包含标题、操作项、折叠、加载等常用功能
|
|
233
|
+
4. **易于使用**: API 设计简洁,上手容易
|
|
234
|
+
|
|
235
|
+
## 注意事项
|
|
236
|
+
|
|
237
|
+
1. 使用分栏布局(split)时,子卡片的圆角会被设置为 0
|
|
238
|
+
2. 幽灵模式(ghost)会取消背景色和 padding,适合用于页面布局
|
|
239
|
+
3. colSpan 支持多种格式:数字(0-24)、像素值(如 "200px")、百分比(如 "30%")
|
|
240
|
+
4. gutter 可以是数字或数组,数组格式为 [水平间距, 垂直间距]
|
|
241
|
+
5. 嵌套使用时,组件会自动切换为 flex 弹性盒布局
|
|
242
|
+
|
|
243
|
+
## 相关链接
|
|
244
|
+
|
|
245
|
+
- [Ant Design ProCard](https://procomponents.ant.design/components/card/)
|
|
246
|
+
- [Vuetify Card](https://vuetifyjs.com/en/components/cards/)
|