vxe-table 4.7.3 → 4.7.5

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 (112) hide show
  1. package/es/colgroup/index.js +1 -1
  2. package/es/column/index.js +1 -1
  3. package/es/grid/index.js +1 -1
  4. package/es/grid/src/grid.js +1 -1
  5. package/es/style.css +1 -1
  6. package/es/style.min.css +1 -1
  7. package/es/table/index.js +1 -1
  8. package/es/table/module/custom/hook.js +19 -3
  9. package/es/table/module/custom/panel.js +264 -160
  10. package/es/table/module/edit/hook.js +1 -1
  11. package/es/table/module/export/export-panel.js +1 -1
  12. package/es/table/module/export/hook.js +1 -1
  13. package/es/table/module/export/import-panel.js +1 -1
  14. package/es/table/module/filter/hook.js +1 -1
  15. package/es/table/module/filter/panel.js +1 -1
  16. package/es/table/module/menu/hook.js +1 -1
  17. package/es/table/module/validator/hook.js +1 -1
  18. package/es/table/render/index.js +1 -1
  19. package/es/table/src/body.js +1 -1
  20. package/es/table/src/cell.js +1 -1
  21. package/es/table/src/columnInfo.js +3 -1
  22. package/es/table/src/props.js +1 -1
  23. package/es/table/src/table.js +9 -3
  24. package/es/table/style.css +69 -9
  25. package/es/table/style.min.css +1 -1
  26. package/es/toolbar/index.js +1 -1
  27. package/es/toolbar/src/toolbar.js +2 -2
  28. package/es/ui/index.js +4 -2
  29. package/es/vxe-table/style.css +69 -9
  30. package/es/vxe-table/style.min.css +1 -1
  31. package/lib/colgroup/index.js +4 -4
  32. package/lib/colgroup/index.min.js +1 -1
  33. package/lib/column/index.js +4 -4
  34. package/lib/column/index.min.js +1 -1
  35. package/lib/grid/index.js +3 -3
  36. package/lib/grid/index.min.js +1 -1
  37. package/lib/grid/src/grid.js +20 -20
  38. package/lib/grid/src/grid.min.js +1 -1
  39. package/lib/index.umd.js +864 -737
  40. package/lib/index.umd.min.js +1 -1
  41. package/lib/style.css +1 -1
  42. package/lib/style.min.css +1 -1
  43. package/lib/table/index.js +3 -3
  44. package/lib/table/index.min.js +1 -1
  45. package/lib/table/module/custom/hook.js +25 -4
  46. package/lib/table/module/custom/hook.min.js +1 -1
  47. package/lib/table/module/custom/panel.js +178 -84
  48. package/lib/table/module/custom/panel.min.js +1 -1
  49. package/lib/table/module/edit/hook.js +2 -2
  50. package/lib/table/module/edit/hook.min.js +1 -1
  51. package/lib/table/module/export/export-panel.js +2 -2
  52. package/lib/table/module/export/export-panel.min.js +1 -1
  53. package/lib/table/module/export/hook.js +20 -20
  54. package/lib/table/module/export/hook.min.js +1 -1
  55. package/lib/table/module/export/import-panel.js +2 -2
  56. package/lib/table/module/export/import-panel.min.js +1 -1
  57. package/lib/table/module/filter/hook.js +2 -2
  58. package/lib/table/module/filter/hook.min.js +1 -1
  59. package/lib/table/module/filter/panel.js +2 -2
  60. package/lib/table/module/filter/panel.min.js +1 -1
  61. package/lib/table/module/menu/hook.js +2 -2
  62. package/lib/table/module/menu/hook.min.js +1 -1
  63. package/lib/table/module/validator/hook.js +2 -2
  64. package/lib/table/module/validator/hook.min.js +1 -1
  65. package/lib/table/render/index.js +2 -2
  66. package/lib/table/render/index.min.js +1 -1
  67. package/lib/table/src/body.js +2 -2
  68. package/lib/table/src/body.min.js +1 -1
  69. package/lib/table/src/cell.js +2 -2
  70. package/lib/table/src/cell.min.js +1 -1
  71. package/lib/table/src/columnInfo.js +4 -2
  72. package/lib/table/src/columnInfo.min.js +1 -1
  73. package/lib/table/src/props.js +2 -2
  74. package/lib/table/src/props.min.js +1 -1
  75. package/lib/table/src/table.js +15 -6
  76. package/lib/table/src/table.min.js +1 -1
  77. package/lib/table/style/style.css +69 -9
  78. package/lib/table/style/style.min.css +1 -1
  79. package/lib/toolbar/index.js +3 -3
  80. package/lib/toolbar/index.min.js +1 -1
  81. package/lib/toolbar/src/toolbar.js +3 -3
  82. package/lib/toolbar/src/toolbar.min.js +1 -1
  83. package/lib/ui/index.js +4 -2
  84. package/lib/ui/index.min.js +1 -1
  85. package/lib/vxe-table/style/style.css +69 -9
  86. package/lib/vxe-table/style/style.min.css +1 -1
  87. package/package.json +2 -2
  88. package/packages/colgroup/index.ts +1 -1
  89. package/packages/column/index.ts +1 -1
  90. package/packages/grid/index.ts +1 -1
  91. package/packages/grid/src/grid.ts +1 -1
  92. package/packages/table/index.ts +1 -1
  93. package/packages/table/module/custom/hook.ts +20 -4
  94. package/packages/table/module/custom/panel.ts +273 -166
  95. package/packages/table/module/edit/hook.ts +1 -1
  96. package/packages/table/module/export/export-panel.ts +1 -1
  97. package/packages/table/module/export/hook.ts +1 -1
  98. package/packages/table/module/export/import-panel.ts +1 -1
  99. package/packages/table/module/filter/hook.ts +1 -1
  100. package/packages/table/module/filter/panel.ts +1 -1
  101. package/packages/table/module/menu/hook.ts +1 -1
  102. package/packages/table/module/validator/hook.ts +1 -1
  103. package/packages/table/render/index.ts +1 -1
  104. package/packages/table/src/body.ts +1 -1
  105. package/packages/table/src/cell.ts +1 -1
  106. package/packages/table/src/columnInfo.ts +5 -1
  107. package/packages/table/src/props.ts +1 -1
  108. package/packages/table/src/table.ts +9 -3
  109. package/packages/toolbar/index.ts +1 -1
  110. package/packages/toolbar/src/toolbar.ts +2 -2
  111. package/packages/ui/index.ts +2 -0
  112. package/styles/components/table-module/custom.scss +78 -4
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h, createCommentVNode, ref, Ref, computed, reactive, inject, nextTick, resolveComponent } from 'vue'
2
- import { VxeUI } from 'vxe-pc-ui'
2
+ import { VxeUI } from '../../../ui'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { formatText } from '../../../ui/src/utils'
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { inject, nextTick } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
- import { VxeUI } from 'vxe-pc-ui'
3
+ import { VxeUI } from '../../../ui'
4
4
  import { isColumnInfo, mergeBodyMethod, getCellValue } from '../../src/util'
