vxe-table 3.7.0-beta.15 → 3.7.0-beta.17

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 (56) hide show
  1. package/README.md +1 -1
  2. package/lib/edit/src/mixin.js +6 -4
  3. package/lib/edit/src/mixin.min.js +1 -1
  4. package/lib/export/src/mixin.js +4 -1
  5. package/lib/export/src/mixin.min.js +1 -1
  6. package/lib/icon/style/style.css +1 -1
  7. package/lib/icon/style/style.min.css +1 -1
  8. package/lib/index.css +1 -1
  9. package/lib/index.umd.js +663 -428
  10. package/lib/index.umd.min.js +1 -1
  11. package/lib/input/src/input.js +24 -1
  12. package/lib/input/src/input.min.js +1 -1
  13. package/lib/input/style/style.css +21 -0
  14. package/lib/input/style/style.min.css +1 -1
  15. package/lib/keyboard/src/mixin.js +4 -1
  16. package/lib/keyboard/src/mixin.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/style.min.css +1 -1
  19. package/lib/table/src/body.js +10 -8
  20. package/lib/table/src/body.min.js +1 -1
  21. package/lib/table/src/cell.js +20 -16
  22. package/lib/table/src/cell.min.js +1 -1
  23. package/lib/table/src/methods.js +573 -379
  24. package/lib/table/src/methods.min.js +1 -1
  25. package/lib/table/src/table.js +15 -13
  26. package/lib/table/src/table.min.js +1 -1
  27. package/lib/table/style/style.css +2 -2
  28. package/lib/table/style/style.min.css +1 -1
  29. package/lib/tools/log.js +1 -1
  30. package/lib/tools/log.min.js +1 -1
  31. package/lib/v-x-e-table/index.js +1 -1
  32. package/lib/v-x-e-table/index.min.js +1 -1
  33. package/lib/validator/src/mixin.js +4 -1
  34. package/lib/validator/src/mixin.min.js +1 -1
  35. package/package.json +4 -9
  36. package/packages/edit/src/mixin.js +7 -5
  37. package/packages/export/src/mixin.js +2 -1
  38. package/packages/input/src/input.js +24 -1
  39. package/packages/keyboard/src/mixin.js +2 -1
  40. package/packages/table/src/body.js +10 -8
  41. package/packages/table/src/cell.js +18 -14
  42. package/packages/table/src/methods.js +408 -202
  43. package/packages/table/src/table.js +15 -13
  44. package/packages/validator/src/mixin.js +2 -1
  45. package/styles/css-variable.scss +3 -3
  46. package/styles/input.scss +25 -0
  47. package/styles/table.scss +6 -2
  48. package/styles/textarea.scss +3 -3
  49. package/styles/variable.scss +3 -3
  50. package/types/v-x-e-table/index.d.ts +1 -1
  51. /package/lib/icon/style/{iconfont.1692577739980.ttf → iconfont.1693628087676.ttf} +0 -0
  52. /package/lib/icon/style/{iconfont.1692577739980.woff → iconfont.1693628087676.woff} +0 -0
  53. /package/lib/icon/style/{iconfont.1692577739980.woff2 → iconfont.1693628087676.woff2} +0 -0
  54. /package/lib/{iconfont.1692577739980.ttf → iconfont.1693628087676.ttf} +0 -0
  55. /package/lib/{iconfont.1692577739980.woff → iconfont.1693628087676.woff} +0 -0
  56. /package/lib/{iconfont.1692577739980.woff2 → iconfont.1693628087676.woff2} +0 -0
@@ -302,9 +302,9 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
302
302
  treeOpts,
303
303
  expandOpts,
304
304
  editOpts,
305
- treeExpandeds,
305
+ treeExpandedMaps,
306
306
  scrollYLoad,
307
- rowExpandeds,
307
+ rowExpandedMaps,
308
308
  radioOpts,
309
309
  checkboxOpts,
310
310
  expandColumn,
@@ -341,7 +341,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
341
341
  const seq = rest ? rest.seq : -1
