@yetuzi/vue3-query-components 1.1.38 → 1.2.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/CHANGELOG.md +105 -0
- package/README.md +127 -68
- package/dist/index.css +1 -1
- package/dist/index.d.ts +481 -74
- package/dist/index.js +944 -953
- package/dist/index.js.map +1 -1
- package/dist/version-info.json +28 -0
- package/package.json +89 -79
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
## [1.2.0] - 2025-01-06
|
|
4
|
+
|
|
5
|
+
### 优化
|
|
6
|
+
- ✨ CommonForm - 优化类型命名,提升代码可读性
|
|
7
|
+
- `CommonFormPropForm` → `CommonFormItemArray`
|
|
8
|
+
- `CommonFormSupplement` → `CommonFormItemBase`
|
|
9
|
+
- `CommonFormCustomComponentsItem` → `CommonFormCustomItem`
|
|
10
|
+
- ✨ CommonTable - 优化类型命名,与 CommonForm 保持一致
|
|
11
|
+
- `TableColumnSupplement` → `TableColumnBase`
|
|
12
|
+
- 📝 为所有类型定义添加详细的 JSDoc 注释
|
|
13
|
+
- 📝 添加类型参数说明和使用示例
|
|
14
|
+
- 📝 改善 IDE 智能提示体验
|
|
15
|
+
|
|
16
|
+
### 文档
|
|
17
|
+
- 📝 优化文档内容和结构
|
|
18
|
+
- 📝 添加 CSS 引入说明
|
|
19
|
+
- 📝 修复文档中的无效 demo 标签
|
|
20
|
+
|
|
21
|
+
### 修复
|
|
22
|
+
- 🔧 替换 sass 为 sass-embedded,解决 Dart Sass 弃用警告
|
|
23
|
+
- 🔧 更新依赖锁定文件
|
|
24
|
+
|
|
25
|
+
## [1.1.38] - 2024-12-XX
|
|
26
|
+
|
|
27
|
+
### 重构
|
|
28
|
+
- ♻️ 重构 CommonTable 类型系统
|
|
29
|
+
- ♻️ 重构 CommonForm 类型系统
|
|
30
|
+
|
|
31
|
+
### 新增
|
|
32
|
+
- 🔧 添加 vue-component-type-helpers 依赖
|
|
33
|
+
|
|
34
|
+
## [1.0.4] - 2024-12-11
|
|
35
|
+
|
|
36
|
+
### 修复
|
|
37
|
+
- 🔧 修复 Element Plus 组件样式缺失问题
|
|
38
|
+
- 📝 为所有组件手动添加对应的 Element Plus CSS 导入
|
|
39
|
+
|
|
40
|
+
### 优化
|
|
41
|
+
- ✨ CommonQueryTable - 添加 ElLoading 样式
|
|
42
|
+
- ✨ CommonTable - 添加 ElTable、ElEmpty、ElTableColumn 样式
|
|
43
|
+
- ✨ CommonForm - 添加 ElForm、ElFormItem、ElButton 样式
|
|
44
|
+
- ✨ CommonInput - 添加 ElInput 样式
|
|
45
|
+
- ✨ CommonSelect - 添加 ElSelect、ElOption 样式
|
|
46
|
+
- ✨ CommonDatePicker - 添加 ElDatePicker 样式
|
|
47
|
+
- ✨ CommonPagination - 添加 ElPagination 样式
|
|
48
|
+
- ✨ CommonRadio - 添加 ElRadioGroup、ElRadio 样式
|
|
49
|
+
- ✨ CommonCheckbox - 添加 ElCheckboxGroup、ElCheckbox 样式
|
|
50
|
+
- ✨ CommonSwitch - 添加 ElSwitch 样式
|
|
51
|
+
- ✨ CommonButton - 添加 ElButton 样式
|
|
52
|
+
|
|
53
|
+
## [1.0.1] - 2024-12-10
|
|
54
|
+
|
|
55
|
+
### 更新
|
|
56
|
+
- 📝 更新 README.md 包名引用
|
|
57
|
+
- ✨ 完善文档和使用示例
|
|
58
|
+
- 🔧 优化组件配置系统
|
|
59
|
+
|
|
60
|
+
## [1.0.0] - 2024-12-09
|
|
61
|
+
|
|
62
|
+
### 新增
|
|
63
|
+
- 🎉 vue3-query-components 初始版本发布
|
|
64
|
+
- ✨ CommonTable 查询表格组件
|
|
65
|
+
- 支持分页配置
|
|
66
|
+
- 支持自定义表头样式
|
|
67
|
+
- 支持数据加载状态
|
|
68
|
+
- 支持空数据占位符
|
|
69
|
+
- ✨ CommonForm 通用表单组件
|
|
70
|
+
- 支持多种表单控件类型
|
|
71
|
+
- 支持表单验证
|
|
72
|
+
- 支持搜索和重置功能
|
|
73
|
+
- 支持自定义布局
|
|
74
|
+
- 🔧 工具函数库
|
|
75
|
+
- 日期格式化工具
|
|
76
|
+
- 数据处理工具
|
|
77
|
+
- 通用验证工具
|
|
78
|
+
- 🎯 Vue 3 Composition API Hooks
|
|
79
|
+
- useTable 表格 hooks
|
|
80
|
+
- useForm 表单 hooks
|
|
81
|
+
- useHttp 请求 hooks
|
|
82
|
+
- 📦 TypeScript 支持
|
|
83
|
+
- 完整的类型定义
|
|
84
|
+
- 类型推导支持
|
|
85
|
+
- 🎨 Element Plus 主题集成
|
|
86
|
+
- 自定义主题配置
|
|
87
|
+
- 响应式设计支持
|
|
88
|
+
|
|
89
|
+
### 技术栈
|
|
90
|
+
- Vue 3.5+
|
|
91
|
+
- Element Plus 2.11+
|
|
92
|
+
- TypeScript 5.9+
|
|
93
|
+
- Vite 6.0+
|
|
94
|
+
- alova 3.3+ (HTTP 客户端)
|
|
95
|
+
- dayjs 1.11+ (日期处理)
|
|
96
|
+
- lodash-es 4.17+ (工具函数)
|
|
97
|
+
- vue-hooks-plus 2.4+ (Vue Hooks)
|
|
98
|
+
|
|
99
|
+
### 特性
|
|
100
|
+
- 📦 开箱即用
|
|
101
|
+
- 🎨 基于 Element Plus 设计
|
|
102
|
+
- 🔧 高度可配置
|
|
103
|
+
- 📝 TypeScript 支持
|
|
104
|
+
- 🌳 树摇优化
|
|
105
|
+
- 🔥 热更新支持(开发模式)
|
package/README.md
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
# @yetuzi/vue3-query-components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
**企业级查询页面组件库**
|
|
6
|
+
|
|
7
|
+
专为 Vue3 设计的高效查询组件,提升开发效率
|
|
8
|
+
|
|
9
|
+
[](../../LICENSE)
|
|
10
|
+
[](https://vuejs.org/)
|
|
11
|
+
[](https://www.typescriptlang.org/)
|
|
12
|
+
[](https://element-plus.org/)
|
|
13
|
+
[](https://www.npmjs.com/package/@yetuzi/vue3-query-components)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
4
16
|
|
|
5
17
|
## ✨ 特性
|
|
6
18
|
|
|
7
|
-
- 🚀
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- 🎯 **业务导向** - 专注于查询、表单、表格等常见业务场景
|
|
14
|
-
- 🔄 **状态管理** - 内置数据请求、分页、表单状态管理
|
|
15
|
-
- 🎨 **插槽支持** - 灵活的插槽系统,支持自定义扩展
|
|
19
|
+
- 🚀 **一体化查询** - CommonQueryTable 集成表单、表格、分页,一个组件即可构建完整的查询页面,支持灵活的布局配置
|
|
20
|
+
- 📋 **类型安全** - 完整的 TypeScript 泛型支持,列类型、表单项类型自动推导,提供精准的类型提示和校验
|
|
21
|
+
- 🎨 **高度可定制** - 响应式全局配置系统,支持自定义组件、插槽和样式扩展,满足各种业务场景需求
|
|
22
|
+
- 🧩 **丰富组件** - 提供 CommonTable(多种列类型)、CommonForm(7种表单项)及完整的基础组件体系
|
|
23
|
+
- ⚡️ **开箱即用** - 基于 Element Plus 封装,API 设计一致,学习成本低,大幅提升开发效率
|
|
24
|
+
- 🛠️ **实用工具** - 内置 useResettable 等实用 hooks,提供可重置的响应式数据管理能力
|
|
16
25
|
|
|
17
26
|
## 📦 安装
|
|
18
27
|
|
|
@@ -26,17 +35,24 @@ pnpm add @yetuzi/vue3-query-components
|
|
|
26
35
|
|
|
27
36
|
## 🚀 快速开始
|
|
28
37
|
|
|
29
|
-
### 1.
|
|
38
|
+
### 1. 安装 Element Plus
|
|
30
39
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
本组件库基于 Element Plus 封装,需要先安装 Element Plus:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install element-plus
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 2. 导入样式
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
**重要**:本组件库不会自动导入 CSS,需要手动导入:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
// 导入组件库样式
|
|
52
|
+
import '@yetuzi/vue3-query-components/dist/index.css'
|
|
37
53
|
```
|
|
38
54
|
|
|
39
|
-
###
|
|
55
|
+
### 3. 按需引入组件
|
|
40
56
|
|
|
41
57
|
```typescript
|
|
42
58
|
import {
|
|
@@ -45,11 +61,9 @@ import {
|
|
|
45
61
|
CommonForm,
|
|
46
62
|
CommonConfigProvider,
|
|
47
63
|
} from '@yetuzi/vue3-query-components'
|
|
48
|
-
import '@yetuzi/vue3-query-components/dist/style.css'
|
|
49
|
-
import 'element-plus/theme-chalk/index.css' // 需要安装 Element Plus
|
|
50
64
|
```
|
|
51
65
|
|
|
52
|
-
###
|
|
66
|
+
### 4. 基础使用
|
|
53
67
|
|
|
54
68
|
#### 完整查询表格组件(推荐)
|
|
55
69
|
|
|
@@ -189,7 +203,39 @@ const queryTableConfig = {
|
|
|
189
203
|
</script>
|
|
190
204
|
```
|
|
191
205
|
|
|
192
|
-
## 📚
|
|
206
|
+
## 📚 组件列表
|
|
207
|
+
|
|
208
|
+
### 核心组件
|
|
209
|
+
|
|
210
|
+
| 组件名 | 说明 |
|
|
211
|
+
|--------|------|
|
|
212
|
+
| `CommonQueryTable` | 一体化查询表格,集成表单、表格、分页 |
|
|
213
|
+
| `CommonTable` | 增强型表格组件,支持多种列类型 |
|
|
214
|
+
| `CommonForm` | 动态表单组件,支持 7 种表单项 |
|
|
215
|
+
| `CommonConfigProvider` | 全局配置组件,提供统一的组件配置 |
|
|
216
|
+
|
|
217
|
+
### 基础组件
|
|
218
|
+
|
|
219
|
+
| 组件名 | 说明 |
|
|
220
|
+
|--------|------|
|
|
221
|
+
| `CommonInput` | 输入框组件 |
|
|
222
|
+
| `CommonSelect` | 下拉选择组件 |
|
|
223
|
+
| `CommonDatePicker` | 日期选择器组件 |
|
|
224
|
+
| `CommonRadio` | 单选框组件 |
|
|
225
|
+
| `CommonCheckbox` | 复选框组件 |
|
|
226
|
+
| `CommonSwitch` | 开关组件 |
|
|
227
|
+
| `CommonButton` | 按钮组件 |
|
|
228
|
+
| `CommonPagination` | 分页组件 |
|
|
229
|
+
|
|
230
|
+
### Hooks
|
|
231
|
+
|
|
232
|
+
| Hook 名 | 说明 |
|
|
233
|
+
|---------|------|
|
|
234
|
+
| `useResettableRef` | 创建可重置的 ref |
|
|
235
|
+
| `useResettableReactive` | 创建可重置的 reactive |
|
|
236
|
+
| `useGetComponentsChildrenSlots` | 获取组件子插槽 |
|
|
237
|
+
|
|
238
|
+
## 📚 API 文档
|
|
193
239
|
|
|
194
240
|
### CommonQueryTable Props
|
|
195
241
|
|
|
@@ -202,14 +248,30 @@ const queryTableConfig = {
|
|
|
202
248
|
|
|
203
249
|
### 表单组件类型支持
|
|
204
250
|
|
|
205
|
-
|
|
251
|
+
CommonForm 支持以下 7 种内置表单项类型:
|
|
206
252
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
253
|
+
| 组件类型 | 说明 | 用途 |
|
|
254
|
+
|---------|------|------|
|
|
255
|
+
| `input` | 输入框 | 文本、数字等简单输入 |
|
|
256
|
+
| `select` | 下拉选择 | 单选下拉选项 |
|
|
257
|
+
| `date-picker` | 日期选择器 | 日期、日期时间范围选择 |
|
|
258
|
+
| `radio` | 单选框组 | 互斥选项选择 |
|
|
259
|
+
| `check-box` | 复选框组 | 多选选项 |
|
|
260
|
+
| `switch` | 开关 | 二元状态切换 |
|
|
261
|
+
| 自定义组件 | 任意 Vue 组件 | 扩展自定义表单项 |
|
|
262
|
+
|
|
263
|
+
### 表格列类型支持
|
|
264
|
+
|
|
265
|
+
CommonTable 支持多种特殊列类型:
|
|
266
|
+
|
|
267
|
+
| 列类型 | 说明 | 使用场景 |
|
|
268
|
+
|--------|------|----------|
|
|
269
|
+
| `index` | 索引列 | 自动显示行号 |
|
|
270
|
+
| `selection` | 选择列 | 多选功能 |
|
|
271
|
+
| `expand` | 展开列 | 行内容展开 |
|
|
272
|
+
| `date` | 日期列 | 自动格式化日期显示 |
|
|
273
|
+
| `dateTime` | 日期时间列 | 自动格式化日期时间显示 |
|
|
274
|
+
| 普通列 | 数据列 | 绑定字段数据 |
|
|
213
275
|
|
|
214
276
|
### 表单配置项类型
|
|
215
277
|
|
|
@@ -284,56 +346,53 @@ interface TableColumn {
|
|
|
284
346
|
|
|
285
347
|
### 环境要求
|
|
286
348
|
|
|
287
|
-
- Node.js >=
|
|
349
|
+
- Node.js >= 16.0.0
|
|
288
350
|
- Vue 3.5+
|
|
289
351
|
- Element Plus 2.11+
|
|
290
352
|
- TypeScript 5.9+
|
|
291
353
|
|
|
292
|
-
###
|
|
293
|
-
|
|
294
|
-
```bash
|
|
295
|
-
# 克隆项目
|
|
296
|
-
git clone https://gitee.com/yetuzi/vue3-common.git
|
|
297
|
-
cd vue3-common/vue3-query-components
|
|
298
|
-
|
|
299
|
-
# 安装依赖
|
|
300
|
-
npm install
|
|
301
|
-
|
|
302
|
-
# 开发模式(构建并监听文件变化)
|
|
303
|
-
npm run dev
|
|
304
|
-
|
|
305
|
-
# 构建
|
|
306
|
-
npm run build
|
|
307
|
-
|
|
308
|
-
# 类型检查
|
|
309
|
-
npm run type-check
|
|
310
|
-
|
|
311
|
-
# 代码格式化
|
|
312
|
-
npm run format
|
|
354
|
+
### 依赖说明
|
|
313
355
|
|
|
314
|
-
|
|
315
|
-
npm run lint
|
|
356
|
+
#### Peer Dependencies(需要宿主项目安装)
|
|
316
357
|
|
|
317
|
-
|
|
318
|
-
|
|
358
|
+
```json
|
|
359
|
+
{
|
|
360
|
+
"peerDependencies": {
|
|
361
|
+
"vue": "^3.5.0",
|
|
362
|
+
"element-plus": "^2.11.5"
|
|
363
|
+
}
|
|
364
|
+
}
|
|
319
365
|
```
|
|
320
366
|
|
|
321
|
-
|
|
367
|
+
#### Dependencies(随组件库一起安装)
|
|
322
368
|
|
|
323
369
|
```json
|
|
324
370
|
{
|
|
325
|
-
"peerDependencies": {
|
|
326
|
-
"vue": "^3.5.0", // Vue 3 - 需要宿主项目安装
|
|
327
|
-
"element-plus": "^2.11.5" // Element Plus UI 库 - 需要宿主项目安装
|
|
328
|
-
},
|
|
329
371
|
"dependencies": {
|
|
330
|
-
"dayjs": "^1.11.18",
|
|
331
|
-
"lodash-es": "^4.17.21",
|
|
332
|
-
"vue-hooks-plus": "^2.4.1"
|
|
372
|
+
"dayjs": "^1.11.18",
|
|
373
|
+
"lodash-es": "^4.17.21",
|
|
374
|
+
"vue-hooks-plus": "^2.4.1"
|
|
333
375
|
}
|
|
334
376
|
}
|
|
335
377
|
```
|
|
336
378
|
|
|
379
|
+
### 构建产物
|
|
380
|
+
|
|
381
|
+
组件库构建后生成以下文件:
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
dist/
|
|
385
|
+
├── index.js # ES Module 格式的组件代码
|
|
386
|
+
├── index.d.ts # TypeScript 类型声明文件
|
|
387
|
+
├── index.css # 组件库样式文件
|
|
388
|
+
└── index.js.map # Source Map 文件
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**重要说明**:
|
|
392
|
+
- 组件库采用 ES Module 格式输出
|
|
393
|
+
- 不会自动导入 CSS,需要手动导入样式文件
|
|
394
|
+
- Vue 和 Element Plus 被外部化,不会打包进组件库(减小体积)
|
|
395
|
+
|
|
337
396
|
## 🎯 使用场景
|
|
338
397
|
|
|
339
398
|
本组件库特别适用于:
|
|
@@ -347,14 +406,14 @@ npm test
|
|
|
347
406
|
|
|
348
407
|
[MIT](./LICENSE)
|
|
349
408
|
|
|
350
|
-
##
|
|
409
|
+
## 📞 支持与反馈
|
|
351
410
|
|
|
352
|
-
|
|
411
|
+
如有问题或建议,请提交 [Issue](https://gitee.com/yetuzi/vue3-common/issues)
|
|
353
412
|
|
|
354
|
-
##
|
|
413
|
+
## 🗺️ 更新日志
|
|
355
414
|
|
|
356
|
-
|
|
415
|
+
查看详细的更新日志:[CHANGELOG.md](./CHANGELOG.md)
|
|
357
416
|
|
|
358
|
-
|
|
417
|
+
---
|
|
359
418
|
|
|
360
|
-
|
|
419
|
+
Made with ❤️ by [yetuzi](https://gitee.com/yetuzi)
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.common-query-table[data-v-a726f75e]{--spacing: 15px;width:100%;height:100%;flex:1;display:flex;flex-direction:column;box-sizing:border-box;padding:var(--spacing) 12px;overflow:hidden}[class^=common-query-table-][data-v-a726f75e]{width:100%}[class^=common-query-table-]+[class^=common-query-table-][data-v-a726f75e]{margin-top:var(--spacing)}.common-query-table .common-query-table-table[data-v-a726f75e]{flex:1;overflow:hidden}.el-form[data-v-
|
|
1
|
+
.common-query-table[data-v-a726f75e]{--spacing: 15px;width:100%;height:100%;flex:1;display:flex;flex-direction:column;box-sizing:border-box;padding:var(--spacing) 12px;overflow:hidden}[class^=common-query-table-][data-v-a726f75e]{width:100%}[class^=common-query-table-]+[class^=common-query-table-][data-v-a726f75e]{margin-top:var(--spacing)}.common-query-table .common-query-table-table[data-v-a726f75e]{flex:1;overflow:hidden}.el-form[data-v-dfc558ab]{margin-bottom:-18px!important}.el-form .el-form-item[data-v-dfc558ab] .el-form-item__content{width:var(--a5bfb0ac)}.el-form .el-form-item[data-v-dfc558ab] .el-select,.el-form .el-form-item[data-v-dfc558ab] .el-input,.el-form .el-form-item[data-v-dfc558ab] .el-date-editor{width:100%}.common-table[data-v-4dc3e15a]{width:100%;height:100%;display:flex;flex-direction:column}
|