5
5
  import { parseFile, formatText } from '../../../ui/src/utils'
6
6
  import { createHtmlPage, getExportBlobByContent } from './util'
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h, ref, Ref, computed, inject, reactive, nextTick, resolveComponent } from 'vue'
2
- import { VxeUI } from 'vxe-pc-ui'
2
+ import { VxeUI } from '../../../ui'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { parseFile } from '../../../ui/src/utils'
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { nextTick } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
- import { VxeUI } from 'vxe-pc-ui'
3
+ import { VxeUI } from '../../../ui'
4
4
  import { toFilters, handleFieldOrColumn } from '../../src/util'
5
5
  import { getDomNode, triggerEvent } from '../../../ui/src/dom'
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h, computed, inject } from 'vue'
2
- import { VxeUI } from 'vxe-pc-ui'
2
+ import { VxeUI } from '../../../ui'
3
3
  import { formatText } from '../../../ui/src/utils'
4
4
  import { getPropClass } from '../../../ui/src/dom'
5
5
  import { getSlotVNs } from '../../../ui/src/vn'
@@ -1,6 +1,6 @@
1
1
  import { nextTick } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
- import { VxeUI } from 'vxe-pc-ui'
3
+ import { VxeUI } from '../../../ui'
4
4
  import { getDomNode, getAbsolutePos, getEventTargetNode } from '../../../ui/src/dom'