342
342
  const params = { $table: $xetable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
343
343
  // 行是否被展开
344
- const isExpandRow = expandColumn && rowExpandeds.length && rowExpandeds.indexOf(row) > -1
344
+ const isExpandRow = expandColumn && !!rowExpandedMaps[rowid]
345
345
  // 树节点是否被展开
346
346
  let isExpandTree = false
347
347
  let rowChildren = []
@@ -350,9 +350,9 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
350
350
  if (editConfig) {
351
351
  isNewRow = $xetable.isInsertByRow(row)
352
352
  }
353
- if (treeConfig && !scrollYLoad && !treeOpts.transform && treeExpandeds.length) {
353
+ if (treeConfig && !scrollYLoad && !treeOpts.transform) {
354
354
  rowChildren = row[childrenField]
355
- isExpandTree = rowChildren && rowChildren.length && treeExpandeds.indexOf(row) > -1
355
+ isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid]
356
356
  }
357
357
  rows.push(
358
358
  h('tr', {
@@ -365,7 +365,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
365
365
  'is--expand-row': isExpandRow,
366
366
  'is--expand-tree': isExpandTree,
367
367
  'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
368
- 'row--radio': radioOpts.highlight && $xetable.selectRow === row,
368
+ 'row--radio': radioOpts.highlight && $xetable.selectRadioRow === row,
369
369
  'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
370
370
  },
371
371
  rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
@@ -504,8 +504,10 @@ export default {
504
504
  },
505
505
  beforeDestroy () {
506
506
  clearTimeout(this.wheelTime)
507
- this.$el._onscroll = null
508
- this.$el.onscroll = null
507
+ if (this.$el) {
508
+ this.$el._onscroll = null
509
+ this.$el.onscroll = null
510
+ }
509
511
  },
510
512
  destroyed () {
511
513
  const { $parent: $xetable, fixedType } = this
@@ -3,7 +3,7 @@ import GlobalConfig from '../../v-x-e-table/src/conf'
3
3
  import VXETable from '../../v-x-e-table'
4
4
  import DomTools from '../../tools/dom'
5
5
  import UtilTools, { eqEmptyValue, isEnableConf, getFuncText } from '../../tools/utils'
6
- import { getColumnConfig } from './util'
6
+ import { getRowid, getColumnConfig } from './util'
7
7
  import { getSlotVNs } from '../../tools/vn'
8
8
 
9
9
  function renderHelpIcon (h, params) {
@@ -204,7 +204,7 @@ export const Cell = {
204
204
  */
205
205
  renderTreeIcon (h, params, cellVNodes) {
206
206
  const { $table, isHidden } = params
207
- const { treeOpts, treeExpandeds, treeLazyLoadeds } = $table
207
+ const { treeOpts, treeExpandedMaps, treeExpandLazyLoadedMaps } = $table
208
208
  const { row, column, level } = params
209
209
  const { slots } = column
210
210
  const { indent, lazy, trigger, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts
@@ -219,9 +219,10 @@ export const Cell = {
219
219
  return $table.callSlot(slots.icon, params, h, cellVNodes)
220
220
  }
221
221
  if (!isHidden) {
222
- isAceived = $table.findRowIndexOf(treeExpandeds, row) > -1
222
+ const rowid = getRowid($table, row)
223
+ isAceived = !!treeExpandedMaps[rowid]
223
224
  if (lazy) {
224
- isLazyLoaded = $table.findRowIndexOf(treeLazyLoadeds, row) > -1
225
+ isLazyLoaded = !!treeExpandLazyLoadedMaps[rowid]
225
226
  hasLazyChilds = row[hasChildField]
226
227
  }
227
228
  }
@@ -296,13 +297,13 @@ export const Cell = {
296
297
  },
297
298
  renderRadioCell (h, params) {
298
299
  const { $table, column, isHidden } = params
299
- const { radioOpts, selectRow } = $table
300
+ const { radioOpts, selectRadioRow } = $table
300
301
  const { slots } = column
301
302
  const { labelField, checkMethod, visibleMethod } = radioOpts
302
303
  const { row } = params
303
304
  const defaultSlot = slots ? slots.default : null
304
305
  const radioSlot = slots ? slots.radio : null
305
- const isChecked = row === selectRow
306
+ const isChecked = row === selectRadioRow
306
307
  const isVisible = !visibleMethod || visibleMethod({ row })
307
308
  let isDisabled = !!checkMethod
308
309
  let on
@@ -409,7 +410,7 @@ export const Cell = {
409
410
  },
410
411
  renderCheckboxCell (h, params) {
411
412
  const { $table, row, column, isHidden } = params
412
- const { treeConfig, treeIndeterminates, selectCheckboxRows } = $table
413
+ const { treeConfig, treeIndeterminateMaps, selectCheckboxMaps } = $table
413
414
  const { labelField, checkMethod, visibleMethod } = $table.checkboxOpts
414
415
  const { slots } = column
415
416
  const defaultSlot = slots ? slots.default : null
@@ -420,7 +421,8 @@ export const Cell = {
420
421
  let isDisabled = !!checkMethod
421
422
  let on
422
423
  if (!isHidden) {
423
- isChecked = $table.findRowIndexOf(selectCheckboxRows, row) > -1
424
+ const rowid = getRowid($table, row)
425
+ isChecked = !!selectCheckboxMaps[rowid]
424
426
  on = {
425
427
  click (evnt) {
426
428
  if (!isDisabled && isVisible) {
@@ -433,7 +435,7 @@ export const Cell = {
433
435
  isDisabled = !checkMethod({ row })
434
436
  }
435
437
  if (treeConfig) {
436
- indeterminate = $table.findRowIndexOf(treeIndeterminates, row) > -1
438
+ indeterminate = !!treeIndeterminateMaps[rowid]
437
439
  }
438
440
  }
439
441
  const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
@@ -471,7 +473,7 @@ export const Cell = {
471
473
  },
472
474
  renderCheckboxCellByProp (h, params) {
473
475
  const { $table, row, column, isHidden } = params
474
- const { treeConfig, treeIndeterminates, checkboxOpts } = $table
476
+ const { treeConfig, treeIndeterminateMaps, checkboxOpts } = $table
475
477
  const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts
476
478
  const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField
477
479
  const { slots } = column
@@ -483,6 +485,7 @@ export const Cell = {
483
485
  let isDisabled = !!checkMethod
484
486
  let on
485
487
  if (!isHidden) {
488
+ const rowid = getRowid($table, row)
486
489
  isChecked = XEUtils.get(row, checkField)
487
490
  on = {
488
491
  click (evnt) {
@@ -496,7 +499,7 @@ export const Cell = {
496
499
  isDisabled = !checkMethod({ row })
497
500
  }
498
501
  if (treeConfig) {
499
- isIndeterminate = $table.findRowIndexOf(treeIndeterminates, row) > -1
502
+ isIndeterminate = !!treeIndeterminateMaps[rowid]
500
503
  }
501
504
  }
502
505
  const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate }
@@ -538,7 +541,7 @@ export const Cell = {
538
541
  */
539
542
  renderExpandCell (h, params) {
540
543
  const { $table, isHidden, row, column } = params
541
- const { expandOpts, rowExpandeds, expandLazyLoadeds } = $table
544
+ const { expandOpts, rowExpandedMaps, rowExpandLazyLoadedMaps } = $table
542
545
  const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts
543
546
  const { slots } = column
544
547
  const defaultSlot = slots ? slots.default : null
@@ -548,9 +551,10 @@ export const Cell = {
548
551
  return $table.callSlot(slots.icon, params, h)
549
552
  }
550
553
  if (!isHidden) {
551
- isAceived = $table.findRowIndexOf(rowExpandeds, params.row) > -1
554
+ const rowid = getRowid($table, row)
555
+ isAceived = !!rowExpandedMaps[rowid]
552
556
  if (lazy) {
553
- isLazyLoaded = $table.findRowIndexOf(expandLazyLoadeds, row) > -1
557
+ isLazyLoaded = !!rowExpandLazyLoadedMaps[rowid]
554
558
  }
555
559
  }
556
560
  return [