vxe-table 3.4.14-beta.3 → 3.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +2 -6
  2. package/helper/vetur/attributes.json +30 -10
  3. package/helper/vetur/tags.json +7 -2
  4. package/lib/button/src/button.js +19 -9
  5. package/lib/button/src/button.min.js +1 -1
  6. package/lib/checkbox/src/checkbox.js +2 -2
  7. package/lib/checkbox/src/checkbox.min.js +1 -1
  8. package/lib/edit/src/mixin.js +26 -18
  9. package/lib/edit/src/mixin.min.js +1 -1
  10. package/lib/export/src/export-panel.js +2 -2
  11. package/lib/export/src/export-panel.min.js +1 -1
  12. package/lib/export/src/import-panel.js +2 -2
  13. package/lib/export/src/import-panel.min.js +1 -1
  14. package/lib/export/src/mixin.js +26 -24
  15. package/lib/export/src/mixin.min.js +1 -1
  16. package/lib/filter/src/mixin.js +4 -4
  17. package/lib/filter/src/mixin.min.js +1 -1
  18. package/lib/filter/src/panel.js +2 -2
  19. package/lib/filter/src/panel.min.js +1 -1
  20. package/lib/footer/src/footer.js +7 -4
  21. package/lib/footer/src/footer.min.js +1 -1
  22. package/lib/form/src/form-gather.js +2 -2
  23. package/lib/form/src/form-gather.min.js +1 -1
  24. package/lib/form/src/form-item.js +10 -5
  25. package/lib/form/src/form-item.min.js +1 -1
  26. package/lib/form/src/form.js +72 -83
  27. package/lib/form/src/form.min.js +1 -1
  28. package/lib/form/src/render.js +17 -14
  29. package/lib/form/src/render.min.js +1 -1
  30. package/lib/form/src/util.js +13 -2
  31. package/lib/form/src/util.min.js +1 -1
  32. package/lib/grid/src/grid.js +44 -34
  33. package/lib/grid/src/grid.min.js +1 -1
  34. package/lib/header/src/header.js +10 -8
  35. package/lib/header/src/header.min.js +1 -1
  36. package/lib/index.css +1 -1
  37. package/lib/index.umd.js +2301 -2267
  38. package/lib/index.umd.min.js +1 -2
  39. package/lib/input/src/input.js +30 -18
  40. package/lib/input/src/input.min.js +1 -1
  41. package/lib/keyboard/src/mixin.js +12 -8
  42. package/lib/keyboard/src/mixin.min.js +1 -1
  43. package/lib/list/src/list.js +7 -5
  44. package/lib/list/src/list.min.js +1 -1
  45. package/lib/menu/src/mixin.js +24 -14
  46. package/lib/menu/src/mixin.min.js +1 -1
  47. package/lib/menu/src/panel.js +3 -3
  48. package/lib/menu/src/panel.min.js +1 -1
  49. package/lib/modal/src/modal.js +24 -12
  50. package/lib/modal/src/modal.min.js +1 -1
  51. package/lib/pulldown/src/pulldown.js +16 -12
  52. package/lib/pulldown/src/pulldown.min.js +1 -1
  53. package/lib/radio/src/button.js +2 -2
  54. package/lib/radio/src/button.min.js +1 -1
  55. package/lib/radio/src/radio.js +2 -2
  56. package/lib/radio/src/radio.min.js +1 -1
  57. package/lib/select/src/select.js +26 -16
  58. package/lib/select/src/select.min.js +1 -1
  59. package/lib/select/style/style.css +1 -1
  60. package/lib/select/style/style.min.css +1 -1
  61. package/lib/style.css +1 -1
  62. package/lib/style.min.css +1 -1
  63. package/lib/switch/src/switch.js +4 -4
  64. package/lib/switch/src/switch.min.js +1 -1
  65. package/lib/table/src/body.js +36 -38
  66. package/lib/table/src/body.min.js +1 -1
  67. package/lib/table/src/cell.js +22 -14
  68. package/lib/table/src/cell.min.js +1 -1
  69. package/lib/table/src/column.js +6 -4
  70. package/lib/table/src/column.min.js +1 -1
  71. package/lib/table/src/columnInfo.js +202 -0
  72. package/lib/table/src/columnInfo.min.js +1 -0
  73. package/lib/table/src/methods.js +241 -242
  74. package/lib/table/src/methods.min.js +1 -1
  75. package/lib/table/src/table.js +99 -124
  76. package/lib/table/src/table.min.js +1 -1
  77. package/lib/table/src/util.js +38 -3
  78. package/lib/table/src/util.min.js +1 -1
  79. package/lib/textarea/src/textarea.js +2 -2
  80. package/lib/textarea/src/textarea.min.js +1 -1
  81. package/lib/toolbar/src/toolbar.js +16 -10
  82. package/lib/toolbar/src/toolbar.min.js +1 -1
  83. package/lib/tools/{src/dom.js → dom.js} +6 -8
  84. package/lib/tools/dom.min.js +1 -0
  85. package/lib/tools/{src/event.js → event.js} +3 -6
  86. package/lib/tools/event.min.js +1 -0
  87. package/lib/tools/log.js +29 -0
  88. package/lib/tools/log.min.js +1 -0
  89. package/lib/tools/{src/resize.js → resize.js} +1 -1
  90. package/lib/tools/resize.min.js +1 -0
  91. package/lib/tools/utils.js +155 -0
  92. package/lib/tools/utils.min.js +1 -0
  93. package/lib/tooltip/src/tooltip.js +138 -76
  94. package/lib/tooltip/src/tooltip.min.js +1 -1
  95. package/lib/tooltip/style/style.css +1 -1
  96. package/lib/tooltip/style/style.min.css +1 -1
  97. package/lib/v-x-e-table/index.js +7 -4
  98. package/lib/v-x-e-table/index.min.js +1 -1
  99. package/lib/v-x-e-table/src/conf.js +12 -7
  100. package/lib/v-x-e-table/src/conf.min.js +1 -1
  101. package/lib/v-x-e-table/src/interceptor.js +4 -4
  102. package/lib/v-x-e-table/src/interceptor.min.js +1 -1
  103. package/lib/v-x-e-table/src/renderer.js +18 -10
  104. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  105. package/lib/v-x-e-table/src/store.js +3 -3
  106. package/lib/v-x-e-table/src/store.min.js +1 -1
  107. package/lib/validator/src/mixin.js +4 -4
  108. package/lib/validator/src/mixin.min.js +1 -1
  109. package/package.json +3 -3
  110. package/packages/button/src/button.js +4 -2
  111. package/packages/checkbox/src/checkbox.js +2 -2
  112. package/packages/edit/src/mixin.js +7 -6
  113. package/packages/export/src/export-panel.js +1 -1
  114. package/packages/export/src/import-panel.js +1 -1
  115. package/packages/export/src/mixin.js +20 -19
  116. package/packages/filter/src/mixin.js +3 -3
  117. package/packages/filter/src/panel.js +1 -1
  118. package/packages/footer/src/footer.js +4 -2
  119. package/packages/form/src/form-gather.js +2 -2
  120. package/packages/form/src/form-item.js +9 -4
  121. package/packages/form/src/form.js +41 -48
  122. package/packages/form/src/render.js +9 -9
  123. package/packages/form/src/util.js +9 -2
  124. package/packages/grid/src/grid.js +22 -20
  125. package/packages/header/src/header.js +3 -2
  126. package/packages/input/src/input.js +6 -3
  127. package/packages/keyboard/src/mixin.js +1 -2
  128. package/packages/list/src/list.js +3 -2
  129. package/packages/menu/src/mixin.js +5 -3
  130. package/packages/menu/src/panel.js +3 -3
  131. package/packages/modal/src/modal.js +7 -4
  132. package/packages/pulldown/src/pulldown.js +3 -1
  133. package/packages/radio/src/button.js +2 -2
  134. package/packages/radio/src/radio.js +2 -2
  135. package/packages/select/src/select.js +5 -3
  136. package/packages/switch/src/switch.js +4 -4
  137. package/packages/table/src/body.js +25 -27
  138. package/packages/table/src/cell.js +8 -7
  139. package/packages/table/src/column.js +4 -2
  140. package/packages/table/src/columnInfo.js +149 -0
  141. package/packages/table/src/methods.js +90 -101
  142. package/packages/table/src/table.js +68 -98
  143. package/packages/table/src/util.js +19 -1
  144. package/packages/textarea/src/textarea.js +2 -2
  145. package/packages/toolbar/src/toolbar.js +7 -4
  146. package/packages/tools/{src/dom.js → dom.js} +6 -6
  147. package/packages/tools/{src/event.js → event.js} +1 -3
  148. package/packages/tools/log.js +16 -0
  149. package/packages/tools/{src/resize.js → resize.js} +1 -1
  150. package/packages/tools/utils.js +108 -0
  151. package/packages/tooltip/src/tooltip.js +90 -46
  152. package/packages/v-x-e-table/index.js +4 -2
  153. package/packages/v-x-e-table/src/conf.js +12 -7
  154. package/packages/v-x-e-table/src/interceptor.js +3 -3
  155. package/packages/v-x-e-table/src/renderer.js +4 -3
  156. package/packages/v-x-e-table/src/store.js +2 -2
  157. package/packages/validator/src/mixin.js +3 -3
  158. package/styles/select.scss +1 -1
  159. package/styles/tooltip.scss +1 -1
  160. package/types/v-x-e-table/index.d.ts +8 -0
  161. package/README.en.md +0 -170
  162. package/README.zh-TW.md +0 -174
  163. package/lib/tools/index.js +0 -76
  164. package/lib/tools/index.min.js +0 -1
  165. package/lib/tools/src/dom.min.js +0 -1
  166. package/lib/tools/src/event.min.js +0 -1
  167. package/lib/tools/src/resize.min.js +0 -1
  168. package/lib/tools/src/utils.js +0 -365
  169. package/lib/tools/src/utils.min.js +0 -1
  170. package/packages/tools/index.js +0 -14
  171. package/packages/tools/src/utils.js +0 -272
