vxe-table 3.4.14 → 3.4.15

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.
@@ -26,6 +26,20 @@ function updateTipStyle (_vm) {
26
26
  }
27
27
  }
28
28
 
29
+ function showTip (_vm) {
30
+ const { $el, tipStore, zIndex } = _vm
31
+ const parentNode = $el.parentNode
32
+ if (!parentNode) {
33
+ document.body.appendChild($el)
34
+ }
35
+ _vm.updateValue(true)
36
+ _vm.updateZindex()
37
+ tipStore.placement = 'top'
38
+ tipStore.style = { width: 'auto', left: 0, top: 0, zIndex: zIndex || _vm.tipZindex }
39
+ tipStore.arrowStyle = { left: '50%' }
40
+ return _vm.updatePlacement()
41
+ }
42
+
29
43
  export default {
30
44
  name: 'VxeTooltip',
31
45
  mixins: [vSize],
@@ -38,15 +52,16 @@ export default {
38
52
  zIndex: [String, Number],
39
53
  isArrow: { type: Boolean, default: true },
40
54
  enterable: Boolean,
55
+ enterDelay: { type: Number, default: () => GlobalConfig.tooltip.enterDelay },
41
56
  leaveDelay: { type: Number, default: () => GlobalConfig.tooltip.leaveDelay },
42
57
  leaveMethod: Function
43
58
  },
44
59
  data () {
45
60
  return {
46
61
  isUpdate: false,
47
- isHover: false,
48
62
  visible: false,
49
63
  message: '',
64
+ tipActive: false,
50
65
  tipTarget: null,
51
66
  tipZindex: 0,
52
67
  tipStore: {
@@ -67,6 +82,13 @@ export default {
67
82
  this.isUpdate = false
68
83
  }
69
84
  },
85
+ created () {
86
+ this.showDelayTip = XEUtils.debounce(() => {
87
+ if (this.tipActive) {
88
+ showTip(this)
89
+ }
90
+ }, this.enterDelay, { leading: false, trailing: true })
91
+ },
70
92
  mounted () {
71
93
  const { $el, trigger, content, value } = this
72
94
  const parentNode = $el.parentNode
@@ -111,7 +133,7 @@ export default {
111
133
  }
112
134
  },
113
135
  render (h) {
114
- const { $scopedSlots, vSize, theme, message, isHover, isArrow, visible, tipStore, enterable } = this
136
+ const { $scopedSlots, vSize, theme, message, tipActive, isArrow, visible, tipStore, enterable } = this
115
137
  let on
116
138
  if (enterable) {
117
139
  on = {
@@ -126,7 +148,7 @@ export default {
126
148
  'is--enterable': enterable,
127
149
  'is--visible': visible,
128
150
  'is--arrow': isArrow,
129
- 'is--hover': isHover
151
+ 'is--actived': tipActive
130
152
  }],
131
153
  style: tipStore.style,
132
154
  ref: 'tipWrapper',
@@ -147,15 +169,16 @@ export default {
147
169
  },
148
170
  close () {
149
171
  this.tipTarget = null
172
+ this.tipActive = false
150
173
  Object.assign(this.tipStore, {
151
174
  style: {},
152
175
  placement: '',
153
176
  arrowStyle: null
154
177
  })
155
- this.update(false)
178
+ this.updateValue(false)
156
179
  return this.$nextTick()
157
180
  },
158
- update (value) {
181
+ updateValue (value) {
159
182
  if (value !== this.visible) {
160
183
  this.visible = value
161
184
  this.isUpdate = true
@@ -170,23 +193,18 @@ export default {
170
193
  }
171
194
  },
172
195
  toVisible (target, message) {
173
- this.targetActive = true
174
196
  if (target) {
175
- const { $el, tipStore, zIndex } = this
176
- const parentNode = $el.parentNode
177
- if (!parentNode) {
178
- document.body.appendChild($el)
179
- }
197
+ const { trigger, enterDelay } = this
198
+ this.tipActive = true
199
+ this.tipTarget = target
180
200
  if (message) {
181
201
  this.message = message
182
202
  }
183
- this.tipTarget = target
184
- this.update(true)
185
- this.updateZindex()
186
- tipStore.placement = 'top'
187
- tipStore.style = { width: 'auto', left: 0, top: 0, zIndex: zIndex || this.tipZindex }
188
- tipStore.arrowStyle = { left: '50%' }
189
- return this.updatePlacement()
203
+ if (enterDelay && trigger === 'hover') {
204
+ this.showDelayTip()
205
+ } else {
206
+ return showTip(this)
207
+ }
190
208
  }
191
209
  return this.$nextTick()
192
210
  },
@@ -199,6 +217,12 @@ export default {
199
217
  }
200
218
  })
201
219
  },
220
+ isActived () {
221
+ return this.tipActive
222
+ },
223
+ setActived (actived) {
224
+ this.tipActive = !!actived
225
+ },
202
226
  clickEvent () {
203
227
  this[this.visible ? 'close' : 'open']()
204
228
  },
@@ -207,10 +231,10 @@ export default {
207
231
  },
208
232
  targetMouseleaveEvent () {
209
233
  const { trigger, enterable, leaveDelay } = this
210
- this.targetActive = false
234
+ this.tipActive = false
211
235
  if (enterable && trigger === 'hover') {
212
236
  setTimeout(() => {
213
- if (!this.isHover) {
237
+ if (!this.tipActive) {
214
238
  this.close()
215
239
  }
216
240
  }, leaveDelay)
@@ -219,15 +243,15 @@ export default {
219
243
  }
220
244
  },
221
245
  wrapperMouseenterEvent () {
222
- this.isHover = true
246
+ this.tipActive = true
223
247
  },
224
248
  wrapperMouseleaveEvent (evnt) {
225
249
  const { leaveMethod, trigger, enterable, leaveDelay } = this
226
- this.isHover = false
250
+ this.tipActive = false
227
251
  if (!leaveMethod || leaveMethod({ $event: evnt }) !== false) {
228
252
  if (enterable && trigger === 'hover') {
229
253
  setTimeout(() => {
230
- if (!this.targetActive) {
254
+ if (!this.tipActive) {
231
255
  this.close()
232
256
  }
233
257
  }, leaveDelay)
@@ -228,6 +228,7 @@ export default {
228
228
  // size: null,
229
229
  trigger: 'hover',
230
230
  theme: 'dark',
231
+ enterDelay: 500,
231
232
  leaveDelay: 300
232
233
  },
233
234
  pager: {
package/README.en.md DELETED
@@ -1,170 +0,0 @@
1
- # vxe-table
2
-
3
- [简体中文](README.md) | [繁體中文](README.zh-TW.md) | English
4
-
5
- [![star](https://gitee.com/xuliangzhan_admin/vxe-table/badge/star.svg?theme=gvp)](https://gitee.com/xuliangzhan_admin/vxe-table/stargazers)
6
- [![npm version](https://img.shields.io/npm/v/vxe-table.svg?style=flat-square)](https://www.npmjs.com/package/vxe-table)
7
- [![npm build](https://travis-ci.com/x-extends/vxe-table.svg?branch=master)](https://travis-ci.com/x-extends/vxe-table)
8
- [![npm downloads](https://img.shields.io/npm/dt/vxe-table.svg?style=flat-square)](https://npm-stat.com/charts.html?package=vxe-table)
9
- [![issues](https://img.shields.io/github/issues/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/issues)
10
- [![issues closed](https://img.shields.io/github/issues-closed/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/issues?q=is%3Aissue+is%3Aclosed)
11
- [![pull requests](https://img.shields.io/github/issues-pr/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/pulls)
12
- [![pull requests closed](https://img.shields.io/github/issues-pr-closed/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/pulls?q=is%3Apr+is%3Aclosed)
13
- [![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
14
-
15
- A [vue](https://www.npmjs.com/package/vue) based PC form component, support add, delete, change, virtual list, virtual tree, lazy load, shortcut menu, data validation, print export, form rendering, data paging, modal window, custom template, renderer, flexible configuration items, extension interface, etc...
16
-
17
- * Design concept
18
- * Efficient and concise API design for modern browsers
19
- * Modular tables, on-demand loading, extended interfaces
20
- * Designed for single row table editing, supports addition, deletion, modification and query as well as more expansion, with powerful functions and performance at the same time
21
-
22
- ## Browser Support
23
-
24
- ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png)
25
- --- | --- | --- | --- | --- | --- |
26
- 11+ ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 8+ ✔ |
27
-
28
- ## Features
29
-
30
- * [x] Basic table
31
- * [x] Grid
32
- * [x] Striped
33
- * [x] Table with border
34
- * [x] Cell style
35
- * [x] Column resizing
36
- * [x] Maximum table height
37
- * [x] Resize height & width
38
- * [x] Fixed column
39
- * [x] Grouping table header
40
- * [x] Table footer
41
- * [x] Highlight row & column
42
- * [x] Table sequence
43
- * [x] Radio
44
- * [x] Checkbox
45
- * [x] Select
46
- * [x] Switch
47
- * [x] Sorting
48
- * [x] Multi field sorting
49
- * [x] Filter
50
- * [x] Merged cells
51
- * [x] Merged footer items
52
- * [x] Import/Export/Print
53
- * [x] Show/Hide column
54
- * [x] Loading
55
- * [x] Formatted cell
56
- * [x] Slot - template
57
- * [x] Context menu
58
- * [x] Detail - Expandable row
59
- * [x] Pager
60
- * [x] Form
61
- * [x] Toolbar
62
- * [x] Pulldown
63
- * [x] Virtual list
64
- * [x] Virtual tree
65
- * [x] Editable CRUD
66
- * [x] Validate
67
- * [x] Data Proxy
68
- * [x] Keyboard navigation
69
- * [x] Modal
70
- * [x] Renderer
71
- * [x] Virtual scroller
72
- * [x] Virtual merger
73
- * [x] (pro) Cell area selection
74
- * [x] (pro) Cell copy & paste
75
- * [x] (pro) Cell find and replace
76
-
77
- ## Installing
78
-
79
- Version:[vue](https://www.npmjs.com/package/vue) 2.6.x, Dependent: [xe-utils](https://www.npmjs.com/package/xe-utils)
80
-
81
- ```shell
82
- npm install xe-utils vxe-table@3
83
- ```
84
-
85
- Get on [unpkg](https://unpkg.com/vxe-table/) and [cdnjs](https://cdn.jsdelivr.net/npm/vxe-table/)
86
-
87
- ### npm
88
-
89
- ```javascript
90
- import Vue from 'vue'
91
- import 'xe-utils'
92
- import VXETable from 'vxe-table'
93
- import 'vxe-table/lib/style.css'
94
-
95
- Vue.use(VXETable)
96
- ```
97
-
98
- ### CDN
99
-
100
- It is not recommended to use the public CDN address for production, because the connection may fail at any time, causing the project to hang up;
101
- Remember to lock the version number by using CDN to avoid being affected by incompatible updates.
102
-
103
- ```HTML
104
- <!-- Style -->
105
- <link rel="stylesheet" href="https://unpkg.com/vxe-table/lib/style.css">
106
- <!-- Script -->
107
- <script src="https://unpkg.com/xe-utils"></script>
108
- <script src="https://unpkg.com/vxe-table"></script>
109
- ```
110
-
111
- ## Example
112
-
113
- ```html
114
- <template>
115
- <div>
116
- <vxe-table :data="tableData">
117
- <vxe-column type="seq" title="Seq" width="60"></vxe-column>
118
- <vxe-column field="name" title="Name"></vxe-column>
119
- <vxe-colgroup title="Group1">
120
- <vxe-column field="sex" title="Sex"></vxe-column>
121
- <vxe-column field="address" title="Address"></vxe-column>
122
- </vxe-colgroup>
123
- </vxe-table>
124
- </div>
125
- </template>
126
-
127
- <script>
128
- export default {
129
- data () {
130
- return {
131
- tableData: [
132
- { id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', address: 'Shenzhen' },
133
- { id: 10002, name: 'Test2', role: 'Test', sex: 'Man', address: 'Guangzhou' },
134
- { id: 10003, name: 'Test3', role: 'PM', sex: 'Man', address: 'Shanghai' }
135
- ]
136
- }
137
- }
138
- }
139
- </script>
140
- ```
141
-
142
- ## Docs
143
-
144
- 💡 [User guide](https://github.com/xuliangzhan/vxe-table-demo)
145
- 👉 [View example](https://x-extends.github.io/vxe-table/#/table/base/basic)
146
- 👉 [View API](https://x-extends.github.io/vxe-table/#/table/api)
147
-
148
- ## Run the project
149
-
150
- Install dependencies
151
-
152
- ```shell
153
- npm install
154
- ```
155
-
156
- Start local debugging
157
-
158
- ```shell
159
- npm run serve
160
- ```
161
-
162
- Compile packaging, generated compiled directory: lib
163
-
164
- ```shell
165
- npm run lib
166
- ```
167
-
168
- ## License
169
-
170
- [MIT](LICENSE) © 2019-present, Xu Liangzhan
package/README.zh-TW.md DELETED
@@ -1,174 +0,0 @@
1
- # vxe-table
2
-
3
- [简体中文](README.md) | 繁體中文 | [English](README.en.md)
4
-
5
- [![star](https://gitee.com/xuliangzhan_admin/vxe-table/badge/star.svg?theme=gvp)](https://gitee.com/xuliangzhan_admin/vxe-table/stargazers)
6
- [![npm version](https://img.shields.io/npm/v/vxe-table.svg?style=flat-square)](https://www.npmjs.com/package/vxe-table)
7
- [![npm build](https://travis-ci.com/x-extends/vxe-table.svg?branch=master)](https://travis-ci.com/x-extends/vxe-table)
8
- [![npm downloads](https://img.shields.io/npm/dt/vxe-table.svg?style=flat-square)](https://npm-stat.com/charts.html?package=vxe-table)
9
- [![issues](https://img.shields.io/github/issues/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/issues)
10
- [![issues closed](https://img.shields.io/github/issues-closed/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/issues?q=is%3Aissue+is%3Aclosed)
11
- [![pull requests](https://img.shields.io/github/issues-pr/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/pulls)
12
- [![pull requests closed](https://img.shields.io/github/issues-pr-closed/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/pulls?q=is%3Apr+is%3Aclosed)
13
- [![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
14
-
15
- 一個基於 [vue](https://www.npmjs.com/package/vue) 的PC端表格組件,支持增删改查、虛擬清單、虛擬樹、懶加載、快捷選單、數據校驗、列印匯出、表單渲染、數據分頁、彈窗、自定義範本、渲染器、賊靈活的配寘項、擴展接口等…
16
-
17
- * 設計理念
18
- * 面向現代瀏覽器,高效的簡潔 API 設計
19
- * 模組化表格、按需加載、擴展介面
20
- * 為單行編輯表格而設計,支持增删改查及更多擴展,强大的功能的同時兼具效能
21
-
22
- ## QQ 交流群
23
-
24
- ![qq](https://gitee.com/xuliangzhan_admin/vxe-table/raw/master/public/static/donation/qq.png)
25
-
26
- ## 瀏覽器支持
27
-
28
- ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png)
29
- --- | --- | --- | --- | --- | --- |
30
- 11+ ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 8+ ✔ |
31
-
32
- ## 功能點
33
-
34
- * [x] 基礎表格
35
- * [x] 高級表格
36
- * [x] 斑馬線條紋
37
- * [x] 多種邊框
38
- * [x] 儲存格樣式
39
- * [x] 列寬拖動
40
- * [x] 最大高度
41
- * [x] 自我調整寬高
42
- * [x] 固定列
43
- * [x] 多級表頭
44
- * [x] 錶尾數據
45
- * [x] 高亮行或列
46
- * [x] 序號
47
- * [x] 單選框
48
- * [x] 核取方塊
49
- * [x] 下拉選項
50
- * [x] 開關
51
- * [x] 排序
52
- * [x] 多欄位組合排序
53
- * [x] 篩選
54
- * [x] 儲存格合併
55
- * [x] 合併錶尾
56
- * [x] 導入/匯出/列印
57
- * [x] 顯示/隱藏列
58
- * [x] 加載中
59
- * [x] 格式化內容
60
- * [x] 自定義插槽 - 範本
61
- * [x] 快捷選單
62
- * [x] 展開行
63
- * [x] 分頁
64
- * [x] 表單
65
- * [x] 工具列
66
- * [x] 下拉容器
67
- * [x] 虛擬清單
68
- * [x] 虛擬樹
69
- * [x] 增删改查
70
- * [x] 數據校驗
71
- * [x] 數據代理
72
- * [x] 鍵盤導航
73
- * [x] 彈窗
74
- * [x] 渲染器
75
- * [x] 虛擬滾動
76
- * [x] 虛擬合併
77
- * [x] (pro) 儲存格區域選取
78
- * [x] (pro) 儲存格複製/粘貼
79
- * [x] (pro) 儲存格查找和替換
80
-
81
- ## 安裝
82
-
83
- 版本:[vue](https://www.npmjs.com/package/vue) 2.6.x, 依賴庫:[xe-utils](https://www.npmjs.com/package/xe-utils)
84
-
85
- ```shell
86
- npm install xe-utils vxe-table@3
87
- ```
88
-
89
- Get on [unpkg](https://unpkg.com/vxe-table/) and [cdnjs](https://cdn.jsdelivr.net/npm/vxe-table/)
90
-
91
- ### npm
92
-
93
- ```javascript
94
- import Vue from 'vue'
95
- import 'xe-utils'
96
- import VXETable from 'vxe-table'
97
- import 'vxe-table/lib/style.css'
98
-
99
- Vue.use(VXETable)
100
- ```
101
-
102
- ### CDN
103
-
104
- 不建議將公共的CDN地址用於生產,因為該連接隨時都可能會失效,導致項目掛掉;
105
- 使用CDN管道記得鎖定版本號,避免受到非相容性更新的影響
106
-
107
- ```HTML
108
- <!-- 引入樣式 -->
109
- <link rel="stylesheet" href="https://unpkg.com/vxe-table/lib/style.css">
110
- <!-- 引入腳本 -->
111
- <script src="https://unpkg.com/xe-utils"></script>
112
- <script src="https://unpkg.com/vxe-table"></script>
113
- ```
114
-
115
- ## 示例
116
-
117
- ```html
118
- <template>
119
- <div>
120
- <vxe-table :data="tableData">
121
- <vxe-column type="seq" title="Seq" width="60"></vxe-column>
122
- <vxe-column field="name" title="Name"></vxe-column>
123
- <vxe-colgroup title="Group1">
124
- <vxe-column field="sex" title="Sex"></vxe-column>
125
- <vxe-column field="address" title="Address"></vxe-column>
126
- </vxe-colgroup>
127
- </vxe-table>
128
- </div>
129
- </template>
130
-
131
- <script>
132
- export default {
133
- data () {
134
- return {
135
- tableData: [
136
- { id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', address: 'Shenzhen' },
137
- { id: 10002, name: 'Test2', role: 'Test', sex: 'Man', address: 'Guangzhou' },
138
- { id: 10003, name: 'Test3', role: 'PM', sex: 'Man', address: 'Shanghai' }
139
- ]
140
- }
141
- }
142
- }
143
- </script>
144
- ```
145
-
146
- ## 檔案
147
-
148
- 💡 [使用指南](https://github.com/xuliangzhan/vxe-table-demo)
149
- 👉 [查看檔案](https://xuliangzhan_admin.gitee.io/vxe-table/) [👀備用地址1](https://x-extends.github.io/vxe-table/#/table/base/basic)
150
- 👉 [查看檔案](https://xuliangzhan_admin.gitee.io/vxe-table/#/table/api) [👀備用地址1](https://x-extends.github.io/vxe-table/#/table/api)
151
-
152
- ## 運行項目
153
-
154
- 安裝依賴
155
-
156
- ```shell
157
- npm install
158
- ```
159
-
160
- 啓動本地調試
161
-
162
- ```shell
163
- npm run serve
164
- ```
165
-
166
- 編譯打包,生成編譯後的目錄:lib
167
-
168
- ```shell
169
- npm run lib
170
- ```
171
-
172
- ## License
173
-
174
- [MIT](LICENSE) © 2019-present, Xu Liangzhan