5
5
  import { isEnableConf, hasChildrenList } from '../../../ui/src/utils'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { nextTick } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
- import { VxeUI } from 'vxe-pc-ui'
3
+ import { VxeUI } from '../../../ui'
4
4
  import { getFuncText, eqEmptyValue } from '../../../ui/src/utils'
5
5
  import { scrollToView } from '../../../ui/src/dom'
6
6
  import { handleFieldOrColumn, getRowid } from '../../src/util'
@@ -1,6 +1,6 @@
1
1
  import { h, resolveComponent, ComponentOptions } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
- import { VxeUI } from 'vxe-pc-ui'
3
+ import { VxeUI } from '../../ui'
4
4
  import { getCellValue, setCellValue } from '../../table/src/util'
5
5
  import { getFuncText, formatText, isEmptyValue } from '../../ui/src/utils'
6
6
  import { getOnName } from '../../ui/src/vn'
@@ -1,6 +1,6 @@
1
1
  import { createCommentVNode, defineComponent, h, ref, Ref, PropType, inject, nextTick, ComputedRef, onBeforeUnmount, onMounted, onUnmounted } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
- import { VxeUI } from 'vxe-pc-ui'
3
+ import { VxeUI } from '../../ui'
4
4
  import { mergeBodyMethod, getRowid, removeScrollListener, restoreScrollListener, XEBodyScrollElement } from './util'
5
5
  import { updateCellTitle, getPropClass } from '../../ui/src/dom'
6
6
  import { isEnableConf } from '../../ui/src/utils'
@@ -1,6 +1,6 @@
1
1
  import { h, VNode } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
