jianghu-ui 1.0.6 → 1.0.7

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 (47) hide show
  1. package/dist/jianghu-ui.css +181 -110
  2. package/dist/jianghu-ui.js +1 -1
  3. package/package.json +1 -1
  4. package/src/components/JhDrawer/JhDrawer.stories.js +6 -6
  5. package/src/components/JhDrawerForm/JhDrawerForm.vue +1 -1
  6. package/src/components/JhForm/JhForm.stories.js +114 -95
  7. package/src/components/JhForm/JhForm.vue +148 -21
  8. package/src/components/JhFormFields/JhFormFields.vue +33 -14
  9. package/src/components/JhModal/JhModal.stories.js +6 -6
  10. package/src/components/JhModal/JhModal.vue +1 -1
  11. package/src/components/JhModalForm/JhModalForm.vue +1 -1
  12. package/src/components/JhTable/JhTable.stories.js +134 -167
  13. package/src/components/JhTable/JhTable.vue +83 -23
  14. package/src/style/globalCSSVuetifyV4.css +1 -2
  15. package/src/components/JhAddressSelect/JhAddressSelect.md +0 -267
  16. package/src/components/JhCard/JhCard.md +0 -246
  17. package/src/components/JhCheckCard/JhCheckCard.md +0 -245
  18. package/src/components/JhConfirmDialog/JhConfirmDialog.md +0 -70
  19. package/src/components/JhDateRangePicker/JhDateRangePicker.md +0 -56
  20. package/src/components/JhDescriptions/JhDescriptions.md +0 -724
  21. package/src/components/JhDraggable/JhDraggable.md +0 -66
  22. package/src/components/JhDrawer/JhDrawer.md +0 -68
  23. package/src/components/JhDrawerForm/JhDrawerForm.md +0 -69
  24. package/src/components/JhEditableTable/JhEditableTable.md +0 -507
  25. package/src/components/JhFileInput/JhFileInput.md +0 -56
  26. package/src/components/JhForm/JhForm.md +0 -676
  27. package/src/components/JhFormFields/JhFormFields.md +0 -647
  28. package/src/components/JhFormList/JhFormList.md +0 -303
  29. package/src/components/JhJsonEditor/JhJsonEditor.md +0 -54
  30. package/src/components/JhLayout/JhLayout.md +0 -580
  31. package/src/components/JhList/JhList.md +0 -441
  32. package/src/components/JhMarkdownEditor/JhMarkdownEditor.md +0 -56
  33. package/src/components/JhMask/JhMask.md +0 -62
  34. package/src/components/JhMenu/JhMenu.md +0 -85
  35. package/src/components/JhModal/JhModal.md +0 -68
  36. package/src/components/JhModalForm/JhModalForm.md +0 -69
  37. package/src/components/JhPageContainer/JhPageContainer.md +0 -409
  38. package/src/components/JhQueryFilter/JhQueryFilter.md +0 -77
  39. package/src/components/JhScene/JhScene.md +0 -64
  40. package/src/components/JhStatisticCard/JhStatisticCard.md +0 -363
  41. package/src/components/JhStepsForm/JhStepsForm.md +0 -666
  42. package/src/components/JhTable/JhTable.md +0 -730
  43. package/src/components/JhTableAttachment/JhTableAttachment.md +0 -70
  44. package/src/components/JhToast/JhToast.md +0 -67
  45. package/src/components/JhTreeSelect/JhTreeSelect.md +0 -82
  46. package/src/components/JhWaterMark/JhWaterMark.md +0 -190
  47. package/src/components/README.md +0 -52