@@ -1,7 +1,7 @@
1
1
  import XEUtils from 'xe-utils'
2
2
  import GlobalConfig from '../../v-x-e-table/src/conf'
3
3
  import VXETable from '../../v-x-e-table'
4
- import { UtilTools, isEnableConf } from '../../tools'
4
+ import { isEnableConf, getFuncText } from '../../tools/utils'
5
5
  import { createItem, destroyItem, assemItem } from './util'
6
6
  import { renderTitle } from './render'
7
7
 
@@ -69,9 +69,9 @@ const renderItem = (h, _vm, item, slots) => {
69
69
  }
70
70
  const ons = showTooltip ? {
71
71
  mouseenter (evnt) {
72
- _vm.triggerHeaderHelpEvent(evnt, params)
72
+ _vm.triggerTitleTipEvent(evnt, params)
73
73
  },
74
- mouseleave: _vm.handleTargetLeaveEvent
74
+ mouseleave: _vm.handleTitleTipLeaveEvent
75
75
  } : {}
76
76
  return h('div', {
77
77
  class: ['vxe-form--item', item.id, span ? `vxe-col--${span} is--span` : null, className ? (XEUtils.isFunction(className) ? className(params) : className) : '', {
@@ -93,7 +93,7 @@ const renderItem = (h, _vm, item, slots) => {
93
93
  width: isNaN(titleWidth) ? titleWidth : `${titleWidth}px`
94
94
  } : null,
95
95
  attrs: {
96
- title: showTitle ? UtilTools.getFuncText(title) : null
96
+ title: showTitle ? getFuncText(title) : null
97
97
  },
98
98
  on: ons
99
99
  }, renderTitle(h, _vm, item)) : null,
@@ -137,6 +137,11 @@ export default {
137
137
  default: null
138
138
  }
139
139
  },
140
+ data () {
141
+ return {
142
+ itemConfig: null
143
+ }
144
+ },
140
145
  watch,
141
146
  mounted () {
142
147
  assemItem(this)
@@ -2,11 +2,11 @@ import XEUtils from 'xe-utils'
2
2
  import GlobalConfig from '../../v-x-e-table/src/conf'
3
3
  import vSize from '../../mixins/size'
4
4
  import VXETable from '../../v-x-e-table'
5
- import { UtilTools, DomTools, isEnableConf } from '../../tools'
6
- import { createItem } from './util'
5
+ import { isEnableConf, eqEmptyValue, getFuncText } from '../../tools/utils'
6
+ import DomTools, { browse } from '../../tools/dom'
7
+ import { createItem, handleFieldOrItem } from './util'
7
8
  import { renderTitle } from './render'
8
- import { eqEmptyValue } from '../../tools/src/utils'
9
- import { browse } from '../../tools/src/dom'
9
+ import { errLog } from '../../tools/log'
10
10
 
11
11
  class Rule {
12
12
  constructor (rule) {
@@ -24,7 +24,7 @@ class Rule {
24
24
  }
25
25
 
26
26
  get content () {
27
- return UtilTools.getFuncText(this.$options.content || this.$options.message)
27
+ return getFuncText(this.$options.content || this.$options.message)
28
28
  }
29
29
 
30
30
  get message () {
@@ -64,7 +64,7 @@ function getResetValue (value, resetValue) {
64
64
 
65
65
  function renderItems (h, _vm, itemList) {
66
66
  const { _e, rules, data, collapseAll, validOpts, titleOverflow: allTitleOverflow } = _vm
67
- return itemList.map((item, index) => {
67
+ return itemList.map((item) => {
68
68
  const { slots, title, folding, visible, visibleMethod, field, collapseNode, itemRender, showError, errRule, className, titleOverflow, children } = item
69
69
  const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
70
70
  const span = item.span || _vm.span
@@ -111,9 +111,9 @@ function renderItems (h, _vm, itemList) {
111
111
  }
112
112
  const ons = showTooltip ? {
113
113
  mouseenter (evnt) {
114
- _vm.triggerHeaderHelpEvent(evnt, params)
114
+ _vm.triggerTitleTipEvent(evnt, params)
115
115
  },
116
- mouseleave: _vm.handleTargetLeaveEvent
116
+ mouseleave: _vm.handleTitleTipLeaveEvent
117
117
  } : {}
118
118
  return h('div', {
119
119
  class: ['vxe-form--item', item.id, span ? `vxe-col--${span} is--span` : null, className ? (XEUtils.isFunction(className) ? className(params) : className) : '', {
@@ -123,7 +123,7 @@ function renderItems (h, _vm, itemList) {
123
123
  'is--active': !itemVisibleMethod || itemVisibleMethod(params),
124
124
  'is--error': showError
125
125
  }],
126
- key: index
126
+ key: item.id
127
127
  }, [
128
128
  h('div', {
129
129
  class: 'vxe-form--item-inner'
@@ -136,7 +136,7 @@ function renderItems (h, _vm, itemList) {
136
136
  width: isNaN(titleWidth) ? titleWidth : `${titleWidth}px`
137
137
  } : null,
138
138
  attrs: {
139
- title: showTitle ? UtilTools.getFuncText(title) : null
139
+ title: showTitle ? getFuncText(title) : null
140
140
  },
141
141
  on: ons
142
142
  }, renderTitle(h, _vm, item)) : null,
@@ -190,6 +190,7 @@ export default {
190
190
  rules: Object,
191
191
  preventSubmit: { type: Boolean, default: () => GlobalConfig.form.preventSubmit },
192
192
  validConfig: Object,
193
+ tooltipConfig: Object,
193
194
  customLayout: { type: Boolean, default: () => GlobalConfig.form.customLayout }
194
195
  },
195
196
  data () {
@@ -199,7 +200,6 @@ export default {
199
200
  formItems: [],
200
201
 
201
202
  tooltipTimeout: null,
202
- tooltipActive: false,
203
203
  tooltipStore: {
204
204
  item: null,
205
205
  visible: false
@@ -216,11 +216,7 @@ export default {
216
216
  return Object.assign({}, GlobalConfig.form.validConfig, this.validConfig)
217
217
  },
218
218
  tooltipOpts () {
219
- const opts = Object.assign({ leaveDelay: 300 }, GlobalConfig.form.tooltipConfig, this.tooltipConfig)
220
- if (opts.enterable) {
221
- opts.leaveMethod = this.handleTooltipLeaveMethod
222
- }
223
- return opts
219
+ return Object.assign({}, GlobalConfig.tooltip, GlobalConfig.form.tooltipConfig, this.tooltipConfig)
224
220
  }
225
221
  },
226
222
  watch: {
@@ -239,7 +235,7 @@ export default {
239
235
  const { items } = this
240
236
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
241
237
  if (this.customLayout && this.items) {
242
- UtilTools.error('vxe.error.errConflicts', ['custom-layout', 'items'])
238
+ errLog('vxe.error.errConflicts', ['custom-layout', 'items'])
243
239
  }
244
240
  }
245
241
  if (items) {
@@ -283,7 +279,7 @@ export default {
283
279
  */
284
280
  hasUseTooltip ? h('vxe-tooltip', {
285
281
  ref: 'tooltip',
286
- ...tooltipOpts
282
+ props: tooltipOpts
287
283
  }) : _e()
288
284
  ])
289
285
  },
@@ -308,7 +304,7 @@ export default {
308
304
  XEUtils.each(item.slots, (func) => {
309
305
  if (!XEUtils.isFunction(func)) {
310
306
  if (!$scopedSlots[func]) {
311
- UtilTools.error('vxe.error.notSlot', [func])
307
+ errLog('vxe.error.notSlot', [func])
312
308
  }
313
309
  }
314
310
  })
@@ -325,6 +321,10 @@ export default {
325
321
  }, { children: 'children' })
326
322
  return itemList
327
323
  },
324
+ getItemByField (field) {
325
+ const rest = XEUtils.findTree(this.formItems, item => item.field === field, { children: 'children' })
326
+ return rest ? rest.item : null
327
+ },
328
328
  toggleCollapse () {
329
329
  const status = !this.collapseAll
330
330
  this.collapseAll = status
@@ -371,15 +371,6 @@ export default {
371
371
  this.reset()
372
372
  this.$emit('reset', { data: this.data, $form: this, $event: evnt })
373
373
  },
374
- handleTooltipLeaveMethod () {
375
- const { tooltipOpts } = this
376
- setTimeout(() => {
377
- if (!this.tooltipActive) {
378
- this.closeTooltip()
379
- }
380
- }, tooltipOpts.leaveDelay)
381
- return false
382
- },
383
374
  closeTooltip () {
384
375
  const { tooltipStore } = this
385
376
  const $tooltip = this.$refs.tooltip
@@ -394,7 +385,7 @@ export default {
394
385
  }
395
386
  return this.$nextTick()
396
387
  },
397
- triggerHeaderHelpEvent (evnt, params) {
388
+ triggerTitleTipEvent (evnt, params) {
398
389
  const { item } = params
399
390
  const { tooltipStore } = this
400
391
  const $tooltip = this.$refs.tooltip
@@ -402,8 +393,9 @@ export default {
402
393
  const content = (overflowElem.textContent || '').trim()
403
394
  const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth
404
395
  clearTimeout(this.tooltipTimeout)
405
- this.tooltipActive = true
406
- this.closeTooltip()
396
+ if (tooltipStore.item !== item) {
397
+ this.closeTooltip()
398
+ }
407
399
  if (content && isCellOverflow) {
408
400
  Object.assign(tooltipStore, {
409
401
  item,
@@ -414,13 +406,16 @@ export default {
414
406
  }
415
407
  }
416
408
  },
417
- handleTargetLeaveEvent () {
409
+ handleTitleTipLeaveEvent () {
418
410
  const { tooltipOpts } = this
419
- this.tooltipActive = false
411
+ let $tooltip = this.$refs.tooltip
412
+ if ($tooltip) {
413
+ $tooltip.setActived(false)
414
+ }
420
415
  if (tooltipOpts.enterable) {
421
416
  this.tooltipTimeout = setTimeout(() => {
422
- const $tooltip = this.$refs.tooltip
423
- if ($tooltip && !$tooltip.isHover) {
417
+ $tooltip = this.$refs.tooltip
418
+ if ($tooltip && !$tooltip.isActived()) {
424
419
  this.closeTooltip()
425
420
  }
426
421
  }, tooltipOpts.leaveDelay)
@@ -428,15 +423,14 @@ export default {
428
423
  this.closeTooltip()
429
424
  }
430
425
  },
431
- clearValidate (field) {
432
- const itemList = this.getItems()
433
- if (field) {
434
- const item = itemList.find(item => item.field === field)
426
+ clearValidate (fieldOrItem) {
427
+ if (fieldOrItem) {
428
+ const item = handleFieldOrItem(this, fieldOrItem)
435
429
  if (item) {
436
430
  item.showError = false
437
431
  }
438
432
  } else {
439
- itemList.forEach(item => {
433
+ this.getItems().forEach(item => {
440
434
  item.showError = false
441
435
  })
442
436
  }
@@ -446,8 +440,9 @@ export default {
446
440
  this.clearValidate()
447
441
  return this.beginValidate(this.getItems(), '', callback)
448
442
  },
449
- validateField (field, callback) {
450
- return this.beginValidate(this.getItems().filter(item => item.field === field), '', callback)
443
+ validateField (fieldOrItem, callback) {
444
+ const item = handleFieldOrItem(this, fieldOrItem)
445
+ return this.beginValidate(item ? [item] : [], '', callback)
451
446
  },
452
447
  beginValidate (itemList, type, callback) {
453
448
  const { data, rules: formRules, validOpts } = this
@@ -480,7 +475,7 @@ export default {
480
475
  callback()
481
476
  }
482
477
  }).catch(() => {
483
- return new Promise((resolve, reject) => {
478
+ return new Promise((resolve) => {
484
479
  this.showErrTime = setTimeout(() => {
485
480
  itemList.forEach(item => {
486
481
  if (item.errRule) {
@@ -497,7 +492,7 @@ export default {
497
492
  callback(validRest)
498
493
  resolve()
499
494
  } else {
500
- reject(validRest)
495
+ resolve(validRest)
501
496
  }
502
497
  })
503
498
  })
@@ -574,9 +569,8 @@ export default {
574
569
  },
575
570
  handleFocus (fields) {
576
571
  const { $el } = this
577
- const itemList = this.getItems()
578
572
  fields.some((property, index) => {
579
- const item = itemList.find(item => item.field === property)
573
+ const item = this.getItemByField(property)
580
574
  if (item && isEnableConf(item.itemRender)) {
581
575
  const { itemRender } = item
582
576
  const compConf = VXETable.renderer.get(itemRender.name)
@@ -619,8 +613,7 @@ export default {
619
613
  this.clearValidate(property)
620
614
  })
621
615
  .catch(({ rule }) => {
622
- const itemList = this.getItems()
623
- const item = itemList.find(item => item.field === property)
616
+ const item = this.getItemByField(property)
624
617
  if (item) {
625
618
  item.showError = true
626
619
  item.errRule = rule
@@ -1,6 +1,6 @@
1
1
  import GlobalConfig from '../../v-x-e-table/src/conf'
2
2
  import VXETable from '../../v-x-e-table'
3
- import { UtilTools, isEnableConf } from '../../tools'
3
+ import { isEnableConf, getFuncText } from '../../tools/utils'
4
4
 
5
5
  function renderPrefixIcon (h, titlePrefix) {
6
6
  return h('span', {
@@ -23,7 +23,7 @@ function renderSuffixIcon (h, titleSuffix) {
23
23
  }
24
24
 
25
25
  export function renderTitle (h, _vm, item) {
26
- const { data } = _vm
26
+ const { data, tooltipOpts } = _vm
27
27
  const { slots, field, itemRender, titlePrefix, titleSuffix } = item
28
28
  const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
29
29
  const params = { data, property: field, item, $form: _vm }
@@ -34,9 +34,9 @@ export function renderTitle (h, _vm, item) {
34
34
  (titlePrefix.content || titlePrefix.message)
35
35
  ? h('vxe-tooltip', {
36
36
  props: {
37
- content: UtilTools.getFuncText(titlePrefix.content || titlePrefix.message),
38
- enterable: titlePrefix.enterable,
39
- theme: titlePrefix.theme
37
+ ...tooltipOpts,
38
+ ...titlePrefix,
39
+ content: getFuncText(titlePrefix.content || titlePrefix.message)
40
40
  }
41
41
  }, [
42
42
  renderPrefixIcon(h, titlePrefix)
@@ -47,7 +47,7 @@ export function renderTitle (h, _vm, item) {
47
47
  titVNs.push(
48
48
  h('span', {
49
49
  class: 'vxe-form--item-title-label'
50
- }, compConf && compConf.renderItemTitle ? compConf.renderItemTitle(itemRender, params) : (slots && slots.title ? _vm.callSlot(slots.title, params, h) : UtilTools.getFuncText(item.title)))
50
+ }, compConf && compConf.renderItemTitle ? compConf.renderItemTitle(itemRender, params) : (slots && slots.title ? _vm.callSlot(slots.title, params, h) : getFuncText(item.title)))
51
51
  )
52
52
  contVNs.push(
53
53
  h('div', {
@@ -60,9 +60,9 @@ export function renderTitle (h, _vm, item) {
60
60
  (titleSuffix.content || titleSuffix.message)
61
61
  ? h('vxe-tooltip', {
62
62
  props: {
63
- content: UtilTools.getFuncText(titleSuffix.content || titleSuffix.message),
64
- enterable: titleSuffix.enterable,
65
- theme: titleSuffix.theme
63
+ ...tooltipOpts,
64
+ ...titlePrefix,
65
+ content: getFuncText(titleSuffix.content || titleSuffix.message)
66
66
  }
67
67
  }, [
68
68
  renderSuffixIcon(h, titleSuffix)
@@ -1,6 +1,6 @@
1
1
  import XEUtils from 'xe-utils'
2
2
  import VXETable from '../../v-x-e-table'
3
- import { UtilTools } from '../../tools'
3
+ import { warnLog } from '../../tools/log'
4
4
 
5
5
  class ItemConfig {
6
6
  constructor ($xeform, item) {
@@ -31,7 +31,7 @@ class ItemConfig {
31
31
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
32
32
  const compConf = item.itemRender ? VXETable.renderer.get(item.itemRender.name) : null
33
33
  if (compConf && !compConf.renderItemContent && compConf.renderItem) {
34
- UtilTools.warn('vxe.error.delProp', ['item-render.renderItem', 'item-render.renderItemContent'])
34
+ warnLog('vxe.error.delProp', ['item-render.renderItem', 'item-render.renderItemContent'])
35
35
  }
36
36
  }
37
37
  }
@@ -49,6 +49,13 @@ export function getItemConfig ($xeform, _vm, options) {
49
49
  return isItem(_vm) ? _vm : new ItemConfig($xeform, _vm, options)
50
50
  }
51
51
 
52
+ export const handleFieldOrItem = ($xeform, fieldOrItem) => {
53
+ if (fieldOrItem) {
54
+ return XEUtils.isString(fieldOrItem) ? $xeform.getItemByField(fieldOrItem) : fieldOrItem
55
+ }
56
+ return null
57
+ }
58
+
52
59
  export function createItem ($xeform, _vm) {
53
60
  return getItemConfig($xeform, _vm)
54
61
  }
@@ -3,8 +3,10 @@ import XEUtils from 'xe-utils'
3
3
  import GlobalConfig from '../../v-x-e-table/src/conf'
4
4
  import vSize from '../../mixins/size'
5
5
  import VXETable from '../../v-x-e-table'
6
- import { UtilTools, DomTools, GlobalEvent, isEnableConf } from '../../tools'
7
- import { getOffsetHeight, getPaddingTopBottomSize } from '../../tools/src/dom'
6
+ import UtilTools, { isEnableConf } from '../../tools/utils'
7
+ import DomTools, { getOffsetHeight, getPaddingTopBottomSize } from '../../tools/dom'
8
+ import { GlobalEvent } from '../../tools/event'
9
+ import { warnLog, errLog } from '../../tools/log'
8
10
 
9
11
  const methods = {}
10
12
  const propKeys = Object.keys(Table.props)
@@ -59,7 +61,7 @@ function getFuncSlot (_vm, optSlots, slotKey) {
59
61
  return $scopedSlots[funcSlot]
60
62
  } else {
61
63
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
62
- UtilTools.error('vxe.error.notSlot', [funcSlot])
64
+ errLog('vxe.error.notSlot', [funcSlot])
63
65
  }
64
66
  }
65
67
  } else {
@@ -77,10 +79,10 @@ function getToolbarSlots (_vm) {
77
79
  const slots = {}
78
80
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
79
81
  if ($scopedSlots.buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
80
- UtilTools.warn('vxe.error.reqProp', ['toolbar-config.slots.buttons'])
82
+ warnLog('vxe.error.reqProp', ['toolbar-config.slots.buttons'])
81
83
  }
82
84
  if ($scopedSlots.tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
83
- UtilTools.warn('vxe.error.reqProp', ['toolbar-config.slots.tools'])
85
+ warnLog('vxe.error.reqProp', ['toolbar-config.slots.tools'])
84
86
  }
85
87
  }
86
88
  if (toolbarOptSlots) {
@@ -253,15 +255,15 @@ export default {
253
255
  created () {
254
256
  const { data, formOpts, proxyOpts, proxyConfig } = this
255
257
  if (proxyConfig && (data || (proxyOpts.form && formOpts.data))) {
256
- UtilTools.error('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
258
+ errLog('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
257
259
  }
258
260
 
259
261
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
260
262
  if (this.toolbar) {
261
- UtilTools.warn('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config'])
263
+ warnLog('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config'])
262
264
  }
263
265
  if (this.toolbarConfig && !XEUtils.isObject(this.toolbarConfig)) {
264
- UtilTools.warn('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}'])
266
+ warnLog('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}'])
265
267
  }
266
268
  }
267
269
 
@@ -588,7 +590,7 @@ export default {
588
590
  })
589
591
  } else {
590
592
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
591
- UtilTools.error('vxe.error.notFunc', ['proxy-config.ajax.query'])
593
+ errLog('vxe.error.notFunc', ['proxy-config.ajax.query'])
592
594
  }
593
595
  }
594
596
  break
@@ -614,7 +616,7 @@ export default {
614
616
  // 检测弹窗模块
615
617
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
616
618
  if (!VXETable.modal) {
617
- UtilTools.error('vxe.error.reqModule', ['Modal'])
619
+ errLog('vxe.error.reqModule', ['Modal'])
618
620
  }
619
621
  }
620
622
  VXETable.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
@@ -631,7 +633,7 @@ export default {
631
633
  // 检测弹窗模块
632
634
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
633
635
  if (!VXETable.modal) {
634
- UtilTools.error('vxe.error.reqModule', ['Modal'])
636
+ errLog('vxe.error.reqModule', ['Modal'])
635
637
  }
636
638
  }
637
639
  VXETable.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
@@ -643,7 +645,7 @@ export default {
643
645
  // 检测弹窗模块
644
646
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
645
647
  if (!VXETable.modal) {
646
- UtilTools.error('vxe.error.reqModule', ['Modal'])
648
+ errLog('vxe.error.reqModule', ['Modal'])
647
649
  }
648
650
  }
649
651
  VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
@@ -651,7 +653,7 @@ export default {
651
653
  }
652
654
  } else {
653
655
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
654
- UtilTools.error('vxe.error.notFunc', ['proxy-config.ajax.delete'])
656
+ errLog('vxe.error.notFunc', ['proxy-config.ajax.delete'])
655
657
  }
656
658
  }
657
659
  break
@@ -690,7 +692,7 @@ export default {
690
692
  // 检测弹窗模块
691
693
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
692
694
  if (!VXETable.modal) {
693
- UtilTools.error('vxe.error.reqModule', ['Modal'])
695
+ errLog('vxe.error.reqModule', ['Modal'])
694
696
  }
695
697
  }
696
698
  VXETable.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
@@ -707,7 +709,7 @@ export default {
707
709
  // 检测弹窗模块
708
710
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
709
711
  if (!VXETable.modal) {
710
- UtilTools.error('vxe.error.reqModule', ['Modal'])
712
+ errLog('vxe.error.reqModule', ['Modal'])
711
713
  }
712
714
  }
713
715
  VXETable.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
@@ -718,7 +720,7 @@ export default {
718
720
  // 检测弹窗模块
719
721
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
720
722
  if (!VXETable.modal) {
721
- UtilTools.error('vxe.error.reqModule', ['Modal'])
723
+ errLog('vxe.error.reqModule', ['Modal'])
722
724
  }
723
725
  }
724
726
  VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.dataUnchanged'), status: 'info' })
@@ -727,7 +729,7 @@ export default {
727
729
  })
728
730
  } else {
729
731
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
730
- UtilTools.error('vxe.error.notFunc', ['proxy-config.ajax.save'])
732
+ errLog('vxe.error.notFunc', ['proxy-config.ajax.save'])
731
733
  }
732
734
  }
733
735
  break
@@ -762,7 +764,7 @@ export default {
762
764
  // 检测弹窗模块
763
765
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
764
766
  if (!VXETable.modal) {
765
- UtilTools.error('vxe.error.reqModule', ['Modal'])
767
+ errLog('vxe.error.reqModule', ['Modal'])
766
768
  }
767
769
  }
768
770
  VXETable.modal.message({ id: `msg_${code}`, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
@@ -817,7 +819,7 @@ export default {
817
819
  // 检测弹窗模块
818
820
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
819
821
  if (!VXETable.modal) {
820
- UtilTools.error('vxe.error.reqModule', ['Modal'])
822
+ errLog('vxe.error.reqModule', ['Modal'])
821
823
  }
822
824
  }
823
825
  VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
@@ -931,7 +933,7 @@ export default {
931
933
  XEUtils.each(column.slots, (func) => {
932
934
  if (!XEUtils.isFunction(func)) {
933
935
  if (!$scopedSlots[func]) {
934
- UtilTools.error('vxe.error.notSlot', [func])
936
+ errLog('vxe.error.notSlot', [func])
935
937
  }
936
938
  }
937
939
  })
@@ -1,5 +1,6 @@
1
1
  import XEUtils from 'xe-utils'
2
- import { UtilTools, DomTools } from '../../tools'
2
+ import UtilTools from '../../tools/utils'
3
+ import DomTools from '../../tools/dom'
3
4
  import { convertToRows } from './util'
4
5
  import { getColMinWidth } from '../../table/src/util'
5
6
 
@@ -163,7 +164,7 @@ export default {
163
164
  },
164
165
  style: headerCellStyle ? (XEUtils.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle) : null,
165
166
  on: thOns,
166
- key: columnKey || isColGroup ? column.id : $columnIndex
167
+ key: columnKey || columnOpts.useKey || isColGroup ? column.id : $columnIndex
167
168
  }, [
168
169
  h('div', {
169
170
  class: ['vxe-cell', {
@@ -1,9 +1,12 @@
1
1
  import XEUtils from 'xe-utils'
2
2
  import GlobalConfig from '../../v-x-e-table/src/conf'
3
3
  import vSize from '../../mixins/size'
4
- import { UtilTools, DomTools, GlobalEvent } from '../../tools'
4
+ import UtilTools, { getFuncText } from '../../tools/utils'
5
+ import DomTools from '../../tools/dom'
6
+ import { GlobalEvent } from '../../tools/event'
5
7
  import { toStringTimeDate, getDateQuarter } from './date'
6
8
  import { handleNumber, toFloatValueFixed } from './number'
9
+ import { warnLog } from '../../tools/log'
7
10
 
8
11
  const yearSize = 20
9
12
  const monthSize = 20
@@ -962,7 +965,7 @@ export default {
962
965
  inpPlaceholder () {
963
966
  const { placeholder } = this
964
967
  if (placeholder) {
965
- return UtilTools.getFuncText(placeholder)
968
+ return getFuncText(placeholder)
966
969
  }
967
970
  return ''
968
971
  },
@@ -1017,7 +1020,7 @@ export default {
1017
1020
  },
1018
1021
  mounted () {
1019
1022
  if (this.dateConfig) {
1020
- UtilTools.warn('vxe.error.removeProp', ['date-config'])
1023
+ warnLog('vxe.error.removeProp', ['date-config'])
1021
1024
  }
1022
1025
  if (this.isDatePickerType) {
1023
1026
  if (this.transfer) {
@@ -1,6 +1,5 @@
1
1
  import XEUtils from 'xe-utils'
2
- import { DomTools } from '../../tools'
3
- import { browse } from '../../tools/src/dom'
2
+ import DomTools, { browse } from '../../tools/dom'
4
3
 
5
4
  function getTargetOffset (target, container) {
6
5
  let offsetTop = 0
@@ -1,8 +1,9 @@
1
1
  import XEUtils from 'xe-utils'
2
2
  import GlobalConfig from '../../v-x-e-table/src/conf'
3
3
  import vSize from '../../mixins/size'
4
- import { GlobalEvent, createResizeEvent } from '../../tools'
5
- import { browse } from '../../tools/src/dom'
4
+ import { createResizeEvent } from '../../tools/resize'
5
+ import { GlobalEvent } from '../../tools/event'
6
+ import { browse } from '../../tools/dom'
6
7
 
7
8
  export default {
8
9
  name: 'VxeList',
@@ -1,6 +1,8 @@
1
1
  import XEUtils from 'xe-utils'
2
- import { UtilTools, DomTools, isEnableConf } from '../../tools'
2
+ import UtilTools, { isEnableConf } from '../../tools/utils'
3
+ import DomTools from '../../tools/dom'
3
4
  import VXETable from '../../v-x-e-table'
5
+ import { warnLog } from '../../tools/log'
4
6
 
5
7
  export default {
6
8
  methods: {
@@ -104,7 +106,7 @@ export default {
104
106
  // 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
105
107
  if (this.$listeners[`${typePrefix}cell-context-menu`]) {
106
108
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
107
- UtilTools.warn('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`])
109
+ warnLog('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`])
108
110
  }
109
111
  this.emitEvent(`${typePrefix}cell-context-menu`, params, evnt)
110
112
  } else {
@@ -255,7 +257,7 @@ export default {
255
257
  // 在 v4 中废弃事件 context-menu-click
256
258
  if (this.$listeners['context-menu-click']) {
257
259
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
258
- UtilTools.warn('vxe.error.delEvent', ['context-menu-click', 'menu-click'])
260
+ warnLog('vxe.error.delEvent', ['context-menu-click', 'menu-click'])
259
261
  }
260
262
  this.emitEvent('context-menu-click', params, evnt)
261
263
  } else {
@@ -1,4 +1,4 @@
1
- import { UtilTools } from '../../tools'
1
+ import { getFuncText } from '../../tools/utils'
2
2
 
3
3
  export default {
4
4
  name: 'VxeTableContextMenu',
@@ -53,7 +53,7 @@ export default {
53
53
  }),
54
54
  h('span', {
55
55
  class: 'vxe-context-menu--link-content'
56
- }, UtilTools.getFuncText(item.name)),
56
+ }, getFuncText(item.name)),
57
57
  h('i', {
58
58
  class: ['vxe-context-menu--link-suffix', hasChildMenus ? item.suffixIcon || 'suffix--haschild' : item.suffixIcon]
59
59
  })
@@ -89,7 +89,7 @@ export default {
89
89
  }),
90
90
  h('span', {
91
91
  class: 'vxe-context-menu--link-content'
92
- }, UtilTools.getFuncText(child.name))
92
+ }, getFuncText(child.name))
93
93
  ])
94
94
  ])
95
95
  })) : null