vxe-table 3.8.8 → 3.8.9-beta.0

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 (46) hide show
  1. package/lib/button/src/button.js +87 -41
  2. package/lib/button/src/button.min.js +1 -1
  3. package/lib/custom/src/panel.js +2 -16
  4. package/lib/custom/src/panel.min.js +1 -1
  5. package/lib/icon/style/style.css +1 -1
  6. package/lib/icon/style/style.min.css +1 -1
  7. package/lib/index.css +1 -1
  8. package/lib/index.umd.js +604 -709
  9. package/lib/index.umd.min.js +1 -1
  10. package/lib/input/style/style.css +6 -1
  11. package/lib/input/style/style.min.css +1 -1
  12. package/lib/style.css +1 -1
  13. package/lib/style.min.css +1 -1
  14. package/lib/table/src/columnInfo.js +2 -0
  15. package/lib/table/src/header.js +1 -1
  16. package/lib/table/src/header.min.js +1 -1
  17. package/lib/table/src/methods.js +454 -599
  18. package/lib/table/src/methods.min.js +1 -1
  19. package/lib/table/src/table.js +5 -3
  20. package/lib/table/src/table.min.js +1 -1
  21. package/lib/tools/log.js +1 -1
  22. package/lib/tools/log.min.js +1 -1
  23. package/lib/v-x-e-table/index.js +1 -1
  24. package/lib/v-x-e-table/index.min.js +1 -1
  25. package/lib/v-x-e-table/src/conf.js +1 -0
  26. package/lib/v-x-e-table/src/conf.min.js +1 -1
  27. package/lib/v-x-e-table/src/renderer.js +1 -0
  28. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  29. package/lib/vxe-input/style/style.css +6 -1
  30. package/lib/vxe-input/style/style.min.css +1 -1
  31. package/package.json +1 -1
  32. package/packages/button/src/button.js +71 -31
  33. package/packages/custom/src/panel.js +2 -14
  34. package/packages/table/src/columnInfo.js +1 -1
  35. package/packages/table/src/header.js +1 -1
  36. package/packages/table/src/methods.js +140 -250
  37. package/packages/table/src/table.js +6 -4
  38. package/packages/v-x-e-table/src/conf.js +1 -0
  39. package/packages/v-x-e-table/src/renderer.js +1 -0
  40. package/styles/input.scss +6 -1
  41. /package/lib/icon/style/{iconfont.1719197379838.ttf → iconfont.1719319728613.ttf} +0 -0
  42. /package/lib/icon/style/{iconfont.1719197379838.woff → iconfont.1719319728613.woff} +0 -0
  43. /package/lib/icon/style/{iconfont.1719197379838.woff2 → iconfont.1719319728613.woff2} +0 -0
  44. /package/lib/{iconfont.1719197379838.ttf → iconfont.1719319728613.ttf} +0 -0
  45. /package/lib/{iconfont.1719197379838.woff → iconfont.1719319728613.woff} +0 -0
  46. /package/lib/{iconfont.1719197379838.woff2 → iconfont.1719319728613.woff2} +0 -0
