vxe-table 3.7.0-beta.0 → 3.7.0-beta.10

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 (189) hide show
  1. package/README.md +6 -9
  2. package/helper/vetur/attributes.json +86 -22
  3. package/helper/vetur/tags.json +17 -1
  4. package/lib/button/src/button.js +9 -3
  5. package/lib/button/src/button.min.js +1 -1
  6. package/lib/edit/src/mixin.js +10 -10
  7. package/lib/edit/src/mixin.min.js +1 -1
  8. package/lib/export/src/mixin.js +24 -13
  9. package/lib/export/src/mixin.min.js +1 -1
  10. package/lib/filter/src/mixin.js +13 -7
  11. package/lib/filter/src/mixin.min.js +1 -1
  12. package/lib/form/src/form.js +27 -5
  13. package/lib/form/src/form.min.js +1 -1
  14. package/lib/grid/src/grid.js +7 -3
  15. package/lib/grid/src/grid.min.js +1 -1
  16. package/lib/icon/style/style.css +1 -1
  17. package/lib/icon/style/style.min.css +1 -1
  18. package/lib/index.css +1 -1
  19. package/lib/index.umd.js +544 -229
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/input/src/input.js +11 -1
  22. package/lib/input/src/input.min.js +1 -1
  23. package/lib/locale/lang/en-US.js +8 -0
  24. package/lib/locale/lang/en-US.min.js +1 -1
  25. package/lib/locale/lang/en-US.umd.js +8 -0
  26. package/lib/locale/lang/es-ES.js +8 -0
  27. package/lib/locale/lang/es-ES.min.js +1 -1
  28. package/lib/locale/lang/es-ES.umd.js +8 -0
  29. package/lib/locale/lang/ja-JP.d.ts +1 -1
  30. package/lib/locale/lang/ja-JP.js +8 -0
  31. package/lib/locale/lang/ja-JP.min.js +1 -1
  32. package/lib/locale/lang/ja-JP.umd.js +8 -0
  33. package/lib/locale/lang/pt-BR.d.ts +8 -0
  34. package/lib/locale/lang/pt-BR.js +330 -0
  35. package/lib/locale/lang/pt-BR.min.js +1 -0
  36. package/lib/locale/lang/pt-BR.umd.js +344 -0
  37. package/lib/locale/lang/zh-CN.d.ts +1 -1
  38. package/lib/locale/lang/zh-CN.js +8 -0
  39. package/lib/locale/lang/zh-CN.min.js +1 -1
  40. package/lib/locale/lang/zh-CN.umd.js +8 -0
  41. package/lib/locale/lang/zh-HK.d.ts +1 -1
  42. package/lib/locale/lang/zh-HK.min.js +1 -1
  43. package/lib/locale/lang/zh-HK.umd.js +8 -0
  44. package/lib/locale/lang/zh-MO.d.ts +1 -1
  45. package/lib/locale/lang/zh-MO.min.js +1 -1
  46. package/lib/locale/lang/zh-MO.umd.js +8 -0
  47. package/lib/locale/lang/zh-TC.d.ts +1 -1
  48. package/lib/locale/lang/zh-TC.js +8 -0
  49. package/lib/locale/lang/zh-TC.min.js +1 -1
  50. package/lib/locale/lang/zh-TC.umd.js +8 -0
  51. package/lib/locale/lang/zh-TW.d.ts +1 -1
  52. package/lib/locale/lang/zh-TW.min.js +1 -1
  53. package/lib/locale/lang/zh-TW.umd.js +8 -0
  54. package/lib/menu/src/mixin.js +3 -3
  55. package/lib/menu/src/mixin.min.js +1 -1
  56. package/lib/pulldown/src/pulldown.js +11 -2
  57. package/lib/pulldown/src/pulldown.min.js +1 -1
  58. package/lib/select/src/select.js +11 -2
  59. package/lib/select/src/select.min.js +1 -1
  60. package/lib/style.css +1 -1
  61. package/lib/style.min.css +1 -1
  62. package/lib/table/src/body.js +3 -2
  63. package/lib/table/src/body.min.js +1 -1
  64. package/lib/table/src/cell.js +9 -7
  65. package/lib/table/src/cell.min.js +1 -1
  66. package/lib/table/src/columnInfo.js +7 -7
  67. package/lib/table/src/columnInfo.min.js +1 -1
  68. package/lib/table/src/methods.js +171 -124
  69. package/lib/table/src/methods.min.js +1 -1
  70. package/lib/table/src/table.js +22 -29
  71. package/lib/table/src/table.min.js +1 -1
  72. package/lib/table/src/util.js +3 -1
  73. package/lib/table/src/util.min.js +1 -1
  74. package/lib/table/style/style.css +7 -2
  75. package/lib/table/style/style.min.css +1 -1
  76. package/lib/textarea/src/textarea.js +6 -1
  77. package/lib/textarea/src/textarea.min.js +1 -1
  78. package/lib/toolbar/src/toolbar.js +23 -7
  79. package/lib/toolbar/src/toolbar.min.js +1 -1
  80. package/lib/tools/log.js +1 -1
  81. package/lib/tools/log.min.js +1 -1
  82. package/lib/tooltip/src/tooltip.js +5 -1
  83. package/lib/tooltip/src/tooltip.min.js +1 -1
  84. package/lib/tooltip/style/style.css +0 -6
  85. package/lib/tooltip/style/style.min.css +1 -1
  86. package/lib/v-x-e-table/index.js +3 -1
  87. package/lib/v-x-e-table/index.min.js +1 -1
  88. package/lib/v-x-e-table/src/commands.js +60 -2
  89. package/lib/v-x-e-table/src/commands.min.js +1 -1
  90. package/lib/v-x-e-table/src/conf.js +7 -4
  91. package/lib/v-x-e-table/src/conf.min.js +1 -1
  92. package/lib/v-x-e-table/src/formats.js +60 -2
  93. package/lib/v-x-e-table/src/formats.min.js +1 -1
  94. package/lib/v-x-e-table/src/menus.js +60 -2
  95. package/lib/v-x-e-table/src/menus.min.js +1 -1
  96. package/lib/v-x-e-table/src/renderer.js +10 -0
  97. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  98. package/lib/v-x-e-table/src/store.js +5 -2
  99. package/lib/v-x-e-table/src/store.min.js +1 -1
  100. package/lib/v-x-e-table/src/validators.js +15 -0
  101. package/lib/v-x-e-table/src/validators.min.js +1 -0
  102. package/lib/validator/src/mixin.js +36 -4
  103. package/lib/validator/src/mixin.min.js +1 -1
  104. package/package.json +2 -2
  105. package/packages/button/src/button.js +5 -4
  106. package/packages/edit/src/mixin.js +10 -9
  107. package/packages/export/src/mixin.js +22 -13
  108. package/packages/filter/src/mixin.js +5 -1
  109. package/packages/form/src/form.js +27 -6
  110. package/packages/grid/src/grid.js +7 -3
  111. package/packages/input/src/input.js +9 -1
  112. package/packages/locale/lang/en-US.js +8 -0
  113. package/packages/locale/lang/es-ES.js +8 -0
  114. package/packages/locale/lang/ja-JP.d.ts +1 -1
  115. package/packages/locale/lang/ja-JP.js +8 -0
  116. package/packages/locale/lang/pt-BR.d.ts +8 -0
  117. package/packages/locale/lang/pt-BR.js +323 -0
  118. package/packages/locale/lang/zh-CN.d.ts +1 -1
  119. package/packages/locale/lang/zh-CN.js +8 -0
  120. package/packages/locale/lang/zh-HK.d.ts +1 -1
  121. package/packages/locale/lang/zh-MO.d.ts +1 -1
  122. package/packages/locale/lang/zh-TC.d.ts +1 -1
  123. package/packages/locale/lang/zh-TC.js +8 -0
  124. package/packages/locale/lang/zh-TW.d.ts +1 -1
  125. package/packages/menu/src/mixin.js +3 -3
  126. package/packages/pulldown/src/pulldown.js +6 -3
  127. package/packages/select/src/select.js +7 -3
  128. package/packages/table/src/body.js +3 -2
  129. package/packages/table/src/cell.js +9 -5
  130. package/packages/table/src/columnInfo.js +7 -7
  131. package/packages/table/src/methods.js +142 -93
  132. package/packages/table/src/table.js +17 -7
  133. package/packages/table/src/util.js +3 -1
  134. package/packages/textarea/src/textarea.js +4 -1
  135. package/packages/toolbar/src/toolbar.js +22 -7
  136. package/packages/tooltip/src/tooltip.js +3 -2
  137. package/packages/v-x-e-table/index.js +2 -0
  138. package/packages/v-x-e-table/src/commands.js +50 -2
  139. package/packages/v-x-e-table/src/conf.js +7 -4
  140. package/packages/v-x-e-table/src/formats.js +50 -2
  141. package/packages/v-x-e-table/src/menus.js +50 -2
  142. package/packages/v-x-e-table/src/renderer.js +11 -1
  143. package/packages/v-x-e-table/src/store.js +4 -2
  144. package/packages/v-x-e-table/src/validators.js +7 -0
  145. package/packages/validator/src/mixin.js +35 -4
  146. package/styles/all.scss +30 -0
  147. package/styles/css-variable.scss +272 -0
  148. package/styles/cssvar.scss +2 -275
  149. package/styles/index.scss +2 -0
  150. package/styles/modules.scss +4 -1
  151. package/styles/table.scss +11 -4
  152. package/styles/tooltip.scss +0 -8
  153. package/styles/variable.scss +1 -4
  154. package/types/all.d.ts +2 -2
  155. package/types/colgroup.d.ts +3 -1
  156. package/types/column.d.ts +3 -0
  157. package/types/edit.d.ts +4 -2
  158. package/types/export.d.ts +3 -0
  159. package/types/filter.d.ts +3 -1
  160. package/types/footer.d.ts +3 -1
  161. package/types/form-item.d.ts +2 -0
  162. package/types/form.d.ts +16 -12
  163. package/types/grid.d.ts +3 -0
  164. package/types/header.d.ts +3 -1
  165. package/types/index.d.ts +1 -1
  166. package/types/input.d.ts +2 -0
  167. package/types/list.d.ts +1 -1
  168. package/types/menu.d.ts +2 -0
  169. package/types/modal.d.ts +7 -3
  170. package/types/pulldown.d.ts +2 -3
  171. package/types/table.d.ts +54 -30
  172. package/types/textarea.d.ts +1 -0
  173. package/types/toolbar.d.ts +2 -0
  174. package/types/tooltip.d.ts +1 -1
  175. package/types/v-x-e-table/commands.d.ts +23 -13
  176. package/types/v-x-e-table/formats.d.ts +21 -12
  177. package/types/v-x-e-table/index.d.ts +33 -26
  178. package/types/v-x-e-table/interceptor.d.ts +1 -1
  179. package/types/v-x-e-table/menus.d.ts +17 -6
  180. package/types/v-x-e-table/renderer.d.ts +5 -3
  181. package/types/v-x-e-table/setup.d.ts +10 -33
  182. package/types/v-x-e-table/validators.d.ts +30 -0
  183. package/types/validator.d.ts +15 -4
  184. /package/lib/icon/style/{iconfont.1688918886373.ttf → iconfont.1690849077922.ttf} +0 -0
  185. /package/lib/icon/style/{iconfont.1688918886373.woff → iconfont.1690849077922.woff} +0 -0
  186. /package/lib/icon/style/{iconfont.1688918886373.woff2 → iconfont.1690849077922.woff2} +0 -0
  187. /package/lib/{iconfont.1688918886373.ttf → iconfont.1690849077922.ttf} +0 -0
  188. /package/lib/{iconfont.1688918886373.woff → iconfont.1690849077922.woff} +0 -0
  189. /package/lib/{iconfont.1688918886373.woff2 → iconfont.1690849077922.woff2} +0 -0
