idp-base-components-lib 1.0.2
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/LICENSE +22 -0
- package/README.md +228 -0
- package/dist/idp-base-components-lib.css +5462 -0
- package/dist/index.cjs.js +37547 -0
- package/dist/index.esm.js +37547 -0
- package/dist/index.umd.js +37546 -0
- package/package.json +108 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 IDP Base Components
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# @idp/idp-base-components
|
|
2
|
+
|
|
3
|
+
IDP 基础组件库 - 基于 Vue 3 + Element Plus + vxe-table 构建的企业级组件库
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@idp/idp-base-components)
|
|
6
|
+
[](https://github.com/standandcxs/company-component-library/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
## ✨ 特性
|
|
9
|
+
|
|
10
|
+
- 🚀 基于 Vue 3 Composition API
|
|
11
|
+
- 💎 基于 Element Plus 设计规范
|
|
12
|
+
- 📦 开箱即用的高质量组件
|
|
13
|
+
- 🎨 支持主题定制
|
|
14
|
+
- 🌍 支持国际化
|
|
15
|
+
- 📱 响应式设计
|
|
16
|
+
- 🔧 TypeScript 支持
|
|
17
|
+
- 📖 详细的文档和示例
|
|
18
|
+
|
|
19
|
+
## 📦 安装
|
|
20
|
+
|
|
21
|
+
### npm
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @idp/idp-base-components
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### pnpm
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm add @idp/idp-base-components
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### yarn
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn add @idp/idp-base-components
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🔨 使用
|
|
40
|
+
|
|
41
|
+
### 完整引入
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
import { createApp } from "vue";
|
|
45
|
+
import App from "./App.vue";
|
|
46
|
+
|
|
47
|
+
// 引入组件库
|
|
48
|
+
import IdpComponents from "@idp/idp-base-components";
|
|
49
|
+
// 引入样式
|
|
50
|
+
import "@idp/idp-base-components/dist/style.css";
|
|
51
|
+
|
|
52
|
+
const app = createApp(App);
|
|
53
|
+
|
|
54
|
+
// 全局注册所有组件
|
|
55
|
+
app.use(IdpComponents);
|
|
56
|
+
|
|
57
|
+
app.mount("#app");
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 按需引入
|
|
61
|
+
|
|
62
|
+
```vue
|
|
63
|
+
<template>
|
|
64
|
+
<IdpButton type="primary">按钮</IdpButton>
|
|
65
|
+
<IdpVTable :config="tableConfig" :data="tableData" />
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup>
|
|
69
|
+
import {
|
|
70
|
+
Button as IdpButton,
|
|
71
|
+
VTable as IdpVTable,
|
|
72
|
+
} from "@idp/idp-base-components";
|
|
73
|
+
import "@idp/idp-base-components/dist/style.css";
|
|
74
|
+
|
|
75
|
+
const tableConfig = {
|
|
76
|
+
title: "用户列表",
|
|
77
|
+
columns: [
|
|
78
|
+
{ type: "seq", width: 60, title: "序号" },
|
|
79
|
+
{ field: "name", title: "姓名", width: 120 },
|
|
80
|
+
{ field: "age", title: "年龄", width: 80 },
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const tableData = [
|
|
85
|
+
{ name: "张三", age: 25 },
|
|
86
|
+
{ name: "李四", age: 30 },
|
|
87
|
+
];
|
|
88
|
+
</script>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 📚 组件列表
|
|
92
|
+
|
|
93
|
+
### 基础组件
|
|
94
|
+
|
|
95
|
+
| 组件 | 说明 |
|
|
96
|
+
| ------------------- | ----------------------- |
|
|
97
|
+
| **Button** | 按钮组件 |
|
|
98
|
+
| **Input** | 输入框组件 |
|
|
99
|
+
| **Textarea** | 文本域组件 |
|
|
100
|
+
| **EmailInput** | 邮箱输入框 |
|
|
101
|
+
| **PhoneInput** | 手机号输入框 |
|
|
102
|
+
| **LandlineInput** | 座机号输入框 |
|
|
103
|
+
| **SecureTextInput** | 安全文本输入框 |
|
|
104
|
+
| **Header** | 页头组件 |
|
|
105
|
+
| **Page** | 页面容器组件 |
|
|
106
|
+
| **VTable** | 增强表格组件(⭐ 推荐) |
|
|
107
|
+
| **PascalCase** | 帕斯卡命名组件 |
|
|
108
|
+
|
|
109
|
+
### 业务组件
|
|
110
|
+
|
|
111
|
+
| 组件 | 说明 |
|
|
112
|
+
| ---------- | ---------- |
|
|
113
|
+
| **NavBar** | 导航栏组件 |
|
|
114
|
+
|
|
115
|
+
## 🌟 核心组件介绍
|
|
116
|
+
|
|
117
|
+
### VTable - 增强表格组件
|
|
118
|
+
|
|
119
|
+
功能强大的表格组件,基于 vxe-table 封装。
|
|
120
|
+
|
|
121
|
+
#### 主要特性
|
|
122
|
+
|
|
123
|
+
- 🔍 **搜索功能**:支持 input、select、multiSelect、date、dateRange 等多种搜索字段
|
|
124
|
+
- 📊 **自定义列**:用户可自由选择显示/隐藏列,配置可持久化
|
|
125
|
+
- 🎨 **灵活渲染**:支持插槽、render 函数、默认渲染三种方式
|
|
126
|
+
- 📄 **分页支持**:内置分页器
|
|
127
|
+
- ⚙️ **操作列**:预置操作列,支持预览、下载、重命名、删除等操作
|
|
128
|
+
- 🔘 **行外按钮**:支持预定义按钮和自定义按钮
|
|
129
|
+
- 💾 **持久化**:支持列宽和自定义列持久化
|
|
130
|
+
- 📱 **响应式**:自适应不同屏幕尺寸
|
|
131
|
+
|
|
132
|
+
#### 基础使用
|
|
133
|
+
|
|
134
|
+
```vue
|
|
135
|
+
<template>
|
|
136
|
+
<IdpVTable
|
|
137
|
+
:config="config"
|
|
138
|
+
:data="data"
|
|
139
|
+
:total="100"
|
|
140
|
+
:search-config="searchConfig"
|
|
141
|
+
:show-operation="true"
|
|
142
|
+
@search="handleSearch"
|
|
143
|
+
@linePreview="handlePreview"
|
|
144
|
+
/>
|
|
145
|
+
</template>
|
|
146
|
+
|
|
147
|
+
<script setup>
|
|
148
|
+
import { VTable as IdpVTable } from '@idp/idp-base-components'
|
|
149
|
+
|
|
150
|
+
const config = {
|
|
151
|
+
title: '文件列表',
|
|
152
|
+
columns: [
|
|
153
|
+
{ type: 'seq', width: 60, title: '序号' },
|
|
154
|
+
{ field: 'name', title: '文件名', width: 200 },
|
|
155
|
+
{ field: 'size', title: '大小', width: 100 },
|
|
156
|
+
{ field: 'uploadTime', title: '上传时间', width: 160 },
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const searchConfig = {
|
|
161
|
+
fields: [
|
|
162
|
+
{ field: 'name', label: '文件名', type: 'input' },
|
|
163
|
+
{ field: 'status', label: '状态', type: 'select', options: [...] },
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const data = ref([])
|
|
168
|
+
|
|
169
|
+
const handleSearch = (formData) => {
|
|
170
|
+
console.log('搜索条件:', formData)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const handlePreview = (row) => {
|
|
174
|
+
console.log('预览:', row)
|
|
175
|
+
}
|
|
176
|
+
</script>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## 📖 文档
|
|
180
|
+
|
|
181
|
+
详细文档请查看我们的 [Storybook](https://your-storybook-url.com)
|
|
182
|
+
|
|
183
|
+
## 🔧 本地开发
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# 克隆项目
|
|
187
|
+
git clone https://github.com/standandcxs/company-component-library.git
|
|
188
|
+
|
|
189
|
+
# 安装依赖
|
|
190
|
+
pnpm install
|
|
191
|
+
|
|
192
|
+
# 启动开发服务器
|
|
193
|
+
pnpm serve
|
|
194
|
+
|
|
195
|
+
# 启动 Storybook
|
|
196
|
+
pnpm storybook
|
|
197
|
+
|
|
198
|
+
# 构建组件库
|
|
199
|
+
pnpm build
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## 🤝 贡献
|
|
203
|
+
|
|
204
|
+
欢迎提交 Issue 和 Pull Request!
|
|
205
|
+
|
|
206
|
+
## 📄 License
|
|
207
|
+
|
|
208
|
+
[MIT](./LICENSE)
|
|
209
|
+
|
|
210
|
+
## 👥 维护者
|
|
211
|
+
|
|
212
|
+
- Your Name <your.email@example.com>
|
|
213
|
+
|
|
214
|
+
## 🙏 鸣谢
|
|
215
|
+
|
|
216
|
+
- [Vue 3](https://vuejs.org/)
|
|
217
|
+
- [Element Plus](https://element-plus.org/)
|
|
218
|
+
- [vxe-table](https://vxetable.cn/)
|
|
219
|
+
- [Vite](https://vitejs.dev/)
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
**注意**:本组件库依赖以下包,使用前请确保已安装:
|
|
224
|
+
|
|
225
|
+
- vue >= 3.3.0
|
|
226
|
+
- element-plus >= 2.0.0
|
|
227
|
+
- vxe-pc-ui >= 4.0.0
|
|
228
|
+
- vxe-table >= 4.0.0
|