xt-element-ui 1.2.5 → 1.2.6
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 +72 -0
- package/LICENSE +21 -0
- package/README.md +240 -104
- package/docs/README.md +67 -168
- package/docs/components/extend/ex-chart.md +252 -144
- package/docs/components/extend/ex-icon.md +1 -2
- package/docs/components/extend/ex-page.md +0 -75
- package/lib/index.common.js +375 -529
- package/lib/index.css +1 -1
- package/lib/index.umd.js +375 -529
- package/lib/index.umd.min.js +5 -5
- package/package.json +80 -41
- package/src/components/ex-chart/ExBar.vue +35 -29
- package/src/components/ex-chart/ExLine.vue +23 -14
- package/src/components/ex-chart/ExMulti.vue +30 -52
- package/src/components/ex-chart/ExPie.vue +23 -16
- package/src/components/ex-chart/utils.js +148 -7
- package/src/components/ex-chart/theme/blue.js +0 -91
- package/src/components/ex-chart/theme/orange.js +0 -92
- package/src/components/ex-chart/theme/starry.js +0 -106
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
本项目遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/) 语义化版本。
|
|
4
|
+
|
|
5
|
+
格式说明:
|
|
6
|
+
- `✨` 新功能(Features)
|
|
7
|
+
- `🐛` Bug 修复
|
|
8
|
+
- `🎨` 代码风格/重构
|
|
9
|
+
- `⚡️` 性能优化
|
|
10
|
+
- `📝` 文档
|
|
11
|
+
- `🏗` 构建/CI
|
|
12
|
+
- `♻️` 重构
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## [1.2.5]
|
|
17
|
+
|
|
18
|
+
### ✨ 新功能
|
|
19
|
+
|
|
20
|
+
- **ex-chart**: 四个图表组件(ExBar / ExLine / ExPie / ExMulti)新增 `fieldKeys` prop,支持自定义 `chartData` 字段映射
|
|
21
|
+
- **ex-chart**: 四个图表组件新增 `simpleMode` prop,开启极简模式(隐藏图例、坐标轴等装饰元素)
|
|
22
|
+
- **ex-multi**: `chartData.unit` 支持去重,相同 unit 的 series 共用同一条 Y 轴
|
|
23
|
+
- **ex-table**: 新增虚拟滚动支持,大数据量表格渲染性能优化
|
|
24
|
+
- **ex-table**: 新增合并单元格(span-method)缓存机制,提升滚动性能
|
|
25
|
+
- **ex-icon**: 新增 ExIcon 组件,支持 `el-icon` 字体图标、SVG Sprite、内联 SVG 和自定义字体图标
|
|
26
|
+
|
|
27
|
+
### 🐛 Bug 修复
|
|
28
|
+
|
|
29
|
+
- **ex-chart**: 修复暗色模式下 canvas 背景色为透明的问题,改为黑色
|
|
30
|
+
- **ex-table**: 修复模板中非嵌套列分支引用未定义变量导致页面空白的问题
|
|
31
|
+
- **ex-table**: 修复横向滚动时固定列背景色被文字覆盖的问题
|
|
32
|
+
- **ex-table**: 修复虚拟滚动时 Y 轴滚动条不显示的问题
|
|
33
|
+
- **ex-table**: 修复虚拟滚动初始渲染只显示少量数据的问题,优化 `calcVisibleRange` 计算逻辑
|
|
34
|
+
|
|
35
|
+
### 📝 文档
|
|
36
|
+
|
|
37
|
+
- 新增 ex-table.md 详细文档,包含虚拟滚动、自定义 formatter、列配置等章节
|
|
38
|
+
- 新增 ex-icon.md 图标组件文档
|
|
39
|
+
- 更新 ex-chart.md 文档,按子组件拆分章节并补充 `fieldKeys`、`simpleMode` 等属性说明
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## [1.2.0]
|
|
44
|
+
|
|
45
|
+
### ✨ 新功能
|
|
46
|
+
|
|
47
|
+
- **xt-button**: 新增按钮组件,支持多种类型和尺寸
|
|
48
|
+
- **xt-card / xt-card-item**: 新增卡片容器组件
|
|
49
|
+
- **xt-flex-box / xt-grid-box**: 新增弹性/网格布局组件
|
|
50
|
+
- **xt-text / xt-input**: 新增文本和输入框组件
|
|
51
|
+
- **xt-date-picker**: 新增日期选择组件(支持季度选择)
|
|
52
|
+
- **xt-config-provider**: 新增全局配置提供者,支持主题、尺寸、主色调配置
|
|
53
|
+
- **ex-button / ex-card**: 新增基于 ElementUI 的扩展按钮和卡片组件
|
|
54
|
+
- **ex-chart (ExBar / ExLine / ExPie / ExMulti)**: 新增基于 ECharts 的图表组件族
|
|
55
|
+
- **ex-table**: 新增基于 ElementUI Table 的扩展表格组件
|
|
56
|
+
- **ex-select-tree**: 新增下拉选择树组件
|
|
57
|
+
- **ex-upload**: 新增上传组件(支持图片预览)
|
|
58
|
+
- **ex-page**: 新增页面组件
|
|
59
|
+
|
|
60
|
+
### 🏗 构建
|
|
61
|
+
|
|
62
|
+
- 完善 `vue-cli-service build --target lib` 构建流程,产出 `common.js` / `esm.js` / `umd.min.js` / `css`
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## [1.0.0]
|
|
67
|
+
|
|
68
|
+
### ✨ 新功能
|
|
69
|
+
|
|
70
|
+
- 项目初始化,基于 Vue 2.7 + ElementUI 搭建组件库基础架构
|
|
71
|
+
- 主题系统:支持亮色/暗色主题切换,支持自定义主色调
|
|
72
|
+
- VuePress 文档系统:基于 vuepress-theme-reco 搭建组件文档站
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 XT-Element-UI
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,104 +1,240 @@
|
|
|
1
|
-
# XT-Element-UI
|
|
2
|
-
|
|
3
|
-
> 基于
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
1
|
+
# XT-Element-UI
|
|
2
|
+
|
|
3
|
+
> 基于 Vue 2.7 + ElementUI 的企业级组件库
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/xt-element-ui)
|
|
8
|
+
[](https://www.npmjs.com/package/xt-element-ui)
|
|
9
|
+
[](./LICENSE)
|
|
10
|
+
[](package.json)
|
|
11
|
+
[](https://vuejs.org)
|
|
12
|
+
|
|
13
|
+
📖 [在线文档](https://JobWebNie.github.io/xt-element-ui/) ·
|
|
14
|
+
🐛 [问题反馈](https://github.com/JobWebNie/xt-element-ui/issues) ·
|
|
15
|
+
💡 [功能建议](https://github.com/JobWebNie/xt-element-ui/issues/new?labels=enhancement)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## ✨ 特性
|
|
22
|
+
|
|
23
|
+
- **🎯 丰富的组件**:提供 15+ 组件,覆盖布局、表单、数据展示、图表等常见场景
|
|
24
|
+
- **📦 开箱即用**:基于 ElementUI 构建,与现有 ElementUI 项目无缝集成
|
|
25
|
+
- **🪶 按需引入**:完整的 npm 包架构,支持按需引入,减小打包体积
|
|
26
|
+
- **🎨 双架构设计**:`Xt` 自定义组件 + `Ex` 扩展组件,职责清晰、便于维护
|
|
27
|
+
- **🌓 主题系统**:支持亮色/暗色主题切换,支持自定义主色调
|
|
28
|
+
- **📐 响应式设计**:组件支持多种尺寸配置,适配不同屏幕
|
|
29
|
+
- **📊 图表能力**:内置 ECharts 封装,提供柱状图、折线图、饼图、混合图
|
|
30
|
+
- **⚡️ 虚拟滚动**:表格组件支持虚拟滚动,轻松应对万级数据
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 🚀 快速开始
|
|
35
|
+
|
|
36
|
+
### 安装
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# 使用 npm
|
|
40
|
+
npm install xt-element-ui --save
|
|
41
|
+
|
|
42
|
+
# 使用 yarn
|
|
43
|
+
yarn add xt-element-ui
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> 前置依赖:Vue 2.6+ 或 Vue 2.7+,ElementUI 2.15+
|
|
47
|
+
|
|
48
|
+
### 全局引入
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
import Vue from 'vue'
|
|
52
|
+
import ElementUI from 'element-ui'
|
|
53
|
+
import 'element-ui/lib/theme-chalk/index.css'
|
|
54
|
+
|
|
55
|
+
import XtElementUI from 'xt-element-ui'
|
|
56
|
+
import 'xt-element-ui/lib/index.css'
|
|
57
|
+
|
|
58
|
+
Vue.use(ElementUI)
|
|
59
|
+
Vue.use(XtElementUI)
|
|
60
|
+
|
|
61
|
+
// 配置选项(可选)
|
|
62
|
+
Vue.use(XtElementUI, {
|
|
63
|
+
theme: 'dark', // 主题:'white' 或 'dark'
|
|
64
|
+
size: 'medium', // 组件尺寸:'small' | 'medium' | 'large'
|
|
65
|
+
primaryColor: '#1890ff' // 主色调
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 按需引入
|
|
70
|
+
|
|
71
|
+
```javascript
|
|
72
|
+
import { XtButton, XtFlexBox, ExTable, ExBar } from 'xt-element-ui'
|
|
73
|
+
import 'xt-element-ui/lib/index.css'
|
|
74
|
+
|
|
75
|
+
Vue.component('XtButton', XtButton)
|
|
76
|
+
Vue.component('XtFlexBox', XtFlexBox)
|
|
77
|
+
Vue.component('ExTable', ExTable)
|
|
78
|
+
Vue.component('ExBar', ExBar)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 📦 组件列表
|
|
84
|
+
|
|
85
|
+
### Xt 组件(自定义组件)
|
|
86
|
+
|
|
87
|
+
| 组件 | 说明 |
|
|
88
|
+
|------|------|
|
|
89
|
+
| **XtButton** | 按钮组件 |
|
|
90
|
+
| **XtCard** | 卡片组件 |
|
|
91
|
+
| **XtCardItem** | 卡片项组件 |
|
|
92
|
+
| **XtFlexBox** | 弹性布局组件 |
|
|
93
|
+
| **XtGridBox** | 网格布局组件 |
|
|
94
|
+
| **XtGridItem** | 网格子项组件 |
|
|
95
|
+
| **XtText** | 文本组件 |
|
|
96
|
+
| **XtInput** | 输入框组件 |
|
|
97
|
+
| **XtDatePicker** | 日期选择组件 |
|
|
98
|
+
| **XtConfigProvider** | 全局配置提供器 |
|
|
99
|
+
|
|
100
|
+
### Ex 组件(扩展组件)
|
|
101
|
+
|
|
102
|
+
| 组件 | 说明 |
|
|
103
|
+
|------|------|
|
|
104
|
+
| **ExButton** | 基于 ElementUI Button 的扩展按钮 |
|
|
105
|
+
| **ExCard** | 基于 ElementUI Card 的扩展卡片 |
|
|
106
|
+
| **ExTable** | 基于 ElementUI Table 的扩展表格(支持虚拟滚动) |
|
|
107
|
+
| **ExBar** | 基于 ECharts 的柱状图 |
|
|
108
|
+
| **ExLine** | 基于 ECharts 的折线图 |
|
|
109
|
+
| **ExPie** | 基于 ECharts 的饼图 |
|
|
110
|
+
| **ExMulti** | 基于 ECharts 的混合图表(支持多 Y 轴) |
|
|
111
|
+
| **ExChart** | 图表容器组件 |
|
|
112
|
+
| **ExSelectTree** | 下拉选择树组件 |
|
|
113
|
+
| **ExUpload** | 上传组件(支持图片预览) |
|
|
114
|
+
| **ExPage** | 页面组件 |
|
|
115
|
+
| **ExIcon** | 图标组件(支持 SVG / 字体图标) |
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 🛠 工具函数
|
|
120
|
+
|
|
121
|
+
组件库通过 `this.$xt` 全局挂载以下工具方法:
|
|
122
|
+
|
|
123
|
+
```javascript
|
|
124
|
+
// 设置主题(white / dark)
|
|
125
|
+
this.$xt.setTheme('dark')
|
|
126
|
+
|
|
127
|
+
// 设置全局组件尺寸(small / medium / large)
|
|
128
|
+
this.$xt.setSize('large')
|
|
129
|
+
|
|
130
|
+
// 设置主色调
|
|
131
|
+
this.$xt.setPrimaryColor('#52c41a')
|
|
132
|
+
|
|
133
|
+
// 获取当前配置
|
|
134
|
+
console.log(this.$xt.getConfig())
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 📁 项目结构
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
xt-element-ui/
|
|
143
|
+
├── docs/ # VuePress 文档
|
|
144
|
+
│ ├── README.md # 文档首页
|
|
145
|
+
│ ├── .vuepress/ # VuePress 配置
|
|
146
|
+
│ │ ├── config.js # 主题、导航、侧边栏配置
|
|
147
|
+
│ │ └── enhanceApp.js # 应用增强
|
|
148
|
+
│ └── components/ # 各组件文档
|
|
149
|
+
│ ├── base/ # Xt 系列组件文档
|
|
150
|
+
│ ├── extend/ # Ex 系列组件文档
|
|
151
|
+
│ └── utils/ # 工具类文档
|
|
152
|
+
│
|
|
153
|
+
├── src/ # 组件源码
|
|
154
|
+
│ ├── components/ # 组件目录
|
|
155
|
+
│ │ ├── xt-button/ # 按钮组件
|
|
156
|
+
│ │ ├── xt-card/ # 卡片组件
|
|
157
|
+
│ │ ├── xt-flex-box/ # 弹性布局组件
|
|
158
|
+
│ │ ├── xt-grid-box/ # 网格布局组件
|
|
159
|
+
│ │ ├── xt-text/ # 文本组件
|
|
160
|
+
│ │ ├── xt-input/ # 输入框组件
|
|
161
|
+
│ │ ├── xt-config-provider/ # 配置提供者
|
|
162
|
+
│ │ ├── xt-date-picker/ # 日期选择
|
|
163
|
+
│ │ │
|
|
164
|
+
│ │ ├── ex-button/ # 扩展按钮
|
|
165
|
+
│ │ ├── ex-card/ # 扩展卡片
|
|
166
|
+
│ │ ├── ex-table/ # 扩展表格(含虚拟滚动)
|
|
167
|
+
│ │ ├── ex-chart/ # 图表组件(ExBar/ExLine/ExPie/ExMulti)
|
|
168
|
+
│ │ ├── ex-icon/ # 图标组件
|
|
169
|
+
│ │ ├── ex-select-tree/ # 下拉选择树
|
|
170
|
+
│ │ ├── ex-upload/ # 上传组件
|
|
171
|
+
│ │ └── ex-page/ # 页面组件
|
|
172
|
+
│ │
|
|
173
|
+
│ ├── config/ # 配置模块
|
|
174
|
+
│ ├── styles/ # 全局样式与变量
|
|
175
|
+
│ ├── utils/ # 工具函数
|
|
176
|
+
│ └── index.js # 组件库入口
|
|
177
|
+
│
|
|
178
|
+
├── examples/ # 本地开发示例
|
|
179
|
+
├── lib/ # 构建产物(git 忽略)
|
|
180
|
+
│
|
|
181
|
+
├── .github/ # GitHub 配置
|
|
182
|
+
│ └── workflows/ # CI/CD 工作流
|
|
183
|
+
│ ├── deploy-docs.yml # 自动部署文档到 GitHub Pages
|
|
184
|
+
│ └── publish-npm.yml # 自动发布 npm 包
|
|
185
|
+
│
|
|
186
|
+
├── package.json # 项目配置
|
|
187
|
+
├── .gitignore # Git 忽略文件
|
|
188
|
+
├── README.md # 项目说明
|
|
189
|
+
├── CHANGELOG.md # 更新日志
|
|
190
|
+
├── CONTRIBUTING.md # 贡献指南
|
|
191
|
+
└── LICENSE # 许可证(MIT)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## 🌐 浏览器支持
|
|
197
|
+
|
|
198
|
+
| Chrome | Firefox | Safari | Edge |
|
|
199
|
+
|--------|---------|--------|------|
|
|
200
|
+
| ✅ 最新 2 个版本 | ✅ 最新 2 个版本 | ✅ 10.1+ | ✅ 15+ |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 📚 更多文档
|
|
205
|
+
|
|
206
|
+
- 📖 [完整在线文档](https://JobWebNie.github.io/xt-element-ui/)
|
|
207
|
+
- 📋 [更新日志](./CHANGELOG.md)
|
|
208
|
+
- 🤝 [贡献指南](./CONTRIBUTING.md)
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## 💪 开发
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# 1. 克隆项目
|
|
216
|
+
git clone https://github.com/JobWebNie/xt-element-ui.git
|
|
217
|
+
cd xt-element-ui
|
|
218
|
+
|
|
219
|
+
# 2. 安装依赖
|
|
220
|
+
npm install
|
|
221
|
+
|
|
222
|
+
# 3. 启动本地开发服务器
|
|
223
|
+
npm run dev
|
|
224
|
+
|
|
225
|
+
# 4. 启动文档开发服务器(本地预览文档)
|
|
226
|
+
npm run docs:dev
|
|
227
|
+
|
|
228
|
+
# 5. 构建组件库
|
|
229
|
+
npm run lib
|
|
230
|
+
|
|
231
|
+
# 6. 构建文档(用于部署)
|
|
232
|
+
npm run docs:build
|
|
233
|
+
# 产物位于 docs/.vuepress/dist/
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## 📄 许可证
|
|
239
|
+
|
|
240
|
+
[MIT License](./LICENSE) © 2026 XT-Element-UI Contributors
|