package/README.md CHANGED
@@ -10,17 +10,13 @@
10
10
  [![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)
11
11
  [![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
12
12
 
13
- 一个基于 [vue](https://www.npmjs.com/package/vue) 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、贼灵活的配置项等...
13
+ 一个基于 [vue](https://www.npmjs.com/package/vue) 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式为零代码而设计...
14
14
 
15
15
  * 设计理念
16
16
  * 面向现代浏览器,高效的简洁 API 设计
17
17
  * 模块化表格、按需加载
18
18
  * 为单行编辑表格而设计,支持增删改查及更多扩展,强大的功能的同时兼具性能
19
19
 
20
- ## QQ 交流群
21
-
22
- ![qq](https://vxetable.cn/static/donation/qq.png)
23
-
24
20
  ## 浏览器支持
25
21
 
26
22
  ![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)
@@ -31,11 +27,13 @@
31
27
 
32
28
  * [x] 基础表格
33
29
  * [x] 高级表格
30
+ * [x] 基础表单
31
+ * [x] 配置式表单
34
32
  * [x] 斑马线条纹
35
33
  * [x] 多种边框
36
34
  * [x] 单元格样式
37
35
  * [x] 列宽拖动
38
- * [x] 最大高度
36
+ * [x] 最小/最大高度
39
37
  * [x] 自适应宽高
40
38
  * [x] 固定列
41
39
  * [x] 多级表头
@@ -59,7 +57,6 @@
59
57
  * [x] 快捷菜单
60
58
  * [x] 展开行
61
59
  * [x] 分页
62
- * [x] 表单
63
60
  * [x] 工具栏
64
61
  * [x] 下拉容器
65
62
  * [x] 虚拟列表
@@ -103,10 +100,10 @@ Vue.use(VXETable)
103
100
 
104
101
  ```HTML
105
102
  <!-- 引入样式 -->
106
- <link rel="stylesheet" href="https://unpkg.com/vxe-table/lib/style.css">
103
+ <link rel="stylesheet" href="https://unpkg.com/vxe-table@legacy/lib/style.css">
107
104
  <!-- 引入脚本 -->
108
105
  <script src="https://unpkg.com/xe-utils"></script>
109
- <script src="https://unpkg.com/vxe-table"></script>
106
+ <script src="https://unpkg.com/vxe-table@legacy"></script>
110
107
  ```
111
108
 
112
109
  ## 示例
@@ -3,6 +3,10 @@
3
3
  "type": "string",
4
4
  "description": "图标名称"
5
5
  },
6
+ "vxe-icon/roll": {
7
+ "type": "boolean",
8
+ "description": "旋转动画"
9
+ },
6
10
  "vxe-table/id": {
7
11
  "type": "string",
8
12
  "description": "唯一标识(被某些特定的功能所依赖)"
@@ -191,6 +195,10 @@
191
195
  "type": "any",
192
196
  "description": "行配置信息"
193
197
  },
198
+ "vxe-table/resize-config": {
199
+ "type": "object",
200
+ "description": "响应式布局配置项"
201
+ },
194
202
  "vxe-table/resizable-config": {
195
203
  "type": "object",
196
204
  "description": "列宽拖动配置项"
@@ -233,15 +241,15 @@
233
241
  },
234
242
  "vxe-table/expand-config": {
235
243
  "type": "any",
236
- "description": "展开行配置项(不能用于虚拟滚动)"
244
+ "description": "展开行配置项(不支持虚拟滚动)"
237
245
  },
238
246
  "vxe-table/tree-config": {
239
247
  "type": "any",
240
- "description": "树形结构配置项(不能用于虚拟滚动)"
248
+ "description": "树形结构配置项"
241
249
  },
242
250
  "vxe-table/menu-config": {
243
251
  "type": "any",
244
- "description": "快捷菜单配置项"
252
+ "description": "右键菜单配置项"
245
253
  },
246
254
  "vxe-table/clip-config": {
247
255
  "type": "any",
@@ -283,6 +291,10 @@
283
291
  "type": "any",
284
292
  "description": "空内容渲染配置项,empty-render 的优先级大于 empty-text"
285
293
  },
294
+ "vxe-table/loading-config": {
295
+ "type": "any",
296
+ "description": "加载中配置项"
297
+ },
286
298
  "vxe-table/custom-config": {
287
299
  "type": "any",
288
300
  "description": "自定义列配置项"
@@ -349,7 +361,7 @@
349
361
  },
350
362
  "vxe-column/type": {
351
363
  "type": "string",
352
- "description": "列的类型"
364
+ "description": "列的类型(部分功能需要设置 column-config.useKey | row-config.useKey)"
353
365
  },
354
366
  "vxe-column/field": {
355
367
  "type": "string",
@@ -421,47 +433,51 @@
421
433
  },
422
434
  "vxe-column/sortable": {
423
435
  "type": "boolean",
424
- "description": "是否允许列排序"
436
+ "description": "数据排序,是否允许列排序"
425
437
  },
426
438
  "vxe-column/sort-by": {
427
439
  "type": "string | (({ row, column }) => string | number)",
428
- "description": "只对 sortable 有效,指定排序的字段(当值 formatter 格式化后,可以设置该字段,使用值进行排序)"
440
+ "description": "数据排序,只对 sortable 有效,指定排序的字段(当值 formatter 格式化后,可以设置该字段,使用值进行排序)"
429
441
  },
430
442
  "vxe-column/sort-type": {
431
443
  "type": "string",
432
- "description": "排序的字段类型,比如字符串转数值等"
444
+ "description": "数据排序,排序的字段类型,比如字符串转数值等"
433
445
  },
434
446
  "vxe-column/filters": {
435
447
  "type": "any[]",
436
- "description": "配置筛选条件(注:筛选只能用于列表,如果是树结构则过滤根节点)"
448
+ "description": "数据筛选,配置筛选条件(注:筛选只能用于列表,如果是树结构则过滤根节点)"
437
449
  },
438
450
  "vxe-column/filter-multiple": {
439
451
  "type": "boolean",
440
- "description": "只对 filters 有效,筛选是否允许多选"
452
+ "description": "数据筛选,只对 filters 有效,筛选是否允许多选"
441
453
  },
442
454
  "vxe-column/filter-method": {
443
455
  "type": "({ value, option, cellvalue, row, column }) => boolean",
444
- "description": "只对 filters 有效,列的筛选方法,该方法的返回值用来决定该行是否显示"
456
+ "description": "数据筛选,只对 filters 有效,列的筛选方法,该方法的返回值用来决定该行是否显示"
445
457
  },
446
458
  "vxe-column/filter-reset-method": {
447
459
  "type": "({ options, column }) => void",
448
- "description": "只对 filters 有效,自定义筛选重置方法"
460
+ "description": "数据筛选,只对 filters 有效,自定义筛选重置方法"
449
461
  },
450
462
  "vxe-column/filter-recover-method": {
451
463
  "type": "({ option, column }) => void",
452
- "description": "只对 filters 有效,自定义筛选复原方法(使用自定义筛选时可能会用到)"
464
+ "description": "数据筛选,只对 filters 有效,自定义筛选复原方法(使用自定义筛选时可能会用到)"
453
465
  },
454
466
  "vxe-column/filter-render": {
455
467
  "type": "any",
456
- "description": "筛选渲染器配置项"
468
+ "description": "数据筛选,筛选渲染器配置项"
469
+ },
470
+ "vxe-column/header-export-method": {
471
+ "type": "({ column, options }) => string",
472
+ "description": "自定义表头单元格数据导出方法,返回自定义的标题"
457
473
  },
458
474
  "vxe-column/export-method": {
459
475
  "type": "function",
460
- "description": "自定义单元格数据导出方法,该方法 Function({ row, column }) 的返回值将会被导出"
476
+ "description": "自定义单元格数据导出方法,该方法 Function({ row, column, options }) 的返回值将会被导出"
461
477
  },
462
478
  "vxe-column/footer-export-method": {
463
479
  "type": "function",
464
- "description": "自定义表尾单元格数据导出方法,该方法 Function({ items, _columnIndex }) 的返回值将会被导出"
480
+ "description": "自定义表尾单元格数据导出方法,该方法 Function({ items, _columnIndex, options }) 的返回值将会被导出"
465
481
  },
466
482
  "vxe-column/title-help": {
467
483
  "type": "any",
@@ -497,7 +513,7 @@
497
513
  },
498
514
  "vxe-column/col-id": {
499
515
  "type": "string | number",
500
- "description": "自定义列的唯一主键(注:99%的场景不应该设置,操作不正确将导致出现问题)"
516
+ "description": "自定义列的唯一主键(注:列主键必须确保唯一,操作不正确将导致出现问题)"
501
517
  },
502
518
  "vxe-grid/id": {
503
519
  "type": "string",
@@ -691,6 +707,10 @@
691
707
  "type": "any",
692
708
  "description": "行配置信息"
693
709
  },
710
+ "vxe-grid/resize-config": {
711
+ "type": "object",
712
+ "description": "响应式布局配置项"
713
+ },
694
714
  "vxe-grid/resizable-config": {
695
715
  "type": "object",
696
716
  "description": "列宽拖动配置项"
@@ -733,15 +753,15 @@
733
753
  },
734
754
  "vxe-grid/expand-config": {
735
755
  "type": "any",
736
- "description": "展开行配置项(不能用于虚拟滚动)"
756
+ "description": "展开行配置项(不支持虚拟滚动)"
737
757
  },
738
758
  "vxe-grid/tree-config": {
739
759
  "type": "any",
740
- "description": "树形结构配置项(不能用于虚拟滚动)"
760
+ "description": "树形结构配置项"
741
761
  },
742
762
  "vxe-grid/menu-config": {
743
763
  "type": "any",
744
- "description": "快捷菜单配置项"
764
+ "description": "右键菜单配置项"
745
765
  },
746
766
  "vxe-grid/clip-config": {
747
767
  "type": "any",
@@ -783,6 +803,10 @@
783
803
  "type": "any",
784
804
  "description": "空内容渲染配置项,empty-render 的优先级大于 empty-text"
785
805
  },
806
+ "vxe-grid/loading-config": {
807
+ "type": "any",
808
+ "description": "加载中配置项"
809
+ },
786
810
  "vxe-grid/custom-config": {
787
811
  "type": "any",
788
812
  "description": "自定义列配置项"
@@ -1043,6 +1067,10 @@
1043
1067
  "type": "any[]",
1044
1068
  "description": "v-model 绑定值"
1045
1069
  },
1070
+ "vxe-checkbox-group/max": {
1071
+ "type": "string, number",
1072
+ "description": "限制最大可选数量,默认无限制"
1073
+ },
1046
1074
  "vxe-checkbox-group/size": {
1047
1075
  "type": "string",
1048
1076
  "description": "尺寸"
@@ -1223,6 +1251,10 @@
1223
1251
  "type": "any",
1224
1252
  "description": "v-model 绑定值"
1225
1253
  },
1254
+ "vxe-select/max": {
1255
+ "type": "string, number",
1256
+ "description": "限制最大可选数量,默认无限制"
1257
+ },
1226
1258
  "vxe-select/size": {
1227
1259
  "type": "string",
1228
1260
  "description": "尺寸"
@@ -1245,7 +1277,11 @@
1245
1277
  },
1246
1278
  "vxe-select/class-name": {
1247
1279
  "type": "string | (({}) => string)",
1248
- "description": "给下拉框附加 className"
1280
+ "description": "给选择器附加 className"
1281
+ },
1282
+ "vxe-select/popup-class-name": {
1283
+ "type": "string | (({}) => string)",
1284
+ "description": "给下拉容器附加 className"
1249
1285
  },
1250
1286
  "vxe-select/visible": {
1251
1287
  "type": "boolean",
@@ -1356,8 +1392,12 @@
1356
1392
  "description": "用来标识这一项"
1357
1393
  },
1358
1394
  "vxe-button/class-name": {
1359
- "type": "string",
1360
- "description": "附加 className"
1395
+ "type": "string | (({}) => string)",
1396
+ "description": "给展示容器附加 className"
1397
+ },
1398
+ "vxe-button/popup-class-name": {
1399
+ "type": "string | (({}) => string)",
1400
+ "description": "给下拉容器附加 className"
1361
1401
  },
1362
1402
  "vxe-button/icon": {
1363
1403
  "type": "string",
@@ -1411,6 +1451,10 @@
1411
1451
  "type": "string",
1412
1452
  "description": "主题样式"
1413
1453
  },
1454
+ "vxe-tooltip/popup-class-name": {
1455
+ "type": "string | (({}) => string)",
1456
+ "description": "给下拉容器附加 className"
1457
+ },
1414
1458
  "vxe-tooltip/z-index": {
1415
1459
  "type": "number",
1416
1460
  "description": "自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)"
@@ -1699,10 +1743,22 @@
1699
1743
  "type": "string | boolean",
1700
1744
  "description": "标题内容过长时显示为省略号"
1701
1745
  },
1746
+ "vxe-form-item/show-title": {
1747
+ "type": "boolean",
1748
+ "description": "是否显示标题"
1749
+ },
1702
1750
  "vxe-form-item/class-name": {
1703
1751
  "type": "string, ({ field, data }) => string",
1704
1752
  "description": "给表单项附加 className"
1705
1753
  },
1754
+ "vxe-form-item/content-class-name": {
1755
+ "type": "string, ({ field, data }) => string",
1756
+ "description": "给表单项内容附加 className"
1757
+ },
1758
+ "vxe-form-item/content-style": {
1759
+ "type": "{ [name: string]: string }, ({ field, data }) => string",
1760
+ "description": "给表单项内容附加样式"
1761
+ },
1706
1762
  "vxe-form-item/visible": {
1707
1763
  "type": "boolean",
1708
1764
  "description": "默认是否显示"
@@ -1783,6 +1839,14 @@
1783
1839
  "type": "string",
1784
1840
  "description": "尺寸"
1785
1841
  },
1842
+ "vxe-pulldown/class-name": {
1843
+ "type": "string | (({}) => string)",
1844
+ "description": "给展示容器附加 className"
1845
+ },
1846
+ "vxe-pulldown/popup-class-name": {
1847
+ "type": "string | (({}) => string)",
1848
+ "description": "给下拉容器附加 className"
1849
+ },
1786
1850
  "vxe-pulldown/disabled": {
1787
1851
  "type": "boolean",
1788
1852
  "description": "是否禁用"
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "vxe-icon": {
3
3
  "attributes": [
4
- "name"
4
+ "name",
5
+ "roll"
5
6
  ],
6
7
  "description": "图标"
7
8
  },
@@ -54,6 +55,7 @@
54
55
  "keep-source",
55
56
  "column-config",
56
57
  "row-config",
58
+ "resize-config",
57
59
  "resizable-config",
58
60
  "seq-config",
59
61
  "sort-config",
@@ -77,6 +79,7 @@
77
79
  "edit-rules",
78
80
  "empty-text",
79
81
  "empty-render",
82
+ "loading-config",
80
83
  "custom-config",
81
84
  "scroll-x",
82
85
  "scroll-y",
@@ -137,6 +140,7 @@
137
140
  "filter-reset-method",
138
141
  "filter-recover-method",
139
142
  "filter-render",
143
+ "header-export-method",
140
144
  "export-method",
141
145
  "footer-export-method",
142
146
  "title-help",
@@ -201,6 +205,7 @@
201
205
  "keep-source",
202
206
  "column-config",
203
207
  "row-config",
208
+ "resize-config",
204
209
  "resizable-config",
205
210
  "seq-config",
206
211
  "sort-config",
@@ -224,6 +229,7 @@
224
229
  "edit-rules",
225
230
  "empty-text",
226
231
  "empty-render",
232
+ "loading-config",
227
233
  "custom-config",
228
234
  "scroll-x",
229
235
  "scroll-y",
@@ -328,6 +334,7 @@
328
334
  "vxe-checkbox-group": {
329
335
  "attributes": [
330
336
  "value",
337
+ "max",
331
338
  "size",
332
339
  "disabled"
333
340
  ],
@@ -391,12 +398,14 @@
391
398
  "vxe-select": {
392
399
  "attributes": [
393
400
  "value",
401
+ "max",
394
402
  "size",
395
403
  "multiple",
396
404
  "multi-char-overflow",
397
405
  "clearable",
398
406
  "placeholder",
399
407
  "class-name",
408
+ "popup-class-name",
400
409
  "visible",
401
410
  "disabled",
402
411
  "prefix-icon",
@@ -447,6 +456,7 @@
447
456
  "size",
448
457
  "name",
449
458
  "class-name",
459
+ "popup-class-name",
450
460
  "icon",
451
461
  "round",
452
462
  "circle",
@@ -465,6 +475,7 @@
465
475
  "content",
466
476
  "trigger",
467
477
  "theme",
478
+ "popup-class-name",
468
479
  "z-index",
469
480
  "is-arrow",
470
481
  "enterable",
@@ -555,7 +566,10 @@
555
566
  "title-colon",
556
567
  "title-asterisk",
557
568
  "title-overflow",
569
+ "show-title",
558
570
  "class-name",
571
+ "content-class-name",
572
+ "content-style",
559
573
  "visible",
560
574
  "visible-method",
561
575
  "folding",
@@ -591,6 +605,8 @@
591
605
  "attributes": [
592
606
  "model-value",
593
607
  "size",
608
+ "class-name",
609
+ "popup-class-name",
594
610
  "disabled",
595
611
  "placement",
596
612
  "destroy-on-close",
@@ -36,7 +36,8 @@ var _default2 = {
36
36
  disabled: Boolean,
37
37
  loading: Boolean,
38
38
  destroyOnClose: Boolean,
39
- className: String,
39
+ className: [String, Function],
40
+ popupClassName: [String, Function],
40
41
  transfer: {
41
42
  type: Boolean,
42
43
  "default": function _default() {
@@ -86,6 +87,7 @@ var _default2 = {
86
87
  var $scopedSlots = this.$scopedSlots,
87
88
  $listeners = this.$listeners,
88
89
  className = this.className,
90
+ popupClassName = this.popupClassName,
89
91
  inited = this.inited,
90
92
  type = this.type,
91
93
  destroyOnClose = this.destroyOnClose,
@@ -101,7 +103,9 @@ var _default2 = {
101
103
  panelPlacement = this.panelPlacement;
102
104
  var downsSlot = $scopedSlots.dropdowns;
103
105
  return downsSlot ? h('div', {
104
- "class": ['vxe-button--dropdown', className, (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--active', showPanel), _ref)]
106
+ "class": ['vxe-button--dropdown', className ? _xeUtils["default"].isFunction(className) ? className({
107
+ $button: this
108
+ }) : className : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--active', showPanel), _ref)]
105
109
  }, [h('button', {
106
110
  ref: 'xBtn',
107
111
  "class": ['vxe-button', "type--".concat(btnType), (_ref2 = {}, _defineProperty(_ref2, "size--".concat(vSize), vSize), _defineProperty(_ref2, "theme--".concat(status), status), _defineProperty(_ref2, 'is--round', this.round), _defineProperty(_ref2, 'is--circle', this.circle), _defineProperty(_ref2, 'is--disabled', disabled || loading), _defineProperty(_ref2, 'is--loading', loading), _ref2)],
@@ -124,7 +128,9 @@ var _default2 = {
124
128
  "class": "vxe-button--dropdown-arrow ".concat(_conf["default"].icon.BUTTON_DROPDOWN)
125
129
  })])), h('div', {
126
130
  ref: 'panel',
127
- "class": ['vxe-button--dropdown-panel', (_ref3 = {}, _defineProperty(_ref3, "size--".concat(vSize), vSize), _defineProperty(_ref3, 'animat--leave', animatVisible), _defineProperty(_ref3, 'animat--enter', showPanel), _ref3)],
131
+ "class": ['vxe-button--dropdown-panel', popupClassName ? _xeUtils["default"].isFunction(popupClassName) ? popupClassName({
132
+ $button: this
133
+ }) : popupClassName : '', (_ref3 = {}, _defineProperty(_ref3, "size--".concat(vSize), vSize), _defineProperty(_ref3, 'animat--leave', animatVisible), _defineProperty(_ref3, 'animat--enter', showPanel), _ref3)],
128
134
  attrs: {
129
135
  placement: panelPlacement
130
136
  },
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event");function _getRequireWildcardCache(e){var t,n;return"function"!=typeof WeakMap?null:(t=new WeakMap,n=new WeakMap,(_getRequireWildcardCache=function(e){return e?n:t})(e))}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var n,i,o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&((i=s?Object.getOwnPropertyDescriptor(e,n):null)&&(i.get||i.set)?Object.defineProperty(o,n,i):o[n]=e[n]);return o.default=e,t&&t.set(e,o),o}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _default2={name:"VxeButton",mixins:[_size.default],props:{type:String,size:{type:String,default:function(){return _conf.default.button.size||_conf.default.size}},name:[String,Number],content:String,placement:String,status:String,icon:String,round:Boolean,circle:Boolean,disabled:Boolean,loading:Boolean,destroyOnClose:Boolean,className:String,transfer:{type:Boolean,default:function(){return _conf.default.button.transfer}}},data:function(){return{inited:!1,showPanel:!1,animatVisible:!1,panelIndex:0,panelStyle:null,panelPlacement:null}},computed:{isText:function(){return"text"===this.type},isFormBtn:function(){return-1<["submit","reset","button"].indexOf(this.type)},btnType:function(){return this.isText?this.type:"button"}},created:function(){_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent)},beforeDestroy:function(){var e=this.$refs.panel;e&&e.parentNode&&e.parentNode.removeChild(e)},destroyed:function(){_event.GlobalEvent.off(this,"mousewheel")},render:function(e){var t,n=this,i=this.$scopedSlots,o=this.$listeners,s=this.className,r=this.inited,a=this.type,u=this.destroyOnClose,l=this.isFormBtn,c=this.status,d=this.btnType,f=this.vSize,p=this.name,h=this.disabled,m=this.loading,b=this.showPanel,v=this.animatVisible,y=this.panelPlacement,i=i.dropdowns;return i?e("div",{class:["vxe-button--dropdown",s,(_defineProperty(t={},"size--".concat(f),f),_defineProperty(t,"is--active",b),t)]},[e("button",{ref:"xBtn",class:["vxe-button","type--".concat(d),(_defineProperty(t={},"size--".concat(f),f),_defineProperty(t,"theme--".concat(c),c),_defineProperty(t,"is--round",this.round),_defineProperty(t,"is--circle",this.circle),_defineProperty(t,"is--disabled",h||m),_defineProperty(t,"is--loading",m),t)],attrs:{name:p,type:l?a:"button",disabled:h||m},on:Object.assign({mouseenter:this.mouseenterTargetEvent,mouseleave:this.mouseleaveEvent},_xeUtils.default.objectMap(o,function(e,t){return function(e){return n.$emit(t,{$event:e})}}))},this.renderContent(e).concat([e("i",{class:"vxe-button--dropdown-arrow ".concat(_conf.default.icon.BUTTON_DROPDOWN)})])),e("div",{ref:"panel",class:["vxe-button--dropdown-panel",(_defineProperty(t={},"size--".concat(f),f),_defineProperty(t,"animat--leave",v),_defineProperty(t,"animat--enter",b),t)],attrs:{placement:y},style:this.panelStyle},r?[e("div",{class:"vxe-button--dropdown-wrapper",on:{mousedown:this.mousedownDropdownEvent,click:this.clickDropdownEvent,mouseenter:this.mouseenterEvent,mouseleave:this.mouseleaveEvent}},u&&!b?[]:i.call(this,{},e))]:null)]):e("button",{ref:"xBtn",class:["vxe-button","type--".concat(d),s,(_defineProperty(v={},"size--".concat(f),f),_defineProperty(v,"theme--".concat(c),c),_defineProperty(v,"is--round",this.round),_defineProperty(v,"is--circle",this.circle),_defineProperty(v,"is--disabled",h||m),_defineProperty(v,"is--loading",m),v)],attrs:{name:p,type:l?a:"button",disabled:h||m},on:_xeUtils.default.objectMap(o,function(e,t){return function(e){return n.$emit(t,{$event:e})}})},this.renderContent(e))},methods:{renderContent:function(e){var t=this.$scopedSlots,n=this.content,i=this.icon,o=[];return this.loading?o.push(e("i",{class:["vxe-button--loading-icon",_conf.default.icon.BUTTON_LOADING]})):t.icon?o.push(e("span",{class:"vxe-button--custom-icon"},t.icon.call(this,{}))):i&&o.push(e("i",{class:["vxe-button--icon",i]})),t.default?o.push(e("span",{class:"vxe-button--content"},t.default.call(this,{}))):n&&o.push(e("span",{class:"vxe-button--content"},[(0,_utils.getFuncText)(n)])),o},handleGlobalMousewheelEvent:function(e){this.showPanel&&!_dom.default.getEventTargetNode(e,this.$refs.panel).flag&&this.closePanel()},updateZindex:function(){this.panelIndex<_utils.default.getLastZIndex()&&(this.panelIndex=_utils.default.nextZIndex())},mousedownDropdownEvent:function(e){0===e.button&&e.stopPropagation()},clickDropdownEvent:function(e){var t=this,n=e.currentTarget,i=this.$refs.panel,n=_dom.default.getEventTargetNode(e,n,"vxe-button"),o=n.flag,n=n.targetElem;o&&(i&&(i.dataset.active="N"),this.showPanel=!1,setTimeout(function(){i&&"Y"===i.dataset.active||(t.animatVisible=!1)},350),this.$emit("dropdown-click",{name:n.getAttribute("name"),$event:e}))},mouseenterTargetEvent:function(){var e=this,t=this.$refs.panel;t.dataset.active="Y",this.inited||(this.inited=!0,this.transfer&&document.body.appendChild(t)),this.showTime=setTimeout(function(){"Y"===t.dataset.active?e.mouseenterEvent():e.animatVisible=!1},250)},mouseenterEvent:function(){var e=this,t=this.$refs.panel;t.dataset.active="Y",this.animatVisible=!0,setTimeout(function(){"Y"===t.dataset.active&&(e.showPanel=!0,e.updateZindex(),e.updatePlacement(),setTimeout(function(){e.showPanel&&e.updatePlacement()},50))},20)},mouseleaveEvent:function(){this.closePanel()},closePanel:function(){var e=this,t=this.$refs.panel;clearTimeout(this.showTime),t?(t.dataset.active="N",setTimeout(function(){"Y"!==t.dataset.active&&(e.showPanel=!1,setTimeout(function(){"Y"!==t.dataset.active&&(e.animatVisible=!1)},350))},100)):(this.animatVisible=!1,this.showPanel=!1)},updatePlacement:function(){var p=this;return this.$nextTick().then(function(){var e,t,n,i,o,s,r,a,u=p.$refs,l=p.transfer,c=p.placement,d=p.panelIndex,f=u.xBtn,u=u.panel;if(u&&f)return e=f.offsetHeight,t=f.offsetWidth,n=u.offsetHeight,u=u.offsetWidth,d={zIndex:d},a=(f=_dom.default.getAbsolutePos(f)).top,i=f.left,o=f.boundingTop,s=f.visibleHeight,f=f.visibleWidth,r="bottom",l?(l=a+e,"top"===c?(r="top",l=a-n):c||(s<o+e+n+5&&(r="top",l=a-n),l<5&&(r="bottom",l=a+e)),f<(a=i+t-u)+u+5&&(a-=a+u+5-f),a<5&&(a=5),Object.assign(d,{left:"".concat(a,"px"),right:"auto",top:"".concat(l,"px"),minWidth:"".concat(t,"px")})):"top"===c?(r="top",d.bottom="".concat(e,"px")):c||s<o+e+n&&5<o-e-n&&(r="top",d.bottom="".concat(e,"px")),p.panelStyle=d,p.panelPlacement=r,p.$nextTick()})},focus:function(){return this.$el.focus(),this.$nextTick()},blur:function(){return this.$el.blur(),this.$nextTick()}}};exports.default=_default2;
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event");function _getRequireWildcardCache(e){var t,n;return"function"!=typeof WeakMap?null:(t=new WeakMap,n=new WeakMap,(_getRequireWildcardCache=function(e){return e?n:t})(e))}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var n,i,o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&((i=s?Object.getOwnPropertyDescriptor(e,n):null)&&(i.get||i.set)?Object.defineProperty(o,n,i):o[n]=e[n]);return o.default=e,t&&t.set(e,o),o}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _default2={name:"VxeButton",mixins:[_size.default],props:{type:String,size:{type:String,default:function(){return _conf.default.button.size||_conf.default.size}},name:[String,Number],content:String,placement:String,status:String,icon:String,round:Boolean,circle:Boolean,disabled:Boolean,loading:Boolean,destroyOnClose:Boolean,className:[String,Function],popupClassName:[String,Function],transfer:{type:Boolean,default:function(){return _conf.default.button.transfer}}},data:function(){return{inited:!1,showPanel:!1,animatVisible:!1,panelIndex:0,panelStyle:null,panelPlacement:null}},computed:{isText:function(){return"text"===this.type},isFormBtn:function(){return-1<["submit","reset","button"].indexOf(this.type)},btnType:function(){return this.isText?this.type:"button"}},created:function(){_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent)},beforeDestroy:function(){var e=this.$refs.panel;e&&e.parentNode&&e.parentNode.removeChild(e)},destroyed:function(){_event.GlobalEvent.off(this,"mousewheel")},render:function(e){var t,n=this,i=this.$scopedSlots,o=this.$listeners,s=this.className,a=this.popupClassName,r=this.inited,u=this.type,l=this.destroyOnClose,c=this.isFormBtn,d=this.status,f=this.btnType,p=this.vSize,h=this.name,m=this.disabled,b=this.loading,v=this.showPanel,y=this.animatVisible,_=this.panelPlacement,i=i.dropdowns;return i?e("div",{class:["vxe-button--dropdown",s?_xeUtils.default.isFunction(s)?s({$button:this}):s:"",(_defineProperty(t={},"size--".concat(p),p),_defineProperty(t,"is--active",v),t)]},[e("button",{ref:"xBtn",class:["vxe-button","type--".concat(f),(_defineProperty(t={},"size--".concat(p),p),_defineProperty(t,"theme--".concat(d),d),_defineProperty(t,"is--round",this.round),_defineProperty(t,"is--circle",this.circle),_defineProperty(t,"is--disabled",m||b),_defineProperty(t,"is--loading",b),t)],attrs:{name:h,type:c?u:"button",disabled:m||b},on:Object.assign({mouseenter:this.mouseenterTargetEvent,mouseleave:this.mouseleaveEvent},_xeUtils.default.objectMap(o,function(e,t){return function(e){return n.$emit(t,{$event:e})}}))},this.renderContent(e).concat([e("i",{class:"vxe-button--dropdown-arrow ".concat(_conf.default.icon.BUTTON_DROPDOWN)})])),e("div",{ref:"panel",class:["vxe-button--dropdown-panel",a?_xeUtils.default.isFunction(a)?a({$button:this}):a:"",(_defineProperty(t={},"size--".concat(p),p),_defineProperty(t,"animat--leave",y),_defineProperty(t,"animat--enter",v),t)],attrs:{placement:_},style:this.panelStyle},r?[e("div",{class:"vxe-button--dropdown-wrapper",on:{mousedown:this.mousedownDropdownEvent,click:this.clickDropdownEvent,mouseenter:this.mouseenterEvent,mouseleave:this.mouseleaveEvent}},l&&!v?[]:i.call(this,{},e))]:null)]):e("button",{ref:"xBtn",class:["vxe-button","type--".concat(f),s,(_defineProperty(a={},"size--".concat(p),p),_defineProperty(a,"theme--".concat(d),d),_defineProperty(a,"is--round",this.round),_defineProperty(a,"is--circle",this.circle),_defineProperty(a,"is--disabled",m||b),_defineProperty(a,"is--loading",b),a)],attrs:{name:h,type:c?u:"button",disabled:m||b},on:_xeUtils.default.objectMap(o,function(e,t){return function(e){return n.$emit(t,{$event:e})}})},this.renderContent(e))},methods:{renderContent:function(e){var t=this.$scopedSlots,n=this.content,i=this.icon,o=[];return this.loading?o.push(e("i",{class:["vxe-button--loading-icon",_conf.default.icon.BUTTON_LOADING]})):t.icon?o.push(e("span",{class:"vxe-button--custom-icon"},t.icon.call(this,{}))):i&&o.push(e("i",{class:["vxe-button--icon",i]})),t.default?o.push(e("span",{class:"vxe-button--content"},t.default.call(this,{}))):n&&o.push(e("span",{class:"vxe-button--content"},[(0,_utils.getFuncText)(n)])),o},handleGlobalMousewheelEvent:function(e){this.showPanel&&!_dom.default.getEventTargetNode(e,this.$refs.panel).flag&&this.closePanel()},updateZindex:function(){this.panelIndex<_utils.default.getLastZIndex()&&(this.panelIndex=_utils.default.nextZIndex())},mousedownDropdownEvent:function(e){0===e.button&&e.stopPropagation()},clickDropdownEvent:function(e){var t=this,n=e.currentTarget,i=this.$refs.panel,n=_dom.default.getEventTargetNode(e,n,"vxe-button"),o=n.flag,n=n.targetElem;o&&(i&&(i.dataset.active="N"),this.showPanel=!1,setTimeout(function(){i&&"Y"===i.dataset.active||(t.animatVisible=!1)},350),this.$emit("dropdown-click",{name:n.getAttribute("name"),$event:e}))},mouseenterTargetEvent:function(){var e=this,t=this.$refs.panel;t.dataset.active="Y",this.inited||(this.inited=!0,this.transfer&&document.body.appendChild(t)),this.showTime=setTimeout(function(){"Y"===t.dataset.active?e.mouseenterEvent():e.animatVisible=!1},250)},mouseenterEvent:function(){var e=this,t=this.$refs.panel;t.dataset.active="Y",this.animatVisible=!0,setTimeout(function(){"Y"===t.dataset.active&&(e.showPanel=!0,e.updateZindex(),e.updatePlacement(),setTimeout(function(){e.showPanel&&e.updatePlacement()},50))},20)},mouseleaveEvent:function(){this.closePanel()},closePanel:function(){var e=this,t=this.$refs.panel;clearTimeout(this.showTime),t?(t.dataset.active="N",setTimeout(function(){"Y"!==t.dataset.active&&(e.showPanel=!1,setTimeout(function(){"Y"!==t.dataset.active&&(e.animatVisible=!1)},350))},100)):(this.animatVisible=!1,this.showPanel=!1)},updatePlacement:function(){var p=this;return this.$nextTick().then(function(){var e,t,n,i,o,s,a,r,u=p.$refs,l=p.transfer,c=p.placement,d=p.panelIndex,f=u.xBtn,u=u.panel;if(u&&f)return e=f.offsetHeight,t=f.offsetWidth,n=u.offsetHeight,u=u.offsetWidth,d={zIndex:d},r=(f=_dom.default.getAbsolutePos(f)).top,i=f.left,o=f.boundingTop,s=f.visibleHeight,f=f.visibleWidth,a="bottom",l?(l=r+e,"top"===c?(a="top",l=r-n):c||(s<o+e+n+5&&(a="top",l=r-n),l<5&&(a="bottom",l=r+e)),f<(r=i+t-u)+u+5&&(r-=r+u+5-f),r<5&&(r=5),Object.assign(d,{left:"".concat(r,"px"),right:"auto",top:"".concat(l,"px"),minWidth:"".concat(t,"px")})):"top"===c?(a="top",d.bottom="".concat(e,"px")):c||s<o+e+n&&5<o-e-n&&(a="top",d.bottom="".concat(e,"px")),p.panelStyle=d,p.panelPlacement=a,p.$nextTick()})},focus:function(){return this.$el.focus(),this.$nextTick()},blur:function(){return this.$el.blur(),this.$nextTick()}}};exports.default=_default2;
@@ -31,8 +31,8 @@ function insertTreeRow(_vm, newRecords, isAppend) {
31
31
  treeOpts = _vm.treeOpts;
32
32
  var rowField = treeOpts.rowField,
33
33
  parentField = treeOpts.parentField,
34
- children = treeOpts.children,
35
- mapChildren = treeOpts.mapChildren;
34
+ mapChildrenField = treeOpts.mapChildrenField;
35
+ var childrenField = treeOpts.children || treeOpts.childrenField;
36
36
  var funcName = isAppend ? 'push' : 'unshift';
37
37
  newRecords.forEach(function (item) {
38
38
  var parentRowId = item[parentField];
@@ -40,15 +40,15 @@ function insertTreeRow(_vm, newRecords, isAppend) {
40
40
  var matchObj = parentRowId ? _xeUtils["default"].findTree(tableFullTreeData, function (item) {
41
41
  return parentRowId === item[rowField];
42
42
  }, {
43
- children: mapChildren
43
+ children: mapChildrenField
44
44
  }) : null;
45
45
  if (matchObj) {
46
46
  var parentRow = matchObj.item;
47
47
  var parentRest = fullAllDataRowIdData[(0, _util.getRowid)(_vm, parentRow)];
48
48
  var parentLevel = parentRest ? parentRest.level : 0;
49
- var parentChilds = parentRow[children];
49
+ var parentChilds = parentRow[childrenField];
50
50
  if (!_xeUtils["default"].isArray(parentChilds)) {
51
- parentChilds = parentRow[children] = [];
51
+ parentChilds = parentRow[childrenField] = [];
52
52
  }
53
53
  parentChilds[funcName](item);
54
54
  var rest = {
@@ -119,7 +119,7 @@ var _default = {
119
119
  treeOpts = this.treeOpts;
120
120
  var transform = treeOpts.transform,
121
121
  rowField = treeOpts.rowField,
122
- mapChildren = treeOpts.mapChildren;
122
+ mapChildrenField = treeOpts.mapChildrenField;
123
123
  if (!_xeUtils["default"].isArray(records)) {
124
124
  records = [records];
125
125
  }
@@ -164,7 +164,7 @@ var _default = {
164
164
  var matchObj = _xeUtils["default"].findTree(tableFullTreeData, function (item) {
165
165
  return row[rowField] === item[rowField];
166
166
  }, {
167
- children: mapChildren
167
+ children: mapChildrenField
168
168
  });
169
169
  if (matchObj) {
170
170
  var parentRow = matchObj.parent;
@@ -278,7 +278,7 @@ var _default = {
278
278
  mergeList = this.mergeList,
279
279
  editStore = this.editStore,
280
280
  checkboxOpts = this.checkboxOpts,
281
- selection = this.selection,
281
+ selectCheckboxRows = this.selectCheckboxRows,
282
282
  isInsertByRow = this.isInsertByRow,
283
283
  treeOpts = this.treeOpts;
284
284
  var transform = treeOpts.transform;
@@ -302,9 +302,9 @@ var _default = {
302
302
  // 如果绑定了多选属性,则更新状态
303
303
  if (!checkField) {
304
304
  rows.forEach(function (row) {
305
- var sIndex = _this2.findRowIndexOf(selection, row);
305
+ var sIndex = _this2.findRowIndexOf(selectCheckboxRows, row);
306
306
  if (sIndex > -1) {
307
- selection.splice(sIndex, 1);
307
+ selectCheckboxRows.splice(sIndex, 1);
308
308
  }
309
309
  });
310
310
  }
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_utils=_interopRequireWildcard(require("../../tools/utils")),_util=require("../../table/src/util"),_dom=_interopRequireWildcard(require("../../tools/dom")),_log=require("../../tools/log");function _getRequireWildcardCache(e){var t,r;return"function"!=typeof WeakMap?null:(t=new WeakMap,r=new WeakMap,(_getRequireWildcardCache=function(e){return e?r:t})(e))}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var r,i,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&((i=o?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(n,r,i):n[r]=e[r]);return n.default=e,t&&t.set(e,n),n}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var r,i=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)),i}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function insertTreeRow(l,e,t){var a=l.tableFullTreeData,s=l.afterFullData,u=l.fullDataRowIdData,c=l.fullAllDataRowIdData,r=l.treeOpts,d=r.rowField,h=r.parentField,f=r.children,p=r.mapChildren,m=t?"push":"unshift";e.forEach(function(e){var t,r,i=e[h],n=(0,_util.getRowid)(l,e),o=i?_xeUtils.default.findTree(a,function(e){return i===e[d]},{children:p}):null;o?(o=o.item,t=(t=c[(0,_util.getRowid)(l,o)])?t.level:0,r=o[f],(r=_xeUtils.default.isArray(r)?r:o[f]=[])[m](e),o={row:e,rowid:n,seq:-1,index:-1,_index:-1,$index:-1,items:r,parent:parent,level:t+1},u[n]=o,c[n]=o):("development"===process.env.NODE_ENV&&i&&(0,_log.warnLog)("vxe.error.unableInsert"),s[m](e),a[m](e),r={row:e,rowid:n,seq:-1,index:-1,_index:-1,$index:-1,items:a,parent:null,level:0},u[n]=r,c[n]=r)})}var _default={methods:{_insert:function(e){return this.insertAt(e)},_insertAt:function(e,t){var i=this,r=this.tableFullTreeData,n=this.mergeList,o=this.afterFullData,l=this.editStore,a=this.tableFullData,s=this.treeConfig,u=this.fullDataRowIdData,c=this.fullAllDataRowIdData,d=this.treeOpts,h=d.transform,f=d.rowField,p=d.mapChildren,m=(_xeUtils.default.isArray(e)||(e=[e]),this.defineField(e.map(function(e){return Object.assign({},e)})));if(t)if(-1===t)s&&h?insertTreeRow(this,m,!0):(o.push.apply(o,_toConsumableArray(m)),a.push.apply(a,_toConsumableArray(m)),n.forEach(function(e){var t=e.row,r=e.rowspan;t+r>o.length&&(e.rowspan=r+m.length)}));else if(s&&h){var w,_,v,g=_xeUtils.default.findTree(r,function(e){return t[f]===e[f]},{children:p});g?(w=g.parent,_=g.items,e=c[(0,_util.getRowid)(this,w)],v=e?e.level:0,m.forEach(function(e,t){var r=(0,_util.getRowid)(i,e),t=("development"===process.env.NODE_ENV&&e[d.parentField]&&w&&e[d.parentField]!==w[f]&&(0,_log.errLog)("vxe.error.errProp",["".concat(d.parentField,"=").concat(e[d.parentField]),"".concat(d.parentField,"=").concat(w[f])]),w&&(e[d.parentField]=w[f]),_.splice(g.index+t,0,e),{row:e,rowid:r,seq:-1,index:-1,_index:-1,$index:-1,items:_,parent:w,level:v+1});u[r]=t,c[r]=t})):("development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.unableInsert"),insertTreeRow(this,m,!0))}else{if(s)throw new Error((0,_log.getLog)("vxe.error.noTree",["insert"]));var y=-1;if(_xeUtils.default.isNumber(t)?t<o.length&&(y=t):y=this.findRowIndexOf(o,t),-1===y)throw new Error((0,_log.errLog)("vxe.error.unableInsert"));o.splice.apply(o,[y,0].concat(_toConsumableArray(m))),a.splice.apply(a,[this.findRowIndexOf(a,t),0].concat(_toConsumableArray(m))),n.forEach(function(e){var t=e.row,r=e.rowspan;y<t?e.row=t+m.length:y<t+r&&(e.rowspan=r+m.length)})}else s&&h?insertTreeRow(this,m,!1):(o.unshift.apply(o,_toConsumableArray(m)),a.unshift.apply(a,_toConsumableArray(m)),n.forEach(function(e){var t=e.row;0<t&&(e.row=t+m.length)}));var r=l.insertList,b=l.insertMaps;return m.forEach(function(e){var t=(0,_util.getRowid)(i,e);b[t]=e}),r.unshift.apply(r,_toConsumableArray(m)),this.cacheRowMap(),this.updateScrollYStatus(),this.handleTableData(s&&h),s&&h||this.updateAfterDataIndex(),this.updateFooter(),this.checkSelectionStatus(),this.scrollYLoad&&this.updateScrollYSpace(),this.$nextTick().then(function(){return i.updateCellAreas(),i.recalculate()}).then(function(){return{row:m.length?m[m.length-1]:null,rows:m}})},_remove:function(e){var n=this,o=this.afterFullData,r=this.tableFullData,i=this.tableFullTreeData,t=this.treeConfig,l=this.mergeList,a=this.editStore,s=this.checkboxOpts,u=this.selection,c=this.isInsertByRow,d=this.treeOpts,h=d.transform,f=a.actived,p=a.removeList,m=a.insertList,w=a.insertMaps,a=s.checkField,_=[];return e?_xeUtils.default.isArray(e)||(e=[e]):e=r,e.forEach(function(e){c(e)||p.push(e)}),a||e.forEach(function(e){e=n.findRowIndexOf(u,e);-1<e&&u.splice(e,1)}),r===e?(e=_=r.slice(0),this.tableFullData=[],this.afterFullData=[],this.clearMergeCells()):t&&h?e.forEach(function(e){var t=(0,_util.getRowid)(n,e),r=_xeUtils.default.findTree(i,function(e){return t===(0,_util.getRowid)(n,e)},d),r=(r&&(r=r.items.splice(r.index,1),_.push(r[0])),n.findRowIndexOf(o,e));-1<r&&o.splice(r,1)}):e.forEach(function(e){var t=n.findRowIndexOf(r,e),i=(-1<t&&(t=r.splice(t,1),_.push(t[0])),n.findRowIndexOf(o,e));-1<i&&(l.forEach(function(e){var t=e.row,r=e.rowspan;i<t?e.row=t-1:i<t+r&&(e.rowspan=r-1)}),o.splice(i,1))}),f.row&&-1<this.findRowIndexOf(e,f.row)&&this.clearActived(),e.forEach(function(e){var t=(0,_util.getRowid)(n,e),e=n.findRowIndexOf(m,e);-1<e&&m.splice(e,1),delete w[t]}),this.handleTableData(t&&h),t&&h||this.updateAfterDataIndex(),this.updateFooter(),this.cacheRowMap(),this.checkSelectionStatus(),this.scrollYLoad&&this.updateScrollYSpace(),this.$nextTick().then(function(){return n.updateCellAreas(),n.recalculate()}).then(function(){return{row:_.length?_[_.length-1]:null,rows:_}})},_removeCheckboxRow:function(){var t=this;return this.remove(this.getCheckboxRecords()).then(function(e){return t.clearCheckboxRow(),e})},_removeRadioRow:function(){var t=this,e=this.getRadioRecord();return this.remove(e||[]).then(function(e){return t.clearRadioRow(),e})},_removeCurrentRow:function(){var t=this,e=this.getCurrentRecord();return this.remove(e||[]).then(function(e){return t.clearCurrentRow(),e})},_getRecordset:function(){return{insertRecords:this.getInsertRecords(),removeRecords:this.getRemoveRecords(),updateRecords:this.getUpdateRecords()}},_getInsertRecords:function(){var r=this,i=this.fullAllDataRowIdData,e=this.editStore.insertList,n=[];return e.forEach(function(e){var t=(0,_util.getRowid)(r,e);i[t]&&n.push(e)}),n},_getRemoveRecords:function(){return this.editStore.removeList},_getUpdateRecords:function(){var e=this.keepSource,t=this.tableFullData,r=this.isUpdateByRow,i=this.treeConfig,n=this.treeOpts,o=this.editStore;return e?(o=(e=o.actived).row,e=e.column,(o||e)&&this._syncActivedCell(),i?_xeUtils.default.filterTree(t,function(e){return r(e)},n):t.filter(function(e){return r(e)})):[]},handleActived:function(e,t){var r=this,i=this.editStore,n=this.editOpts,o=this.tableColumn,l=this.editConfig,a=this.mouseConfig,s=n.mode,i=i.actived,u=e.row,c=e.column,d=c.editRender,h=e.cell=e.cell||this.getCell(u,c),n=n.beforeEditMethod||n.activeMethod;return(0,_utils.isEnableConf)(l)&&(0,_utils.isEnableConf)(d)&&h&&(i.row!==u||"cell"===s&&i.column!==c?(l="edit-disabled",n&&!n(_objectSpread(_objectSpread({},e),{},{$table:this}))||(a&&(this.clearSelected(t),this.clearCellAreas(t),this.clearCopyCellArea(t)),this.closeTooltip(),i.column&&this.clearActived(t),l="edit-actived",c.renderHeight=h.offsetHeight,i.args=e,i.row=u,i.column=c,"row"===s?o.forEach(function(e){return r._getColumnModel(u,e)}):this._getColumnModel(u,c),this.$nextTick(function(){r.handleFocus(e,t)})),this.emitEvent(l,{row:u,rowIndex:this.getRowIndex(u),$rowIndex:this.getVMRowIndex(u),column:c,columnIndex:this.getColumnIndex(c),$columnIndex:this.getVMColumnIndex(c)},t)):(d=i.column,a&&(this.clearSelected(t),this.clearCellAreas(t),this.clearCopyCellArea(t)),d!==c&&((n=d.model).update&&_utils.default.setCellValue(u,d,n.value),this.clearValidate()),c.renderHeight=h.offsetHeight,i.args=e,i.column=c,setTimeout(function(){r.handleFocus(e,t)})),this.focus()),this.$nextTick()},_getColumnModel:function(e,t){var r=t.model;t.editRender&&(r.value=_utils.default.getCellValue(e,t),r.update=!1)},_setColumnModel:function(e,t){var r=t.model;t.editRender&&r.update&&(_utils.default.setCellValue(e,t,r.value),r.update=!1,r.value=null)},_syncActivedCell:function(){var t=this,e=this.tableColumn,r=this.editStore,i=this.editOpts,r=r.actived,n=r.row,r=r.column;(n||r)&&("row"===i.mode?e.forEach(function(e){return t._setColumnModel(n,e)}):this._setColumnModel(n,r))},_clearActived:function(e){return this.clearEdit(e)},_clearEdit:function(e){var t=this.editStore.actived,r=t.row,i=t.column;return(r||i)&&(this._syncActivedCell(),t.args=null,t.row=null,t.column=null,this.updateFooter(),this.emitEvent("edit-closed",{row:r,rowIndex:this.getRowIndex(r),$rowIndex:this.getVMRowIndex(r),column:i,columnIndex:this.getColumnIndex(i),$columnIndex:this.getVMColumnIndex(i)},e)),_vXETable.default._valid?this.clearValidate():this.$nextTick()},_getActiveRecord:function(){return this.getEditRecord()},_getEditRecord:function(){var e=this.$el,t=this.editStore,r=this.afterFullData,t=t.actived,i=t.args,t=t.row;return i&&-1<this.findRowIndexOf(r,t)&&e.querySelectorAll(".vxe-body--column.col--actived").length?Object.assign({},i):null},_isActiveByRow:function(e){return this.isEditByRow(e)},_isEditByRow:function(e){return this.editStore.actived.row===e},handleFocus:function(e){var t,r,i,n=e.row,o=e.column,l=e.cell,a=o.editRender;(0,_utils.isEnableConf)(a)&&(i=_vXETable.default.renderer.get(a.name),t=a.autofocus,a=a.autoselect,!t&&i&&(t=i.autofocus),!a&&i&&(a=i.autoselect),_xeUtils.default.isFunction(t)?r=t.call(this,e):t&&(r=l.querySelector(t))&&r.focus(),r?a?r.select():_dom.browse.msie&&((i=r.createTextRange()).collapse(!1),i.select()):this.scrollToRow(n,o))},_setActiveRow:function(e){return this.setEditRow(e)},_setEditRow:function(e){return this.setEditCell(e,_xeUtils.default.find(this.visibleColumn,function(e){return(0,_utils.isEnableConf)(e.editRender)}))},_setActiveCell:function(e){return this.setEditCell(e)},_setEditCell:function(t,e){var r=this,i=this.editConfig,n=_xeUtils.default.isString(e)?this.getColumnByField(e):e;return t&&n&&(0,_utils.isEnableConf)(i)&&(0,_utils.isEnableConf)(n.editRender)?this.scrollToRow(t,!0).then(function(){var e=r.getCell(t,n);e&&(r.handleActived({row:t,rowIndex:r.getRowIndex(t),column:n,columnIndex:r.getColumnIndex(n),cell:e,$table:r}),r.lastCallTime=Date.now())}):this.$nextTick()},_setSelectCell:function(e,t){var r=this.tableData,i=this.editOpts,n=this.visibleColumn,t=_xeUtils.default.isString(t)?this.getColumnByField(t):t;return e&&t&&"manual"!==i.trigger&&-1<(i=this.findRowIndexOf(r,e))&&(r=this.getCell(e,t),e={row:e,rowIndex:i,column:t,columnIndex:n.indexOf(t),cell:r},this.handleSelected(e,{})),this.$nextTick()},handleSelected:function(e,t){var r=this,i=this.mouseConfig,n=this.mouseOpts,o=this.editOpts,l=this.editStore,a=l.actived,l=l.selected,s=e.row,u=e.column,i=i&&n.selected;return!i||l.row===s&&l.column===u||(a.row!==s||"cell"===o.mode&&a.column!==u)&&(r.clearActived(t),r.clearSelected(t),r.clearCellAreas(t),r.clearCopyCellArea(t),l.args=e,l.row=s,l.column=u,i&&r.addColSdCls(),r.focus(),t)&&r.emitEvent("cell-selected",e,t),r.$nextTick()},_getSelectedCell:function(){var e=this.editStore.selected,t=e.args,e=e.column;return t&&e?Object.assign({},t):null},_clearSelected:function(){var e=this.editStore.selected;return e.row=null,e.column=null,this.reColTitleSdCls(),this.reColSdCls(),this.$nextTick()},reColTitleSdCls:function(){var e=this.elemStore["main-header-list"];e&&_xeUtils.default.arrayEach(e.querySelectorAll(".col--title-selected"),function(e){return _dom.default.removeClass(e,"col--title-selected")})},reColSdCls:function(){var e=this.$el.querySelector(".col--selected");e&&_dom.default.removeClass(e,"col--selected")},addColSdCls:function(){var e=this.editStore.selected,t=e.row,e=e.column;this.reColSdCls(),t&&e&&(t=this.getCell(t,e))&&_dom.default.addClass(t,"col--selected")}}};exports.default=_default;
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_utils=_interopRequireWildcard(require("../../tools/utils")),_util=require("../../table/src/util"),_dom=_interopRequireWildcard(require("../../tools/dom")),_log=require("../../tools/log");function _getRequireWildcardCache(e){var t,r;return"function"!=typeof WeakMap?null:(t=new WeakMap,r=new WeakMap,(_getRequireWildcardCache=function(e){return e?r:t})(e))}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var r,i,n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&((i=o?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(n,r,i):n[r]=e[r]);return n.default=e,t&&t.set(e,n),n}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var r,i=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)),i}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function insertTreeRow(l,e,t){var a=l.tableFullTreeData,s=l.afterFullData,u=l.fullDataRowIdData,c=l.fullAllDataRowIdData,r=l.treeOpts,d=r.rowField,h=r.parentField,f=r.mapChildrenField,p=r.children||r.childrenField,m=t?"push":"unshift";e.forEach(function(e){var t,r,i=e[h],n=(0,_util.getRowid)(l,e),o=i?_xeUtils.default.findTree(a,function(e){return i===e[d]},{children:f}):null;o?(o=o.item,t=(t=c[(0,_util.getRowid)(l,o)])?t.level:0,r=o[p],(r=_xeUtils.default.isArray(r)?r:o[p]=[])[m](e),o={row:e,rowid:n,seq:-1,index:-1,_index:-1,$index:-1,items:r,parent:parent,level:t+1},u[n]=o,c[n]=o):("development"===process.env.NODE_ENV&&i&&(0,_log.warnLog)("vxe.error.unableInsert"),s[m](e),a[m](e),r={row:e,rowid:n,seq:-1,index:-1,_index:-1,$index:-1,items:a,parent:null,level:0},u[n]=r,c[n]=r)})}var _default={methods:{_insert:function(e){return this.insertAt(e)},_insertAt:function(e,t){var i=this,r=this.tableFullTreeData,n=this.mergeList,o=this.afterFullData,l=this.editStore,a=this.tableFullData,s=this.treeConfig,u=this.fullDataRowIdData,c=this.fullAllDataRowIdData,d=this.treeOpts,h=d.transform,f=d.rowField,p=d.mapChildrenField,m=(_xeUtils.default.isArray(e)||(e=[e]),this.defineField(e.map(function(e){return Object.assign({},e)})));if(t)if(-1===t)s&&h?insertTreeRow(this,m,!0):(o.push.apply(o,_toConsumableArray(m)),a.push.apply(a,_toConsumableArray(m)),n.forEach(function(e){var t=e.row,r=e.rowspan;t+r>o.length&&(e.rowspan=r+m.length)}));else if(s&&h){var w,_,v,g=_xeUtils.default.findTree(r,function(e){return t[f]===e[f]},{children:p});g?(w=g.parent,_=g.items,e=c[(0,_util.getRowid)(this,w)],v=e?e.level:0,m.forEach(function(e,t){var r=(0,_util.getRowid)(i,e),t=("development"===process.env.NODE_ENV&&e[d.parentField]&&w&&e[d.parentField]!==w[f]&&(0,_log.errLog)("vxe.error.errProp",["".concat(d.parentField,"=").concat(e[d.parentField]),"".concat(d.parentField,"=").concat(w[f])]),w&&(e[d.parentField]=w[f]),_.splice(g.index+t,0,e),{row:e,rowid:r,seq:-1,index:-1,_index:-1,$index:-1,items:_,parent:w,level:v+1});u[r]=t,c[r]=t})):("development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.unableInsert"),insertTreeRow(this,m,!0))}else{if(s)throw new Error((0,_log.getLog)("vxe.error.noTree",["insert"]));var y=-1;if(_xeUtils.default.isNumber(t)?t<o.length&&(y=t):y=this.findRowIndexOf(o,t),-1===y)throw new Error((0,_log.errLog)("vxe.error.unableInsert"));o.splice.apply(o,[y,0].concat(_toConsumableArray(m))),a.splice.apply(a,[this.findRowIndexOf(a,t),0].concat(_toConsumableArray(m))),n.forEach(function(e){var t=e.row,r=e.rowspan;y<t?e.row=t+m.length:y<t+r&&(e.rowspan=r+m.length)})}else s&&h?insertTreeRow(this,m,!1):(o.unshift.apply(o,_toConsumableArray(m)),a.unshift.apply(a,_toConsumableArray(m)),n.forEach(function(e){var t=e.row;0<t&&(e.row=t+m.length)}));var r=l.insertList,b=l.insertMaps;return m.forEach(function(e){var t=(0,_util.getRowid)(i,e);b[t]=e}),r.unshift.apply(r,_toConsumableArray(m)),this.cacheRowMap(),this.updateScrollYStatus(),this.handleTableData(s&&h),s&&h||this.updateAfterDataIndex(),this.updateFooter(),this.checkSelectionStatus(),this.scrollYLoad&&this.updateScrollYSpace(),this.$nextTick().then(function(){return i.updateCellAreas(),i.recalculate()}).then(function(){return{row:m.length?m[m.length-1]:null,rows:m}})},_remove:function(e){var n=this,o=this.afterFullData,r=this.tableFullData,i=this.tableFullTreeData,t=this.treeConfig,l=this.mergeList,a=this.editStore,s=this.checkboxOpts,u=this.selectCheckboxRows,c=this.isInsertByRow,d=this.treeOpts,h=d.transform,f=a.actived,p=a.removeList,m=a.insertList,w=a.insertMaps,a=s.checkField,_=[];return e?_xeUtils.default.isArray(e)||(e=[e]):e=r,e.forEach(function(e){c(e)||p.push(e)}),a||e.forEach(function(e){e=n.findRowIndexOf(u,e);-1<e&&u.splice(e,1)}),r===e?(e=_=r.slice(0),this.tableFullData=[],this.afterFullData=[],this.clearMergeCells()):t&&h?e.forEach(function(e){var t=(0,_util.getRowid)(n,e),r=_xeUtils.default.findTree(i,function(e){return t===(0,_util.getRowid)(n,e)},d),r=(r&&(r=r.items.splice(r.index,1),_.push(r[0])),n.findRowIndexOf(o,e));-1<r&&o.splice(r,1)}):e.forEach(function(e){var t=n.findRowIndexOf(r,e),i=(-1<t&&(t=r.splice(t,1),_.push(t[0])),n.findRowIndexOf(o,e));-1<i&&(l.forEach(function(e){var t=e.row,r=e.rowspan;i<t?e.row=t-1:i<t+r&&(e.rowspan=r-1)}),o.splice(i,1))}),f.row&&-1<this.findRowIndexOf(e,f.row)&&this.clearActived(),e.forEach(function(e){var t=(0,_util.getRowid)(n,e),e=n.findRowIndexOf(m,e);-1<e&&m.splice(e,1),delete w[t]}),this.handleTableData(t&&h),t&&h||this.updateAfterDataIndex(),this.updateFooter(),this.cacheRowMap(),this.checkSelectionStatus(),this.scrollYLoad&&this.updateScrollYSpace(),this.$nextTick().then(function(){return n.updateCellAreas(),n.recalculate()}).then(function(){return{row:_.length?_[_.length-1]:null,rows:_}})},_removeCheckboxRow:function(){var t=this;return this.remove(this.getCheckboxRecords()).then(function(e){return t.clearCheckboxRow(),e})},_removeRadioRow:function(){var t=this,e=this.getRadioRecord();return this.remove(e||[]).then(function(e){return t.clearRadioRow(),e})},_removeCurrentRow:function(){var t=this,e=this.getCurrentRecord();return this.remove(e||[]).then(function(e){return t.clearCurrentRow(),e})},_getRecordset:function(){return{insertRecords:this.getInsertRecords(),removeRecords:this.getRemoveRecords(),updateRecords:this.getUpdateRecords()}},_getInsertRecords:function(){var r=this,i=this.fullAllDataRowIdData,e=this.editStore.insertList,n=[];return e.forEach(function(e){var t=(0,_util.getRowid)(r,e);i[t]&&n.push(e)}),n},_getRemoveRecords:function(){return this.editStore.removeList},_getUpdateRecords:function(){var e=this.keepSource,t=this.tableFullData,r=this.isUpdateByRow,i=this.treeConfig,n=this.treeOpts,o=this.editStore;return e?(o=(e=o.actived).row,e=e.column,(o||e)&&this._syncActivedCell(),i?_xeUtils.default.filterTree(t,function(e){return r(e)},n):t.filter(function(e){return r(e)})):[]},handleActived:function(e,t){var r=this,i=this.editStore,n=this.editOpts,o=this.tableColumn,l=this.editConfig,a=this.mouseConfig,s=n.mode,i=i.actived,u=e.row,c=e.column,d=c.editRender,h=e.cell=e.cell||this.getCell(u,c),n=n.beforeEditMethod||n.activeMethod;return(0,_utils.isEnableConf)(l)&&(0,_utils.isEnableConf)(d)&&h&&(i.row!==u||"cell"===s&&i.column!==c?(l="edit-disabled",n&&!n(_objectSpread(_objectSpread({},e),{},{$table:this}))||(a&&(this.clearSelected(t),this.clearCellAreas(t),this.clearCopyCellArea(t)),this.closeTooltip(),i.column&&this.clearActived(t),l="edit-actived",c.renderHeight=h.offsetHeight,i.args=e,i.row=u,i.column=c,"row"===s?o.forEach(function(e){return r._getColumnModel(u,e)}):this._getColumnModel(u,c),this.$nextTick(function(){r.handleFocus(e,t)})),this.emitEvent(l,{row:u,rowIndex:this.getRowIndex(u),$rowIndex:this.getVMRowIndex(u),column:c,columnIndex:this.getColumnIndex(c),$columnIndex:this.getVMColumnIndex(c)},t)):(d=i.column,a&&(this.clearSelected(t),this.clearCellAreas(t),this.clearCopyCellArea(t)),d!==c&&((n=d.model).update&&_utils.default.setCellValue(u,d,n.value),this.clearValidate()),c.renderHeight=h.offsetHeight,i.args=e,i.column=c,setTimeout(function(){r.handleFocus(e,t)})),this.focus()),this.$nextTick()},_getColumnModel:function(e,t){var r=t.model;t.editRender&&(r.value=_utils.default.getCellValue(e,t),r.update=!1)},_setColumnModel:function(e,t){var r=t.model;t.editRender&&r.update&&(_utils.default.setCellValue(e,t,r.value),r.update=!1,r.value=null)},_syncActivedCell:function(){var t=this,e=this.tableColumn,r=this.editStore,i=this.editOpts,r=r.actived,n=r.row,r=r.column;(n||r)&&("row"===i.mode?e.forEach(function(e){return t._setColumnModel(n,e)}):this._setColumnModel(n,r))},_clearActived:function(e){return this.clearEdit(e)},_clearEdit:function(e){var t=this.editStore.actived,r=t.row,i=t.column;return(r||i)&&(this._syncActivedCell(),t.args=null,t.row=null,t.column=null,this.updateFooter(),this.emitEvent("edit-closed",{row:r,rowIndex:this.getRowIndex(r),$rowIndex:this.getVMRowIndex(r),column:i,columnIndex:this.getColumnIndex(i),$columnIndex:this.getVMColumnIndex(i)},e)),_vXETable.default._valid?this.clearValidate():this.$nextTick()},_getActiveRecord:function(){return this.getEditRecord()},_getEditRecord:function(){var e=this.$el,t=this.editStore,r=this.afterFullData,t=t.actived,i=t.args,t=t.row;return i&&-1<this.findRowIndexOf(r,t)&&e.querySelectorAll(".vxe-body--column.col--actived").length?Object.assign({},i):null},_isActiveByRow:function(e){return this.isEditByRow(e)},_isEditByRow:function(e){return this.editStore.actived.row===e},handleFocus:function(e){var t,r,i,n=e.row,o=e.column,l=e.cell,a=o.editRender;(0,_utils.isEnableConf)(a)&&(i=_vXETable.default.renderer.get(a.name),t=a.autofocus,a=a.autoselect,!t&&i&&(t=i.autofocus),!a&&i&&(a=i.autoselect),_xeUtils.default.isFunction(t)?r=t.call(this,e):t&&(r=l.querySelector(t))&&r.focus(),r?a?r.select():_dom.browse.msie&&((i=r.createTextRange()).collapse(!1),i.select()):this.scrollToRow(n,o))},_setActiveRow:function(e){return this.setEditRow(e)},_setEditRow:function(e){return this.setEditCell(e,_xeUtils.default.find(this.visibleColumn,function(e){return(0,_utils.isEnableConf)(e.editRender)}))},_setActiveCell:function(e){return this.setEditCell(e)},_setEditCell:function(t,e){var r=this,i=this.editConfig,n=_xeUtils.default.isString(e)?this.getColumnByField(e):e;return t&&n&&(0,_utils.isEnableConf)(i)&&(0,_utils.isEnableConf)(n.editRender)?this.scrollToRow(t,!0).then(function(){var e=r.getCell(t,n);e&&(r.handleActived({row:t,rowIndex:r.getRowIndex(t),column:n,columnIndex:r.getColumnIndex(n),cell:e,$table:r}),r.lastCallTime=Date.now())}):this.$nextTick()},_setSelectCell:function(e,t){var r=this.tableData,i=this.editOpts,n=this.visibleColumn,t=_xeUtils.default.isString(t)?this.getColumnByField(t):t;return e&&t&&"manual"!==i.trigger&&-1<(i=this.findRowIndexOf(r,e))&&(r=this.getCell(e,t),e={row:e,rowIndex:i,column:t,columnIndex:n.indexOf(t),cell:r},this.handleSelected(e,{})),this.$nextTick()},handleSelected:function(e,t){var r=this,i=this.mouseConfig,n=this.mouseOpts,o=this.editOpts,l=this.editStore,a=l.actived,l=l.selected,s=e.row,u=e.column,i=i&&n.selected;return!i||l.row===s&&l.column===u||(a.row!==s||"cell"===o.mode&&a.column!==u)&&(r.clearActived(t),r.clearSelected(t),r.clearCellAreas(t),r.clearCopyCellArea(t),l.args=e,l.row=s,l.column=u,i&&r.addColSdCls(),r.focus(),t)&&r.emitEvent("cell-selected",e,t),r.$nextTick()},_getSelectedCell:function(){var e=this.editStore.selected,t=e.args,e=e.column;return t&&e?Object.assign({},t):null},_clearSelected:function(){var e=this.editStore.selected;return e.row=null,e.column=null,this.reColTitleSdCls(),this.reColSdCls(),this.$nextTick()},reColTitleSdCls:function(){var e=this.elemStore["main-header-list"];e&&_xeUtils.default.arrayEach(e.querySelectorAll(".col--title-selected"),function(e){return _dom.default.removeClass(e,"col--title-selected")})},reColSdCls:function(){var e=this.$el.querySelector(".col--selected");e&&_dom.default.removeClass(e,"col--selected")},addColSdCls:function(){var e=this.editStore.selected,t=e.row,e=e.column;this.reColSdCls(),t&&e&&(t=this.getCell(t,e))&&_dom.default.addClass(t,"col--selected")}}};exports.default=_default;