vxe-table 4.7.4 → 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 (40) hide show
  1. package/es/style.css +1 -1
  2. package/es/style.min.css +1 -1
  3. package/es/table/module/custom/hook.js +18 -2
  4. package/es/table/module/custom/panel.js +263 -159
  5. package/es/table/src/columnInfo.js +2 -0
  6. package/es/table/src/table.js +8 -2
  7. package/es/table/style.css +69 -9
  8. package/es/table/style.min.css +1 -1
  9. package/es/toolbar/src/toolbar.js +1 -1
  10. package/es/ui/index.js +4 -2
  11. package/es/vxe-table/style.css +69 -9
  12. package/es/vxe-table/style.min.css +1 -1
  13. package/lib/index.umd.js +214 -87
  14. package/lib/index.umd.min.js +1 -1
  15. package/lib/style.css +1 -1
  16. package/lib/style.min.css +1 -1
  17. package/lib/table/module/custom/hook.js +23 -2
  18. package/lib/table/module/custom/hook.min.js +1 -1
  19. package/lib/table/module/custom/panel.js +174 -80
  20. package/lib/table/module/custom/panel.min.js +1 -1
  21. package/lib/table/src/columnInfo.js +2 -0
  22. package/lib/table/src/columnInfo.min.js +1 -1
  23. package/lib/table/src/table.js +11 -2
  24. package/lib/table/src/table.min.js +1 -1
  25. package/lib/table/style/style.css +69 -9
  26. package/lib/table/style/style.min.css +1 -1
  27. package/lib/toolbar/src/toolbar.js +1 -1
  28. package/lib/toolbar/src/toolbar.min.js +1 -1
  29. package/lib/ui/index.js +4 -2
  30. package/lib/ui/index.min.js +1 -1
  31. package/lib/vxe-table/style/style.css +69 -9
  32. package/lib/vxe-table/style/style.min.css +1 -1
  33. package/package.json +2 -2
  34. package/packages/table/module/custom/hook.ts +19 -3
  35. package/packages/table/module/custom/panel.ts +272 -165
  36. package/packages/table/src/columnInfo.ts +4 -0
  37. package/packages/table/src/table.ts +8 -2
  38. package/packages/toolbar/src/toolbar.ts +1 -1
  39. package/packages/ui/index.ts +2 -0
  40. package/styles/components/table-module/custom.scss +78 -4
@@ -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]: {
@@ -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
  }