@@ -1,245 +0,0 @@
1
- # JhCheckCard 多选卡片
2
-
3
- 多选卡片组件,参考 Ant Design ProComponents CheckCard 设计规范。支持单选、多选、不同尺寸、自定义内容等功能。
4
-
5
- ## 基础用法
6
-
7
- ```vue
8
- <template>
9
- <jh-check-card
10
- title="基础卡片"
11
- description="这是一个基础的多选卡片"
12
- @change="handleChange"
13
- >
14
- <div>卡片内容</div>
15
- </jh-check-card>
16
- </template>
17
-
18
- <script>
19
- export default {
20
- methods: {
21
- handleChange(checked, value) {
22
- console.log('选中状态:', checked, '值:', value);
23
- },
24
- },
25
- };
26
- </script>
27
- ```
28
-
29
- ## 多选模式
30
-
31
- ```vue
32
- <template>
33
- <div>
34
- <jh-check-card
35
- v-for="option in options"
36
- :key="option.value"
37
- :title="option.title"
38
- :description="option.description"
39
- :value="option.value"
40
- :checked="selectedValues.includes(option.value)"
41
- @change="handleMultipleChange"
42
- >
43
- {{ option.content }}
44
- </jh-check-card>
45
- </div>
46
- </template>
47
-
48
- <script>
49
- export default {
50
- data() {
51
- return {
52
- selectedValues: ['option1'],
53
- options: [
54
- { value: 'option1', title: '选项一', description: '描述一', content: '内容一' },
55
- { value: 'option2', title: '选项二', description: '描述二', content: '内容二' },
56
- { value: 'option3', title: '选项三', description: '描述三', content: '内容三' },
57
- ],
58
- };
59
- },
60
- methods: {
61
- handleMultipleChange(checked, value) {
62
- if (checked) {
63
- if (!this.selectedValues.includes(value)) {
64
- this.selectedValues.push(value);
65
- }
66
- } else {
67
- const index = this.selectedValues.indexOf(value);
68
- if (index > -1) {
69
- this.selectedValues.splice(index, 1);
70
- }
71
- }
72
- },
73
- },
74
- };
75
- </script>
76
- ```
77
-
78
- ## 单选模式
79
-
80
- ```vue
81
- <template>
82
- <div>
83
- <jh-check-card
84
- v-for="option in options"
85
- :key="option.value"
86
- :title="option.title"
87
- :value="option.value"
88
- :checked="selectedValue === option.value"
89
- @change="handleSingleChange"
90
- >
91
- {{ option.content }}
92
- </jh-check-card>
93
- </div>
94
- </template>
95
-
96
- <script>
97
- export default {
98
- data() {
99
- return {
100
- selectedValue: 'option1',
101
- options: [
102
- { value: 'option1', title: '选项一', content: '内容一' },
103
- { value: 'option2', title: '选项二', content: '内容二' },
104
- { value: 'option3', title: '选项三', content: '内容三' },
105
- ],
106
- };
107
- },
108
- methods: {
109
- handleSingleChange(checked, value) {
110
- if (checked) {
111
- this.selectedValue = value;
112
- }
113
- },
114
- },
115
- };
116
- </script>
117
- ```
118
-
119
- ## 带封面图片
120
-
121
- ```vue
122
- <template>
123
- <jh-check-card
124
- title="产品名称"
125
- description="产品描述"
126
- cover="https://example.com/image.jpg"
127
- extra="¥299"
128
- @change="handleChange"
129
- >
130
- <div>产品详细信息</div>
131
- </jh-check-card>
132
- </template>
133
- ```
134
-
135
- ## 自定义内容
136
-
137
- ```vue
138
- <template>
139
- <jh-check-card @change="handleChange">
140
- <template #title>
141
- <div style="display: flex; align-items: center;">
142
- <v-icon color="primary" class="mr-2">mdi-rocket</v-icon>
143
- 自定义标题
144
- </div>
145
- </template>
146
-
147
- <template #description>
148
- <div style="color: #52c41a;">自定义描述样式</div>
149
- </template>
150
-
151
- <div style="text-align: center; padding: 20px;">
152
- <div style="font-size: 32px; margin-bottom: 8px;">⚡</div>
153
- <div>自定义内容区域</div>
154
- </div>
155
- </jh-check-card>
156
- </template>
157
- ```
158
-
159
- ## API
160
-
161
- ### Props
162
-
163
- | 参数 | 说明 | 类型 | 默认值 |
164
- | --- | --- | --- | --- |
165
- | title | 卡片标题 | `string` | `''` |
166
- | description | 卡片描述 | `string` | `''` |
167
- | cover | 卡片封面图片URL | `string` | `''` |
168
- | extra | 右下角额外内容 | `string` | `''` |
169
- | value | 卡片值,用于多选时的标识 | `string \| number \| boolean` | `null` |
170
- | checked | 是否选中(受控) | `boolean` | `false` |
171
- | defaultChecked | 默认选中状态(非受控) | `boolean` | `false` |
172
- | disabled | 是否禁用 | `boolean` | `false` |
173
- | loading | 是否加载中 | `boolean` | `false` |
174
- | size | 卡片尺寸 | `'small' \| 'default' \| 'large'` | `'default'` |
175
- | bordered | 是否显示边框 | `boolean` | `true` |
176
- | hideCheckbox | 是否隐藏选择框 | `boolean` | `false` |
177
- | checkboxPosition | 选择框位置 | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `'top-right'` |
178
- | hoverable | 是否可悬浮 | `boolean` | `true` |
179
- | width | 卡片宽度 | `string \| number` | `''` |
180
- | height | 卡片高度 | `string \| number` | `''` |
181
- | bodyStyle | 自定义样式 | `object` | `{}` |
182
- | headStyle | 自定义头部样式 | `object` | `{}` |
183
-
184
- ### Events
185
-
186
- | 事件名 | 说明 | 回调参数 |
187
- | --- | --- | --- |
188
- | change | 选中状态改变时触发 | `(checked: boolean, value: any) => void` |
189
- | click | 点击卡片时触发 | `(event: Event) => void` |
190
- | input | 兼容 v-model,选中状态改变时触发 | `(checked: boolean) => void` |
191
-
192
- ### Slots
193
-
194
- | 插槽名 | 说明 | 参数 |
195
- | --- | --- | --- |
196
- | default | 默认内容 | - |
197
- | title | 自定义标题 | - |
198
- | description | 自定义描述 | - |
199
- | cover | 自定义封面 | - |
200
- | extra | 自定义额外内容 | - |
201
-
202
- ## 设计规范
203
-
204
- ### 尺寸规格
205
-
206
- - **小尺寸 (small)**: 最小高度 80px,内边距 12px,标题字号 14px
207
- - **默认尺寸 (default)**: 最小高度 100px,内边距 16px,标题字号 16px
208
- - **大尺寸 (large)**: 最小高度 120px,内边距 20px,标题字号 18px
209
-
210
- ### 状态样式
211
-
212
- - **默认状态**: 灰色边框 `#d9d9d9`,白色背景
213
- - **悬浮状态**: 蓝色边框 `#1890ff`,轻微阴影
214
- - **选中状态**: 蓝色边框 `#1890ff`,蓝色阴影 `rgba(24, 144, 255, 0.2)`
215
- - **禁用状态**: 透明度 50%,不可交互
216
- - **加载状态**: 显示加载指示器,不可交互
217
-
218
- ### 选择框位置
219
-
220
- 选择框可以放置在卡片的四个角落:
221
- - `top-left`: 左上角
222
- - `top-right`: 右上角(默认)
223
- - `bottom-left`: 左下角
224
- - `bottom-right`: 右下角
225
-
226
- ### 响应式设计
227
-
228
- 组件支持响应式布局,在小屏幕设备上会自动调整内边距和字号:
229
- - 屏幕宽度 ≤ 768px 时,内边距调整为 12px,标题字号调整为 14px
230
-
231
- ## 使用场景
232
-
233
- 1. **商品选择**: 电商场景中的商品多选
234
- 2. **套餐选择**: 会员套餐、服务套餐等单选场景
235
- 3. **功能选择**: 产品功能、权限等多选场景
236
- 4. **配置选择**: 系统配置项、参数设置等
237
- 5. **内容分类**: 文章分类、标签选择等
238
-
239
- ## 注意事项
240
-
241
- 1. 当使用 `checked` 属性时,组件为受控模式,需要通过 `change` 事件更新状态
242
- 2. 当不传入 `checked` 属性时,组件为非受控模式,使用内部状态管理
243
- 3. `value` 属性用于标识卡片,在多选场景中特别重要
244
- 4. 禁用和加载状态下,卡片不响应点击事件
245
- 5. 建议为每个卡片设置合适的宽度,避免内容溢出
@@ -1,70 +0,0 @@
1
- # JhConfirmDialog - 确认对话框组件
2
-
3
- JhConfirmDialog 基于 Vuetify `v-dialog` 实现,提供统一的确认/取消交互体验,支持异步校验、loading 状态和完全自定义内容,适用于删除、提交、状态切换等需要最终确认的场景。
4
-
5
- ## 功能特性
6
-
7
- - ✅ **标题与内容自定义**:支持传入纯文本、HTML 或通过插槽渲染自定义结构
8
- - ✅ **确认/取消按钮可配置**:文字、颜色、显隐均可通过 props 控制
9
- - ✅ **异步拦截**:`beforeConfirm`、`beforeCancel` 支持返回 `false` 阻断关闭,方便做表单校验
10
- - ✅ **loading 态**:配合 `loading` 属性即可在确认阶段展示加载动画
11
- - ✅ **行为事件齐全**:支持 confirm/cancel/click-outside 等事件,方便接入埋点
12
-
13
- ## 基础用法
14
-
15
- ```vue
16
- <template>
17
- <jh-confirm-dialog
18
- v-model="visible"
19
- title="删除确认"
20
- content="确定要删除这条记录吗?此操作不可恢复。"
21
- :before-confirm="handleBeforeConfirm"
22
- :loading="submitting"
23
- @confirm="handleConfirm"
24
- @cancel="handleCancel"
25
- />
26
- </template>
27
- ```
28
-
29
- ## API
30
-
31
- ### Props
32
-
33
- | 参数 | 说明 | 类型 | 默认值 |
34
- | --- | --- | --- | --- |
35
- | value | v-model,控制对话框显示 | boolean | false |
36
- | title | 标题文本 | string | `提示` |
37
- | content | 内容文本(可包含 HTML) | string | `''` |
38
- | contentClass | 内容区域 class | string | `pa-6 text-pre-line` |
39
- | maxWidth | 最大宽度 | number \| string | 420 |
40
- | showCancelButton | 是否展示取消按钮 | boolean | true |
41
- | confirmButtonText | 确认按钮文案 | string | `确定` |
42
- | cancelButtonText | 取消按钮文案 | string | `取消` |
43
- | confirmButtonColor | 确认按钮颜色 | string | `primary` |
44
- | cancelButtonColor | 取消按钮颜色 | string | `default` |
45
- | persistent | 是否禁止点击遮罩关闭 | boolean | false |
46
- | loading | 确认按钮 loading 状态 | boolean | false |
47
- | beforeConfirm | 确认前钩子,返回 false 阻断关闭 | Function | null |
48
- | beforeCancel | 取消前钩子,返回 false 阻断关闭 | Function | null |
49
-
50
- ### Events
51
-
52
- | 事件名 | 说明 | 回调参数 |
53
- | --- | --- | --- |
54
- | input | `v-model` 双向绑定事件 | (visible: boolean) |
55
- | confirm | 点击确认后触发 | - |
56
- | cancel | 点击取消或遮罩关闭时触发 | - |
57
- | click-outside | 点击遮罩区域触发 | - |
58
-
59
- ### Slots
60
-
61
- | 名称 | 说明 |
62
- | --- | --- |
63
- | title | 自定义标题内容 |
64
- | default | 自定义内容区域 |
65
-
66
- ## 使用建议
67
-
68
- - 需要异步确认时让 `beforeConfirm` 返回 `false`,待操作成功后再手动关闭
69
- - 在危险操作上将 `persistent` 设为 `true`,避免误触关闭
70
- - 自定义内容时可通过插槽输出复杂表单、列表或高亮提示
@@ -1,56 +0,0 @@
1
- # JhDateRangePicker - 日期范围选择器
2
-
3
- JhDateRangePicker 集成快捷日期面板与 `v-date-picker`,可通过一个输入框完成常见时间段选择,适用于报表、统计筛选等场景。
4
-
5
- ## 功能特性
6
-
7
- - 📆 **快捷选择**:内置最近 7/30/90 天、本月、上月、最近一年等常用区间
8
- - 🧭 **所见即所得**:左侧快捷列表 + 右侧日历联动,选择即高亮
9
- - 🧹 **一键清除**:输入框支持 `clearable`,可快速清空区间
10
- - 🧱 **受控组件**:通过 `v-model` 保持外部状态同步,支持 `input/change` 事件
11
- - 🎨 **风格统一**:继承 Vuetify 文本框交互,可配置 `filled/dense/outlined` 等外观
12
-
13
- ## 基础用法
14
-
15
- ```vue
16
- <template>
17
- <jh-date-range-picker
18
- v-model="dateRange"
19
- prefix="时间:"
20
- :filled="false"
21
- outlined
22
- @change="reload"
23
- />
24
- </template>
25
- ```
26
-
27
- ## API
28
-
29
- ### Props
30
-
31
- | 参数 | 说明 | 类型 | 默认值 |
32
- | --- | --- | --- | --- |
33
- | value | v-model 绑定的日期数组,长度为 2 | string[] | [] |
34
- | prefix | 输入框前缀文本 | string | `''` |
35
- | filled | 是否使用 filled 风格 | boolean | true |
36
- | dense | 是否紧凑 | boolean | true |
37
- | outlined | 是否使用 outlined 风格 | boolean | false |
38
- | hideDetails | 是否隐藏 `v-text-field` 底部提示 | boolean | true |
39
- | clearable | 是否展示清空图标 | boolean | true |
40
-
41
- ### Events
42
-
43
- | 事件名 | 说明 | 回调参数 |
44
- | --- | --- | --- |
45
- | input | `v-model` 值变化 | (value: string[]) |
46
- | change | 用户确认或清空时触发 | (value: string[]) |
47
-
48
- ### Slots
49
-
50
- 当前组件不提供插槽。
51
-
52
- ## 使用建议
53
-
54
- - 如果需要自定义默认区间,可在父组件中传入初始 `value` 或监听 `menu` 打开后赋值
55
- - 组件默认返回 `YYYY-MM-DD` 字符串,如需传时间戳可在外层自行转换
56
- - 结合 `JhQueryFilter` 等查询组件可以统一触发搜索逻辑