@@ -15,10 +15,7 @@ const { calcHeight, hasClass, addClass, removeClass, getEventTargetNode, isNodeE
15
15
  const isWebkit = browse['-webkit'] && !browse.edge
16
16
  const debounceScrollYDuration = browse.msie ? 80 : 20
17
17
 
18
- const resizableStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_WIDTH'
19
- const visibleStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_VISIBLE'
20
- const fixedStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_FIXED'
21
- const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT'
18
+ const customStorageKey = 'VXE_CUSTOM_STORE'
22
19
 
23
20
  /**
24
21
  * 生成行的唯一主键
@@ -46,10 +43,19 @@ function getNextSortOrder (_vm, column) {
46
43
  return orders[oIndex < orders.length ? oIndex : 0]
47
44
  }
48
45
 
49
- function getCustomStorageMap (key) {
46
+ const getCustomStorageMap = (id) => {
50
47
  const version = GlobalConfig.version
51
- const rest = XEUtils.toStringJSON(localStorage.getItem(key))
52
- return rest && rest._v === version ? rest : { _v: version }
48
+ const rest = XEUtils.toStringJSON(localStorage.getItem(customStorageKey) || '')
49
+ const maps = rest && rest._v === version ? rest : { _v: version }
50
+ return (id ? maps[id] : maps) || {}
51
+ }
52
+
53
+ const setCustomStorageMap = (id, data) => {
54
+ const version = GlobalConfig.version
55
+ const maps = getCustomStorageMap()
56
+ maps[id] = data || undefined
57
+ maps._v = version
58
+ localStorage.setItem(customStorageKey, XEUtils.toJSONString(maps))
53
59
  }
54
60
 
55
61
  const getRecoverRowMaps = (_vm, keyMaps) => {
@@ -592,27 +598,32 @@ const Methods = {
592
598
  this.collectColumn = collectColumn
593
599
  const tableFullColumn = getColumnList(collectColumn)
594
600
  this.tableFullColumn = tableFullColumn
601
+ this._isLoading = true
595
602
  this.initColumnSort()
596
- this.restoreCustomStorage()
597
- this.cacheColumnMap()
598
- this.parseColumns().then(() => {
599
- if (this.scrollXLoad) {
600
- this.loadScrollXData(true)
601
- }
602
- })
603
- this.clearMergeCells()
604
- this.clearMergeFooterItems()
605
- this.handleTableData(true)
606
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
607
- if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
608
- warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
609
- }
610
- }
611
- return this.$nextTick().then(() => {
612
- if (this.$toolbar) {
613
- this.$toolbar.syncUpdate({ collectColumn, $table: this })
603
+ return Promise.resolve(
604
+ this.restoreCustomStorage()
605
+ ).then(() => {
606
+ this._isLoading = false
607
+ this.cacheColumnMap()
608
+ this.parseColumns().then(() => {
609
+ if (this.scrollXLoad) {
610
+ this.loadScrollXData(true)
611
+ }
612
+ })
613
+ this.clearMergeCells()
614
+ this.clearMergeFooterItems()
615
+ this.handleTableData(true)
616
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
617
+ if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
618
+ warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
619
+ }
614
620
  }
615
- return this.recalculate()
621
+ return this.$nextTick().then(() => {
622
+ if (this.$toolbar) {
623
+ this.$toolbar.syncUpdate({ collectColumn, $table: this })
624
+ }
625
+ return this.recalculate()
626
+ })
616
627
  })
617
628
  },
618
629
  /**
@@ -682,6 +693,9 @@ const Methods = {
682
693
  }
683
694
  this.tableSourceData = sourceData
684
695
  },
696
+ getParams () {
697
+ return this.params
698
+ },
685
699
  loadTreeChildren (row, childRecords) {
686
700
  const { keepSource, tableSourceData, treeOpts, fullDataRowIdData, fullDataRowMap, fullAllDataRowMap, fullAllDataRowIdData, sourceDataRowIdData } = this
687
701
  const { transform, mapChildrenField } = treeOpts
@@ -1569,7 +1583,7 @@ const Methods = {
1569
1583
  XEUtils.eachTree([targetColumn], (column) => {
1570
1584
  column.fixed = fixed
1571
1585
  })
1572
- this.saveCustomFixed()
1586
+ this.saveCustomStore('update:fixed')
1573
1587
  return this.refreshColumn()
1574
1588
  }
1575
1589
  return this.$nextTick()
@@ -1584,7 +1598,7 @@ const Methods = {
1584
1598
  XEUtils.eachTree([targetColumn], (column) => {
1585
1599
  column.fixed = null
1586
1600
  })
1587
- this.saveCustomFixed()
1601
+ this.saveCustomStore('update:fixed')
1588
1602
  return this.refreshColumn()
1589
1603
  }
1590
1604
  return this.$nextTick()
@@ -1662,15 +1676,7 @@ const Methods = {
1662
1676
  }
1663
1677
  column.renderResizeWidth = column.renderWidth
1664
1678
  })
1665
- if (opts.resizable) {
1666
- this.saveCustomResizable(true)
1667
- }
1668
- if (opts.sort) {
1669
- this.saveCustomSort(true)
1670
- }
1671
- if (opts.fixed) {
1672
- this.saveCustomFixed()
1673
- }
1679
+ this.saveCustomStore('reset')
1674
1680
  return this.handleCustom()
1675
1681
  },
1676
1682
  handleCustom () {
@@ -1684,116 +1690,30 @@ const Methods = {
1684
1690
  this.clearCopyCellArea()
1685
1691
  }
1686
1692
  }
1687
- this.saveCustomStore()
1688
1693
  this.analyColumnWidth()
1689
1694
  return this.refreshColumn(true)
1690
1695
  },
1691
- /**
1692
- * 还原自定义列操作状态
1693
- */
1694
- restoreCustomStorage () {
1695
- const { id, customConfig, customOpts } = this
1696
- const { storage, restoreStore } = customOpts
1697
- const isAllStorage = storage === true
1698
- const storageOpts = isAllStorage ? {} : Object.assign({}, storage || {})
1699
- const isCustomResizable = isAllStorage || storageOpts.resizable
1700
- const isCustomVisible = isAllStorage || storageOpts.visible
1701
- const isCustomFixed = isAllStorage || storageOpts.fixed
1702
- const isCustomSort = isAllStorage || storageOpts.sort
1703
- if (storage && id && restoreStore) {
1704
- restoreStore({ id })
1705
- }
1706
- if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
1707
- const customMap = {}
1708
- if (!id) {
1709
- errLog('vxe.error.reqProp', ['id'])
1710
- return
1711
- }
1712
- if (isCustomResizable) {
1713
- const columnWidthStorage = getCustomStorageMap(resizableStorageKey)[id]
1714
- if (columnWidthStorage) {
1715
- XEUtils.each(columnWidthStorage, (resizeWidth, field) => {
1716
- customMap[field] = { field, resizeWidth }
1717
- })
1696
+ handleCustomRestore (storeData) {
1697
+ const { tableFullColumn } = this
1698
+ let { collectColumn } = this
1699
+ const { resizableData, sortData, visibleData, fixedData } = storeData
1700
+ let hasCustomSort = false
1701
+ // 处理还原
1702
+ if (resizableData || sortData || visibleData || fixedData) {
1703
+ tableFullColumn.forEach(column => {
1704
+ const colKey = column.getKey()
1705
+ if (resizableData && XEUtils.isNumber(resizableData[colKey])) {
1706
+ column.resizeWidth = resizableData[colKey]
1718
1707
  }
1719
- }
1720
- // 自定义固定列
1721
- if (isCustomFixed) {
1722
- const columnFixedStorage = getCustomStorageMap(fixedStorageKey)[id]
1723
- if (columnFixedStorage) {
1724
- const colFixeds = columnFixedStorage.split(',')
1725
- colFixeds.forEach((fixConf) => {
1726
- const [field, fixed] = fixConf.split('|')
1727
- if (customMap[field]) {
1728
- customMap[field].fixed = fixed
1729
- } else {
1730
- customMap[field] = { field, fixed }
1731
- }
1732
- })
1708
+ if (visibleData && XEUtils.isBoolean(visibleData[colKey])) {
1709
+ column.visible = visibleData[colKey]
1733
1710
  }
1734
- }
1735
- // 自定义顺序
1736
- let hasCustomSort = false
1737
- if (isCustomSort) {
1738
- const columnSortStorage = getCustomStorageMap(sortStorageKey)[id]
1739
- if (columnSortStorage) {
1740
- XEUtils.each(columnSortStorage, (renderSortNumber, colKey) => {
1741
- if (customMap[colKey]) {
1742
- customMap[colKey].renderSortNumber = renderSortNumber
1743
- } else {
1744
- customMap[colKey] = { renderSortNumber }
1745
- }
1746
- if (!hasCustomSort) {
1747
- hasCustomSort = true
1748
- }
1749
- })
1711
+ if (fixedData && fixedData[colKey]) {
1712
+ column.fixed = fixedData[colKey]
1750
1713
  }
1751
- }
1752
- if (isCustomVisible) {
1753
- const columnVisibleStorage = getCustomStorageMap(visibleStorageKey)[id]
1754
- if (columnVisibleStorage) {
1755
- const colVisibles = columnVisibleStorage.split('|')
1756
- const colHides = colVisibles[0] ? colVisibles[0].split(',') : []
1757
- const colShows = colVisibles[1] ? colVisibles[1].split(',') : []
1758
- colHides.forEach(field => {
1759
- if (customMap[field]) {
1760
- customMap[field].visible = false
1761
- } else {
1762
- customMap[field] = { field, visible: false }
1763
- }
1764
- })
1765
- colShows.forEach(field => {
1766
- if (customMap[field]) {
1767
- customMap[field].visible = true
1768
- } else {
1769
- customMap[field] = { field, visible: true }
1770
- }
1771
- })
1772
- }
1773
- }
1774
- let { collectColumn } = this
1775
- const keyMap = {}
1776
- XEUtils.eachTree(collectColumn, column => {
1777
- const colKey = column.getKey()
1778
- if (colKey) {
1779
- keyMap[colKey] = column
1780
- }
1781
- })
1782
- XEUtils.each(customMap, ({ visible, resizeWidth, fixed, renderSortNumber }, field) => {
1783
- const column = keyMap[field]
1784
- if (column) {
1785
- if (XEUtils.isNumber(resizeWidth)) {
1786
- column.resizeWidth = resizeWidth
1787
- }
1788
- if (XEUtils.isBoolean(visible)) {
1789
- column.visible = visible
1790
- }
1791
- if (fixed) {
1792
- column.fixed = fixed
1793
- }
1794
- if (renderSortNumber) {
1795
- column.renderSortNumber = Number(renderSortNumber)
1796
- }
1714
+ if (sortData && XEUtils.isNumber(sortData[colKey])) {
1715
+ hasCustomSort = true
1716
+ column.renderSortNumber = sortData[colKey]
1797
1717
  }
1798
1718
  })
1799
1719
  // 如果自定义了顺序
@@ -1804,87 +1724,66 @@ const Methods = {
1804
1724
  }
1805
1725
  }
1806
1726
  },
1807
- saveCustomFixed () {
1808
- const { id, collectColumn, customConfig, customOpts } = this
1809
- const { storage } = customOpts
1810
- const isAllStorage = storage === true
1811
- const storageOpts = isAllStorage ? {} : Object.assign({}, storage || {})
1812
- const isCustomFixed = isAllStorage || storageOpts.fixed
1813
- if (customConfig && isCustomFixed) {
1814
- const columnFixedStorageMap = getCustomStorageMap(fixedStorageKey)
1815
- const colFixeds = []
1727
+ /**
1728
+ * 还原自定义列操作状态
1729
+ */
1730
+ restoreCustomStorage () {
1731
+ const { id, customConfig, customOpts } = this
1732
+ const { storage, restoreStore } = customOpts
1733
+ const isAllCustom = storage === true
1734
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {})
1735
+ const isCustomResizable = isAllCustom || storageOpts.resizable
1736
+ const isCustomVisible = isAllCustom || storageOpts.visible
1737
+ const isCustomFixed = isAllCustom || storageOpts.fixed
1738
+ const isCustomSort = isAllCustom || storageOpts.sort
1739
+ if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
1816
1740
  if (!id) {
1817
1741
  errLog('vxe.error.reqProp', ['id'])
1818
1742
  return
1819
1743
  }
1820
- XEUtils.eachTree(collectColumn, (column) => {
1821
- if (column.fixed && column.fixed !== column.defaultFixed) {
1822
- const colKey = column.getKey()
1823
- if (colKey) {
1824
- colFixeds.push(`${colKey}|${column.fixed}`)
1744
+ const storeData = getCustomStorageMap(id)
1745
+ if (restoreStore) {
1746
+ return Promise.resolve(
1747
+ restoreStore({ id, type: 'restore', storeData })
1748
+ ).then(storeData => {
1749
+ if (!storeData) {
1750
+ return
1825
1751
  }
1826
- }
1827
- })
1828
- columnFixedStorageMap[id] = colFixeds.join(',') || undefined
1829
- localStorage.setItem(fixedStorageKey, XEUtils.toJSONString(columnFixedStorageMap))
1830
- }
1831
- },
1832
- saveCustomVisible () {
1833
- const { id, collectColumn, customConfig, customOpts } = this
1834
- const { checkMethod, storage } = customOpts
1835
- const isAllStorage = storage === true
1836
- const storageOpts = isAllStorage ? {} : Object.assign({}, storage || {})
1837
- const isCustomVisible = isAllStorage || storageOpts.visible
1838
- if (customConfig && isCustomVisible) {
1839
- const columnVisibleStorageMap = getCustomStorageMap(visibleStorageKey)
1840
- const colHides = []
1841
- const colShows = []
1842
- if (!id) {
1843
- errLog('vxe.error.reqProp', ['id'])
1844
- return
1752
+ return this.handleCustomRestore(storeData)
1753
+ }).catch(e => e)
1754
+ } else {
1755
+ return this.handleCustomRestore(storeData)
1845
1756
  }
1846
- XEUtils.eachTree(collectColumn, column => {
1847
- if (!checkMethod || checkMethod({ column })) {
1848
- if (!column.visible && column.defaultVisible) {
1849
- const colKey = column.getKey()
1850
- if (colKey) {
1851
- colHides.push(colKey)
1852
- }
1853
- } else if (column.visible && !column.defaultVisible) {
1854
- const colKey = column.getKey()
1855
- if (colKey) {
1856
- colShows.push(colKey)
1857
- }
1858
- }
1859
- }
1860
- })
1861
- columnVisibleStorageMap[id] = [colHides.join(',')].concat(colShows.length ? [colShows.join(',')] : []).join('|') || undefined
1862
- localStorage.setItem(visibleStorageKey, XEUtils.toJSONString(columnVisibleStorageMap))
1863
1757
  }
1864
1758
  },
1865
1759
  getCustomStoreData () {
1866
- const { id, collectColumn, customOpts } = this
1760
+ const { id, customOpts, collectColumn } = this
1867
1761
  const { checkMethod } = customOpts
1868
1762
  const resizableData = {}
1869
1763
  const sortData = {}
1870
1764
  const visibleData = {}
1871
1765
  const fixedData = {}
1872
1766
  const storeData = {
1873
- resizableData,
1874
- sortData,
1875
- visibleData,
1876
- fixedData
1767
+ resizableData: undefined,
1768
+ sortData: undefined,
1769
+ visibleData: undefined,
1770
+ fixedData: undefined
1877
1771
  }
1878
1772
  if (!id) {
1879
1773
  errLog('vxe.error.reqProp', ['id'])
1880
1774
  return storeData
1881
1775
  }
1776
+ let hasResizable = 0
1777
+ let hasSort = 0
1778
+ let hasFixedt = 0
1779
+ let hasVisible = 0
1882
1780
  XEUtils.eachTree(collectColumn, (column, index, items, path, parent) => {
1883
1781
  // 排序只支持一级
1884
1782
  if (!parent) {
1885
1783
  collectColumn.forEach((column) => {
1886
1784
  const colKey = column.getKey()
1887
1785
  if (colKey) {
1786
+ hasSort = 1
1888
1787
  sortData[colKey] = column.renderSortNumber
1889
1788
  }
1890
1789
  })
@@ -1892,12 +1791,14 @@ const Methods = {
1892
1791
  if (column.resizeWidth) {
1893
1792
  const colKey = column.getKey()
1894
1793
  if (colKey) {
1794
+ hasResizable = 1
1895
1795
  resizableData[colKey] = column.renderWidth
1896
1796
  }
1897
1797
  }
1898
1798
  if (column.fixed && column.fixed !== column.defaultFixed) {
1899
1799
  const colKey = column.getKey()
1900
1800
  if (colKey) {
1801
+ hasFixedt = 1
1901
1802
  fixedData[colKey] = column.fixed
1902
1803
  }
1903
1804
  }
@@ -1905,78 +1806,65 @@ const Methods = {
1905
1806
  if (!column.visible && column.defaultVisible) {
1906
1807
  const colKey = column.getKey()
1907
1808
  if (colKey) {
1809
+ hasVisible = 1
1908
1810
  visibleData[colKey] = false
1909
1811
  }
1910
1812
  } else if (column.visible && !column.defaultVisible) {
1911
1813
  const colKey = column.getKey()
1912
1814
  if (colKey) {
1815
+ hasVisible = 1
1913
1816
  visibleData[colKey] = true
1914
1817
  }
1915
1818
  }
1916
1819
  }
1917
1820
  })
1918
- return storeData
1919
- },
1920
- saveCustomStore () {
1921
- this.saveCustomVisible()
1922
- this.saveCustomSort()
1923
- this.saveCustomFixed()
1924
- this.saveCustomResizable()
1925
- },
1926
- saveCustomResizable (isReset) {
1927
- const { id, collectColumn, customConfig, customOpts } = this
1928
- const { storage } = customOpts
1929
- const isAllStorage = storage === true
1930
- const storageOpts = isAllStorage ? {} : Object.assign({}, storage || {})
1931
- const isResizable = isAllStorage || storageOpts.resizable
1932
- if (customConfig && isResizable) {
1933
- const columnWidthStorageMap = getCustomStorageMap(resizableStorageKey)
1934
- let columnWidthStorage
1935
- if (!id) {
1936
- errLog('vxe.error.reqProp', ['id'])
1937
- return
1938
- }
1939
- if (!isReset) {
1940
- columnWidthStorage = XEUtils.isPlainObject(columnWidthStorageMap[id]) ? columnWidthStorageMap[id] : {}
1941
- XEUtils.eachTree(collectColumn, column => {
1942
- if (column.resizeWidth) {
1943
- const colKey = column.getKey()
1944
- if (colKey) {
1945
- columnWidthStorage[colKey] = column.renderWidth
1946
- }
1947
- }
1948
- })
1949
- }
1950
- columnWidthStorageMap[id] = XEUtils.isEmpty(columnWidthStorage) ? undefined : columnWidthStorage
1951
- localStorage.setItem(resizableStorageKey, XEUtils.toJSONString(columnWidthStorageMap))
1821
+ if (hasResizable) {
1822
+ storeData.resizableData = resizableData
1823
+ }
1824
+ if (hasSort) {
1825
+ storeData.sortData = sortData
1952
1826
  }
1827
+ if (hasFixedt) {
1828
+ storeData.fixedData = fixedData
1829
+ }
1830
+ if (hasVisible) {
1831
+ storeData.visibleData = visibleData
1832
+ }
1833
+ return storeData
1953
1834
  },
1954
- saveCustomSort (isReset) {
1955
- const { id, collectColumn, customConfig, customOpts } = this
1956
- const { storage } = customOpts
1957
- const isAllStorage = storage === true
1958
- const storageOpts = isAllStorage ? {} : Object.assign({}, storage || {})
1959
- const isSort = isAllStorage || storageOpts.sort
1960
- if (customConfig && isSort) {
1961
- const columnSortStorageMap = getCustomStorageMap(sortStorageKey)
1962
- let columnWidthStorage
1835
+ saveCustomStore (type) {
1836
+ const { id, customOpts } = this
1837
+ const { updateStore, storage } = customOpts
1838
+ const isAllCustom = storage === true
1839
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {})
1840
+ const isCustomResizable = isAllCustom || storageOpts.resizable
1841
+ const isCustomVisible = isAllCustom || storageOpts.visible
1842
+ const isCustomFixed = isAllCustom || storageOpts.fixed
1843
+ const isCustomSort = isAllCustom || storageOpts.sort
1844
+ if (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort) {
1963
1845
  if (!id) {
1964
1846
  errLog('vxe.error.reqProp', ['id'])
1965
- return
1847
+ return this.$nextTick()
1966
1848
  }
1967
- if (!isReset) {
1968
- columnWidthStorage = XEUtils.isPlainObject(columnSortStorageMap[id]) ? columnSortStorageMap[id] : {}
1969
- // 排序只支持一级
1970
- collectColumn.forEach(column => {
1971
- const colKey = column.getKey()
1972
- if (colKey) {
1973
- columnWidthStorage[colKey] = column.renderSortNumber
1849
+ const storeData = type === 'reset'
1850
+ ? {
1851
+ resizableData: {},
1852
+ sortData: {},
1853
+ visibleData: {},
1854
+ fixedData: {}
1974
1855
  }
1856
+ : this.getCustomStoreData()
1857
+ if (updateStore) {
1858
+ return updateStore({
1859
+ id,
1860
+ type,
1861
+ storeData
1975
1862
  })
1863
+ } else {
1864
+ setCustomStorageMap(id, type === 'reset' ? null : storeData)
1976
1865
  }
1977
- columnSortStorageMap[id] = XEUtils.isEmpty(columnWidthStorage) ? undefined : columnWidthStorage
1978
- localStorage.setItem(sortStorageKey, XEUtils.toJSONString(columnSortStorageMap))
1979
1866
  }
1867
+ return this.$nextTick()
1980
1868
  },
1981
1869
  handleUpdateDataQueue () {
1982
1870
  this.upDataFlag++
@@ -2718,10 +2606,12 @@ const Methods = {
2718
2606
  this.clearSelected()
2719
2607
  }
2720
2608
  if (areaOpts.autoClear) {
2721
- if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
2609
+ const cellAreas = this.getCellAreas()
2610
+ if (cellAreas.length && !getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
2722
2611
  this.preventEvent(evnt, 'event.clearAreas', {}, () => {
2723
2612
  this.clearCellAreas()
2724
2613
  this.clearCopyCellArea()
2614
+ this.emitEvent('clear-cell-area-selection', { cellAreas }, evnt)
2725
2615
  })
2726
2616
  }
2727
2617
  }
@@ -481,7 +481,8 @@ export default {
481
481
  message: true,
482
482
  isHeader: false,
483
483
  isFooter: false
484
- }
484
+ },
485
+ _isLoading: false
485
486
  }
486
487
  },
487
488
  computed: {
@@ -1060,6 +1061,7 @@ export default {
1060
1061
  editRules
1061
1062
  } = this
1062
1063
  const { leftList, rightList } = columnStore
1064
+ const currLoading = this._isLoading || loading
1063
1065
  return h('div', {
1064
1066
  class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
1065
1067
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
@@ -1079,8 +1081,8 @@ export default {
1079
1081
  'is--animat': !!this.animat,
1080
1082
  'is--round': this.round,
1081
1083
  'is--stripe': !treeConfig && stripe,
1082
- 'is--loading': loading,
1083
- 'is--empty': !loading && !tableData.length,
1084
+ 'is--loading': currLoading,
1085
+ 'is--empty': !currLoading && !tableData.length,
1084
1086
  'is--scroll-y': overflowY,
1085
1087
  'is--scroll-x': overflowX,
1086
1088
  'is--virtual-x': scrollXLoad,
@@ -1184,7 +1186,7 @@ export default {
1184
1186
  h(VxeLoading, {
1185
1187
  class: 'vxe-table--loading',
1186
1188
  props: {
1187
- value: loading,
1189
+ value: currLoading,
1188
1190
  icon: loadingOpts.icon,
1189
1191
  text: loadingOpts.text
1190
1192
  }
@@ -344,6 +344,7 @@ export default {
344
344
  button: {
345
345
  // size: null,
346
346
  // transfer: false
347
+ trigger: 'hover'
347
348
  },
348
349
  buttonGroup: {
349
350
  // size: null
@@ -714,6 +714,7 @@ const renderMap = {
714
714
  case 'date':
715
715
  case 'week':
716
716
  case 'month':
717
+ case 'quarter':
717
718
  case 'year':
718
719
  cellValue = getLabelFormatDate(cellValue, props)
719
720
  break
package/styles/input.scss CHANGED
@@ -331,8 +331,13 @@ $iconWidth: 1.6em;
331
331
  }
332
332
  }
333
333
 
334
+ .vxe-input--panel {
335
+ pointer-events: none;
336
+ }
337
+
334
338
  .vxe-input--panel-wrapper,
335
339
  .vxe-input--panel-layout-wrapper {
340
+ pointer-events: auto;
336
341
  background-color: $vxe-input-panel-background-color;
337
342
  border: 1px solid $vxe-table-popup-border-color;
338
343
  box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
@@ -345,7 +350,7 @@ $iconWidth: 1.6em;
345
350
  }
346
351
 
347
352
  .vxe-input--panel-layout-wrapper {
348
- display: flex;
353
+ display: inline-flex;
349
354
  flex-direction: row;
350
355
  }
351
356