vxe-table 4.7.6 → 4.7.7

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 (65) hide show
  1. package/es/grid/src/grid.js +10 -9
  2. package/es/style.css +1 -1
  3. package/es/style.min.css +1 -1
  4. package/es/table/module/custom/hook.js +8 -15
  5. package/es/table/module/custom/panel.js +166 -102
  6. package/es/table/module/edit/hook.js +11 -10
  7. package/es/table/module/export/hook.js +14 -11
  8. package/es/table/module/validator/hook.js +6 -5
  9. package/es/table/render/index.js +3 -2
  10. package/es/table/src/columnInfo.js +10 -8
  11. package/es/table/src/table.js +140 -80
  12. package/es/table/style.css +39 -8
  13. package/es/table/style.min.css +1 -1
  14. package/es/toolbar/src/toolbar.js +12 -11
  15. package/es/ui/index.js +6 -3
  16. package/es/ui/src/log.js +5 -0
  17. package/es/vxe-table/style.css +39 -8
  18. package/es/vxe-table/style.min.css +1 -1
  19. package/lib/grid/src/grid.js +9 -9
  20. package/lib/grid/src/grid.min.js +1 -1
  21. package/lib/index.umd.js +326 -201
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.min.css +1 -1
  25. package/lib/table/module/custom/hook.js +8 -17
  26. package/lib/table/module/custom/hook.min.js +1 -1
  27. package/lib/table/module/custom/panel.js +96 -42
  28. package/lib/table/module/custom/panel.min.js +1 -1
  29. package/lib/table/module/edit/hook.js +10 -10
  30. package/lib/table/module/edit/hook.min.js +1 -1
  31. package/lib/table/module/export/hook.js +14 -12
  32. package/lib/table/module/export/hook.min.js +1 -1
  33. package/lib/table/module/validator/hook.js +6 -6
  34. package/lib/table/module/validator/hook.min.js +1 -1
  35. package/lib/table/render/index.js +3 -3
  36. package/lib/table/render/index.min.js +1 -1
  37. package/lib/table/src/columnInfo.js +10 -9
  38. package/lib/table/src/columnInfo.min.js +1 -1
  39. package/lib/table/src/table.js +146 -80
  40. package/lib/table/src/table.min.js +1 -1
  41. package/lib/table/style/style.css +39 -8
  42. package/lib/table/style/style.min.css +1 -1
  43. package/lib/toolbar/src/toolbar.js +11 -11
  44. package/lib/toolbar/src/toolbar.min.js +1 -1
  45. package/lib/ui/index.js +6 -3
  46. package/lib/ui/index.min.js +1 -1
  47. package/lib/ui/src/log.js +13 -0
  48. package/lib/ui/src/log.min.js +1 -0
  49. package/lib/vxe-table/style/style.css +39 -8
  50. package/lib/vxe-table/style/style.min.css +1 -1
  51. package/package.json +2 -2
  52. package/packages/grid/src/grid.ts +10 -9
  53. package/packages/table/module/custom/hook.ts +10 -17
  54. package/packages/table/module/custom/panel.ts +166 -104
  55. package/packages/table/module/edit/hook.ts +11 -10
  56. package/packages/table/module/export/hook.ts +18 -13
  57. package/packages/table/module/validator/hook.ts +6 -5
  58. package/packages/table/render/index.ts +3 -2
  59. package/packages/table/src/columnInfo.ts +11 -8
  60. package/packages/table/src/table.ts +139 -80
  61. package/packages/toolbar/src/toolbar.ts +12 -11
  62. package/packages/ui/index.ts +4 -1
  63. package/packages/ui/src/log.ts +8 -0
  64. package/styles/components/table-module/custom.scss +41 -7
  65. package/styles/components/table.scss +1 -0