- import { VxeUI } from 'vxe-pc-ui'
3
+ import { VxeUI } from '../../ui'
4
4
  import { getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
5
5
  import { updateCellTitle } from '../../ui/src/dom'
6
6
  import { createColumn, getRowid } from './util'
@@ -1,5 +1,5 @@
1
1
  import XEUtils from 'xe-utils'
2
- import { VxeUI } from 'vxe-pc-ui'
2
+ import { VxeUI } from '../../ui'
3
3
  import { toFilters } from './util'
4
4
  import { getFuncText } from '../../ui/src/utils'
5
5
 
@@ -102,6 +102,7 @@ export class ColumnInfo {
102
102
  halfVisible: false,
103
103
  defaultVisible: visible,
104
104
  defaultFixed: _vm.fixed,
105
+
105
106
  checked: false,
106
107
  halfChecked: false,
107
108
  disabled: false,
@@ -120,6 +121,9 @@ export class ColumnInfo {
120
121
  sortNumber: 0, // 用于记录自定义列顺序
121
122
  renderSortNumber: 0, // 用于记录自定义列顺序
122
123
 
124
+ renderFixed: '',
125
+ renderVisible: false,
126
+
123
127
  renderWidth: 0,
124
128
  renderHeight: 0,
125
129
  resizeWidth: 0, // 手动调整
@@ -1,5 +1,5 @@
1
1
  import { PropType } from 'vue'
2
- import { VxeUI } from 'vxe-pc-ui'
2
+ import { VxeUI } from '../../ui'
3
3
 
4
4
  import type { VxeTablePropTypes } from '../../../types'
5
5
 
@@ -2,7 +2,7 @@ import { defineComponent, h, createCommentVNode, ComponentPublicInstance, resolv
2
2
  import XEUtils from 'xe-utils'
3
3
  import { browse, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, isNodeElement } from '../../ui/src/dom'
4
4
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
5
- import { VxeUI } from 'vxe-pc-ui'
5
+ import { VxeUI } from '../../ui'
6
6
  import Cell from './cell'
7
7
  import TableBodyComponent from './body'
8
8
  import TableHeaderComponent from './header'
@@ -125,7 +125,10 @@ export default defineComponent({
125
125
  activeBtn: false,
126
126
  activeWrapper: false,
127
127
  visible: false,
128
- maxHeight: 0
128
+ maxHeight: 0,
129
+ oldSortMaps: {},
130
+ oldFixedMaps: {},
131
+ oldVisibleMaps: {}
129
132
  },
130
133
  customColumnList: [],
131
134
  // 当前选中的筛选列
@@ -887,13 +890,16 @@ export default defineComponent({
887
890
  const restoreCustomStorage = () => {
888
891
  const { id, customConfig } = props
889
892
  const customOpts = computeCustomOpts.value
890
- const { storage } = customOpts
893
+ const { storage, restoreStore } = customOpts
891
894
  const isAllCustom = storage === true
892
895
  const storageOpts: VxeTableDefines.VxeTableCustomStorageObj = isAllCustom ? {} : Object.assign({}, storage || {})
893
896
  const isCustomResizable = isAllCustom || storageOpts.resizable
894
897
  const isCustomVisible = isAllCustom || storageOpts.visible
895
898
  const isCustomFixed = isAllCustom || storageOpts.fixed
896
899
  const isCustomSort = isAllCustom || storageOpts.sort
900
+ if (storage && id && restoreStore) {
901
+ restoreStore({ id })
902
+ }
897
903
  if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
898
904
  const customMap: {
899
905
  [key: string]: {
@@ -1,5 +1,5 @@
1
1
  import { App } from 'vue'
2
- import { VxeUI } from 'vxe-pc-ui'
2
+ import { VxeUI } from '../ui'
3
3
  import VxeToolbarComponent from './src/toolbar'
4
4
 
5
5
  export const VxeToolbar = Object.assign({}, VxeToolbarComponent, {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, h, ref, Ref, computed, inject, createCommentVNode, VNode, reactive, nextTick, PropType, resolveComponent } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
- import { VxeUI } from 'vxe-pc-ui'
3
+ import { VxeUI } from '../../ui'
4
4
  import { getSlotVNs } from '../../ui/src/vn'
5
5
 
6
6
  import type { VxeGridConstructor, GridPrivateMethods, ToolbarMethods, VxeToolbarConstructor, VxeToolbarEmits, VxeToolbarPropTypes, VxeTableConstructor, ToolbarPrivateRef, VxeTableMethods, VxeTablePrivateMethods, ToolbarReactData, VxeButtonComponent } from '../../../types'
@@ -129,7 +129,7 @@ export default defineComponent({
129
129
  customStore.activeBtn = false
130
130
  setTimeout(() => {
131
131
  if (!customStore.activeBtn && !customStore.activeWrapper) {
132
- $xeTable.customColseEvent($event)
132
+ $xeTable.customCloseEvent($event)
133
133
  }
134
134
  }, 350)
135
135
  }
@@ -59,6 +59,7 @@ VxeUI.setConfig({
59
59
  // },
60
60
  customConfig: {
61
61
  allowFixed: true,
62
+ allowSort: true,
62
63
  showFooter: true
63
64
  // storage: false,
64
65
  // checkMethod () {}
@@ -218,6 +219,7 @@ VxeUI.setIcon({
218
219
  TABLE_CHECKBOX_INDETERMINATE: iconPrefix + 'checkbox-indeterminate-fill',
219
220
  TABLE_RADIO_CHECKED: iconPrefix + 'radio-checked-fill',
220
221
  TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
222
+ TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
221
223
 
222
224
  // toolbar
223
225
  TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
@@ -1,8 +1,52 @@
1
1
  @import '../../helpers/mixin.scss';
2
2
 
3
3
  .vxe-table-custom--option {
4
+ position: relative;
4
5
  display: flex;
5
6
  flex-direction: row;
7
+ &.active--drag-target {
8
+ &[drag-pos="top"] {
9
+ &::after {
10
+ display: block;
11
+ top: -2px;
12
+ }
13
+ }
14
+ &[drag-pos="bottom"] {
15
+ &::after {
16
+ display: block;
17
+ bottom: -2px;
18
+ }
19
+ }
20
+ }
21
+ &:first-child {
22
+ &[drag-pos="top"] {
23
+ &::after {
24
+ top: 0;
25
+ }
26
+ }
27
+ }
28
+ &:last-child {
29
+ &[drag-pos="bottom"] {
30
+ &::after {
31
+ bottom: 0;
32
+ }
33
+ }
34
+ }
35
+ &::after {
36
+ display: none;
37
+ content: "";
38
+ position: absolute;
39
+ left: -1px;
40
+ width: calc(100% + 1px);
41
+ height: 3px;
42
+ background-color: var(--vxe-ui-font-primary-color);
43
+ z-index: 12;
44
+ }
45
+ &:last-child {
46
+ &::after {
47
+ width: 100%;
48
+ }
49
+ }
6
50
  }
7
51
 
8
52
  .vxe-table-custom-wrapper {
@@ -21,6 +65,10 @@
21
65
  }
22
66
  }
23
67
 
68
+ .vxe-table-custom--list-wrapper {
69
+ display: block;
70
+ }
71
+
24
72
  .vxe-table-custom--header,
25
73
  .vxe-table-custom--body {
26
74
  list-style-type: none;
@@ -30,8 +78,8 @@
30
78
  padding: 0;
31
79
  user-select: none;
32
80
  & > li {
33
- max-width: 18em;
34
- min-width: 14em;
81
+ max-width: 26em;
82
+ min-width: 17em;
35
83
  padding: 0.2em 1em 0.2em 1em;
36
84
  @for $i from 2 through 8 {
37
85
  $interval: $i - 1 + 0.2;
@@ -62,12 +110,14 @@
62
110
  }
63
111
 
64
112
  .vxe-table-custom--footer {
113
+ display: flex;
114
+ flex-direction: row;
65
115
  border-top: 1px solid var(--vxe-ui-base-popup-border-color);
66
116
  text-align: right;
67
117
  button {
68
118
  background-color: transparent;
69
119
  width: 50%;
70
- height: 2.5em;
120
+ height: 2.8em;
71
121
  border: 0;
72
122
  color: var(--vxe-ui-font-color);
73
123
  text-align: center;
@@ -83,10 +133,31 @@
83
133
 
84
134
  .vxe-table-custom--checkbox-option {
85
135
  @include createCheckboxIcon();
136
+ }
137
+ .vxe-table-custom--checkbox-option,
138
+ .vxe-table-custom--sort-option {
139
+ padding-right: 0.4em;
140
+ flex-shrink: 0;
141
+ }
142
+ .vxe-table-custom--sort-option {
143
+ display: flex;
144
+ flex-direction: row;
145
+ align-items: center;
146
+ justify-content: center;
147
+ }
148
+ .vxe-table-custom--sort-btn {
149
+ padding-left: 0.1em;
150
+ padding-right: 0.3em;
151
+ cursor: grabbing;
152
+ &:hover {
153
+ color: var(--vxe-ui-font-primary-color);
154
+ }
155
+ }
156
+ .vxe-table-custom--checkbox-label {
157
+ flex-grow: 1;
86
158
  overflow: hidden;
87
159
  text-overflow: ellipsis;
88
160
  white-space: nowrap;
89
- flex-grow: 1;
90
161
  }
91
162
 
92
163
  .vxe-table-custom--fixed-option {
@@ -271,6 +342,9 @@
271
342
  font-size: 1.2em;
272
343
  padding: 0.2em 0.5em;
273
344
  cursor: grab;
345
+ &:hover {
346
+ color: var(--vxe-ui-font-primary-color);
347
+ }
274
348
  &:active {
275
349
  cursor: grabbing;
276
350
  }