@@ -2,10 +2,11 @@ import { defineComponent, h, ref, Ref, computed, inject, createCommentVNode, VNo
2
2
  import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../ui'
4
4
  import { getSlotVNs } from '../../ui/src/vn'
5
+ import { warnLog, errLog } from '../../ui/src/log'
5
6
 
6
7
  import type { VxeGridConstructor, GridPrivateMethods, ToolbarMethods, VxeToolbarConstructor, VxeToolbarEmits, VxeToolbarPropTypes, VxeTableConstructor, ToolbarPrivateRef, VxeTableMethods, VxeTablePrivateMethods, ToolbarReactData, VxeButtonComponent } from '../../../types'
7
8
 
8
- const { getConfig, getIcon, getI18n, renderer, commands, log, createEvent, useFns } = VxeUI
9
+ const { getConfig, getIcon, getI18n, renderer, commands, createEvent, useFns } = VxeUI
9
10
 
10
11
  export default defineComponent({
11
12
  name: 'VxeToolbar',
@@ -103,7 +104,7 @@ export default defineComponent({
103
104
  if ($xeTable) {
104
105
  return true
105
106
  }
106
- log.err('vxe.error.barUnableLink')
107
+ errLog('vxe.error.barUnableLink')
107
108
  }
108
109
 
109
110
  const handleClickSettingEvent = ({ $event }: any) => {
@@ -111,7 +112,7 @@ export default defineComponent({
111
112
  if ($xeTable.triggerCustomEvent) {
112
113
  $xeTable.triggerCustomEvent($event)
113
114
  } else {
114
- log.err('vxe.error.reqModule', ['VxeTableCustomModule'])
115
+ errLog('vxe.error.reqModule', ['VxeTableCustomModule'])
115
116
  }
116
117
  }
117
118
  }
@@ -120,7 +121,7 @@ export default defineComponent({
120
121
  if ($xeTable) {
121
122
  $xeTable.customOpenEvent($event)
122
123
  } else {
123
- log.err('vxe.error.reqModule', ['VxeTableCustomModule'])
124
+ errLog('vxe.error.reqModule', ['VxeTableCustomModule'])
124
125
  }
125
126
  }
126
127
 
@@ -176,7 +177,7 @@ export default defineComponent({
176
177
  gCommandOpts.commandMethod(params)
177
178
  } else {
178
179
  if (process.env.VUE_APP_VXE_ENV === 'development') {
179
- log.err('vxe.error.notCommands', [code])
180
+ errLog('vxe.error.notCommands', [code])
180
181
  }
181
182
  }
182
183
  }
@@ -198,7 +199,7 @@ export default defineComponent({
198
199
  gCommandOpts.commandMethod(params)
199
200
  } else {
200
201
  if (process.env.VUE_APP_VXE_ENV === 'development') {
201
- log.err('vxe.error.notCommands', [code])
202
+ errLog('vxe.error.notCommands', [code])
202
203
  }
203
204
  }
204
205
  }
@@ -459,21 +460,21 @@ export default defineComponent({
459
460
  const refreshOpts = computeRefreshOpts.value
460
461
  const queryMethod = refreshOpts.queryMethod || refreshOpts.query
461
462
  if (refresh && !$xeGrid && !queryMethod) {
462
- log.warn('vxe.error.notFunc', ['queryMethod'])
463
+ warnLog('vxe.error.notFunc', ['queryMethod'])
463
464
  }
464
465
  const customOpts = computeCustomOpts.value
465
466
  if (process.env.VUE_APP_VXE_ENV === 'development') {
466
467
  if (customOpts.isFooter) {
467
- log.warn('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter'])
468
+ warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter'])
468
469
  }
469
470
  if (customOpts.showFooter) {
470
- log.warn('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter'])
471
+ warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter'])
471
472
  }
472
473
  if (customOpts.immediate) {
473
- log.warn('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate'])
474
+ warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate'])
474
475
  }
475
476
  if (customOpts.trigger) {
476
- log.warn('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger'])
477
+ warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger'])
477
478
  }
478
479
  }
479
480
  })
@@ -58,9 +58,12 @@ VxeUI.setConfig({
58
58
  // visibleMethod () {}
59
59
  // },
60
60
  customConfig: {
61
+ allowVisible: true,
62
+ allowResizable: true,
61
63
  allowFixed: true,
62
64
  allowSort: true,
63
- showFooter: true
65
+ showFooter: true,
66
+ placement: 'topRight'
64
67
  // storage: false,
65
68
  // checkMethod () {}
66
69
  },
@@ -0,0 +1,8 @@
1
+ import { VxeUI } from 'vxe-pc-ui'
2
+
3
+ const { log } = VxeUI
4
+
5
+ const version = `table v${process.env.VUE_APP_VXE_VERSION}`
6
+
7
+ export const warnLog = log.create('warn', version)
8
+ export const errLog = log.create('error', version)
@@ -51,34 +51,61 @@
51
51
 
52
52
  .vxe-table-custom-wrapper {
53
53
  display: none;
54
+ flex-direction: column;
54
55
  position: absolute;
55
- top: 1px;
56
- right: 2px;
57
56
  text-align: left;
58
57
  background-color: var(--vxe-ui-layout-background-color);
59
58
  z-index: 19;
60
59
  border: 1px solid var(--vxe-ui-table-border-color);
61
60
  border-radius: var(--vxe-ui-border-radius);
62
61
  box-shadow: var(--vxe-ui-base-popup-box-shadow);
62
+ &.placement--topLeft {
63
+ top: 2px;
64
+ left: 2px;
65
+ }
66
+ &.placement--topRight {
67
+ top: 2px;
68
+ right: 2px;
69
+ }
70
+ &.placement--bottomLeft {
71
+ bottom: 2px;
72
+ left: 2px;
73
+ }
74
+ &.placement--bottomRight {
75
+ bottom: 2px;
76
+ right: 2px;
77
+ }
78
+ &.placement--left {
79
+ left: 2px;
80
+ }
81
+ &.placement--right {
82
+ right: 2px;
83
+ }
84
+ &.placement--left,
85
+ &.placement--right {
86
+ top: 2px;
87
+ height: calc(100% - 4px);
88
+ }
63
89
  &.is--active {
64
- display: block;
90
+ display: flex;
65
91
  }
66
92
  }
67
93
 
68
94
  .vxe-table-custom--list-wrapper {
69
95
  display: block;
96
+ flex-grow: 1;
97
+ overflow-x: hidden;
98
+ overflow-y: auto;
70
99
  }
71
100
 
72
101
  .vxe-table-custom--header,
73
102
  .vxe-table-custom--body {
74
103
  list-style-type: none;
75
- overflow-x: hidden;
76
- overflow-y: auto;
77
104
  margin: 0;
78
105
  padding: 0;
79
106
  & > li {
80
107
  max-width: 26em;
81
- min-width: 18em;
108
+ min-width: 17em;
82
109
  padding: 0.2em 1em 0.2em 1em;
83
110
  @for $i from 2 through 8 {
84
111
  $interval: $i - 1 + 0.2;
@@ -93,6 +120,7 @@
93
120
  }
94
121
 
95
122
  .vxe-table-custom--header {
123
+ flex-shrink: 0;
96
124
  padding: 0.28em 0;
97
125
  font-weight: 700;
98
126
  border-bottom: 1px solid var(--vxe-ui-base-popup-border-color);
@@ -101,7 +129,6 @@
101
129
 
102
130
  .vxe-table-custom--body {
103
131
  padding: 0.2em 0;
104
- max-height: 20em;
105
132
  .vxe-table-custom--checkbox-option {
106
133
  &:hover {
107
134
  background-color: var(--vxe-ui-table-row-hover-background-color);
@@ -112,6 +139,7 @@
112
139
  .vxe-table-custom--footer {
113
140
  display: flex;
114
141
  flex-direction: row;
142
+ flex-shrink: 0;
115
143
  border-top: 1px solid var(--vxe-ui-base-popup-border-color);
116
144
  text-align: right;
117
145
  button {
@@ -274,9 +302,15 @@
274
302
  position: relative;
275
303
  &.col--sort,
276
304
  &.col--visible,
305
+ &.col--resizable,
277
306
  &.col--fixed {
278
307
  text-align: center;
279
308
  }
309
+ &.col--resizable {
310
+ & > .vxe-input {
311
+ width: 100%;
312
+ }
313
+ }
280
314
  }
281
315
 
282
316
  .vxe-table-custom-popup--row {
@@ -1043,6 +1043,7 @@
1043
1043
  }
1044
1044
  .vxe-body--expanded-column {
1045
1045
  border-bottom: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
1046
+ border-right: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
1046
1047
  &.col--ellipsis {
1047
1048
  & > .vxe-body--expanded-cell {
1048
1049
  overflow: hidden;