vxe-table 4.7.81 → 4.7.83

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 (57) hide show
  1. package/es/grid/src/grid.js +15 -15
  2. package/es/style.css +1 -1
  3. package/es/style.min.css +1 -1
  4. package/es/table/module/edit/hook.js +25 -16
  5. package/es/table/render/index.js +9 -3
  6. package/es/table/src/body.js +1 -0
  7. package/es/table/src/props.js +5 -0
  8. package/es/table/src/table.js +1 -0
  9. package/es/table/style.css +35 -21
  10. package/es/table/style.min.css +1 -1
  11. package/es/toolbar/src/toolbar.js +11 -2
  12. package/es/ui/index.js +5 -3
  13. package/es/ui/src/log.js +1 -1
  14. package/es/vxe-table/style.css +35 -21
  15. package/es/vxe-table/style.min.css +1 -1
  16. package/lib/grid/src/grid.js +15 -15
  17. package/lib/grid/src/grid.min.js +1 -1
  18. package/lib/index.umd.js +75 -38
  19. package/lib/index.umd.min.js +1 -1
  20. package/lib/style.css +1 -1
  21. package/lib/style.min.css +1 -1
  22. package/lib/table/module/edit/hook.js +24 -15
  23. package/lib/table/module/edit/hook.min.js +1 -1
  24. package/lib/table/render/index.js +12 -2
  25. package/lib/table/render/index.min.js +1 -1
  26. package/lib/table/src/body.js +1 -0
  27. package/lib/table/src/body.min.js +1 -1
  28. package/lib/table/src/props.js +5 -0
  29. package/lib/table/src/props.min.js +1 -1
  30. package/lib/table/src/table.js +1 -0
  31. package/lib/table/src/table.min.js +1 -1
  32. package/lib/table/style/style.css +35 -21
  33. package/lib/table/style/style.min.css +1 -1
  34. package/lib/toolbar/src/toolbar.js +11 -2
  35. package/lib/toolbar/src/toolbar.min.js +1 -1
  36. package/lib/ui/index.js +5 -3
  37. package/lib/ui/index.min.js +1 -1
  38. package/lib/ui/src/log.js +1 -1
  39. package/lib/ui/src/log.min.js +1 -1
  40. package/lib/vxe-table/style/style.css +35 -21
  41. package/lib/vxe-table/style/style.min.css +1 -1
  42. package/package.json +2 -2
  43. package/packages/grid/src/grid.ts +16 -17
  44. package/packages/table/module/edit/hook.ts +24 -15
  45. package/packages/table/render/index.ts +9 -3
  46. package/packages/table/src/body.ts +1 -0
  47. package/packages/table/src/props.ts +5 -0
  48. package/packages/table/src/table.ts +1 -0
  49. package/packages/toolbar/src/toolbar.ts +11 -2
  50. package/packages/ui/index.ts +3 -1
  51. package/styles/components/table.scss +76 -15
  52. /package/es/{iconfont.1727054403308.ttf → iconfont.1727355554097.ttf} +0 -0
  53. /package/es/{iconfont.1727054403308.woff → iconfont.1727355554097.woff} +0 -0
  54. /package/es/{iconfont.1727054403308.woff2 → iconfont.1727355554097.woff2} +0 -0
  55. /package/lib/{iconfont.1727054403308.ttf → iconfont.1727355554097.ttf} +0 -0
  56. /package/lib/{iconfont.1727054403308.woff → iconfont.1727355554097.woff} +0 -0
  57. /package/lib/{iconfont.1727054403308.woff2 → iconfont.1727355554097.woff2} +0 -0
@@ -1257,6 +1257,21 @@ export default defineComponent({
1257
1257
  initPages()
1258
1258
 
1259
1259
  onMounted(() => {
1260
+ if (process.env.VUE_APP_VXE_ENV === 'development') {
1261
+ nextTick(() => {
1262
+ if (props.formConfig) {
1263
+ if (!VxeUIFormComponent) {
1264
+ errLog('vxe.error.reqComp', ['vxe-form'])
1265
+ }
1266
+ }
1267
+ if (props.pagerConfig) {
1268
+ if (!VxeUIPagerComponent) {
1269
+ errLog('vxe.error.reqComp', ['vxe-pager'])
1270
+ }
1271
+ }
1272
+ })
1273
+ }
1274
+
1260
1275
  nextTick(() => {
1261
1276
  const { columns } = props
1262
1277
  // const { data, columns, proxyConfig } = props
@@ -1276,6 +1291,7 @@ export default defineComponent({
1276
1291
  $xeGrid.loadColumn(columns)
1277
1292
  }
1278
1293
  initToolbar()
1294
+ initProxy()
1279
1295
  })
1280
1296
  globalEvents.on($xeGrid, 'keydown', handleGlobalKeydownEvent)
1281
1297
  })
@@ -1284,23 +1300,6 @@ export default defineComponent({
1284
1300
  globalEvents.off($xeGrid, 'keydown')
1285
1301
  })
1286
1302
 
1287
- nextTick(() => {
1288
- if (process.env.VUE_APP_VXE_ENV === 'development') {
1289
- if (props.formConfig) {
1290
- if (!VxeUIFormComponent) {
1291
- errLog('vxe.error.reqComp', ['vxe-form'])
1292
- }
1293
- }
1294
- if (props.pagerConfig) {
1295
- if (!VxeUIPagerComponent) {
1296
- errLog('vxe.error.reqComp', ['vxe-pager'])
1297
- }
1298
- }
1299
- }
1300
-
1301
- initProxy()
1302
- })
1303
-
1304
1303
  const renderVN = () => {
1305
1304
  const vSize = computeSize.value
1306
1305
  const styles = computeStyles.value
@@ -768,24 +768,28 @@ hooks.add('tableEditModule', {
768
768
  handleFocus (params) {
769
769
  const { row, column, cell } = params
770
770
  const { editRender } = column
771
+ const editOpts = computeEditOpts.value
771
772
  if (isEnableConf(editRender)) {
772
773
  const compRender = renderer.get(editRender.name)
773
774
  let autoFocus = editRender.autofocus || editRender.autoFocus
774
775
  let autoSelect = editRender.autoSelect || editRender.autoselect
775
776
  let inputElem
776
- if (!autoFocus && compRender) {
777
- autoFocus = compRender.tableAutoFocus || compRender.tableAutofocus || compRender.autofocus
778
- }
779
- if (!autoSelect && compRender) {
780
- autoSelect = compRender.tableAutoSelect || compRender.autoselect
781
- }
782
- // 如果指定了聚焦 class
783
- if (XEUtils.isFunction(autoFocus)) {
784
- inputElem = autoFocus(params)
785
- } else if (autoFocus) {
786
- inputElem = cell.querySelector(autoFocus)
787
- if (inputElem) {
788
- inputElem.focus()
777
+ // 是否启用聚焦
778
+ if (editOpts.autoFocus) {
779
+ if (!autoFocus && compRender) {
780
+ autoFocus = compRender.tableAutoFocus || compRender.tableAutofocus || compRender.autofocus
781
+ }
782
+ if (!autoSelect && compRender) {
783
+ autoSelect = compRender.tableAutoSelect || compRender.autoselect
784
+ }
785
+ // 如果指定了聚焦 class
786
+ if (XEUtils.isFunction(autoFocus)) {
787
+ inputElem = autoFocus(params)
788
+ } else if (autoFocus) {
789
+ inputElem = cell.querySelector(autoFocus)
790
+ if (inputElem) {
791
+ inputElem.focus()
792
+ }
789
793
  }
790
794
  }
791
795
  if (inputElem) {
@@ -800,8 +804,13 @@ hooks.add('tableEditModule', {
800
804
  }
801
805
  }
802
806
  } else {
803
- // 显示到可视区中
804
- $xeTable.scrollToRow(row, column)
807
+ // 是否自动定位
808
+ if (editOpts.autoPos) {
809
+ if (!column.fixed) {
810
+ // 显示到可视区中
811
+ $xeTable.scrollToRow(row, column)
812
+ }
813
+ }
805
814
  }
806
815
  }
807
816
  },
@@ -89,10 +89,10 @@ function isImmediateCell (renderOpts: VxeColumnPropTypes.EditRender, params: any
89
89
  }
90
90
 
91
91
  function getCellLabelVNs (renderOpts: any, params: any, cellLabel: any) {
92
- const { placeholder } = renderOpts
92
+ const { name, placeholder } = renderOpts
93
93
  return [
94
94
  h('span', {
95
- class: 'vxe-cell--label'
95
+ class: ['vxe-cell--label', ['VxeTextarea', 'textarea'].includes(name) ? 'is--textarea' : '']
96
96
  }, placeholder && isEmptyValue(cellLabel)
97
97
  ? [
98
98
  h('span', {
@@ -638,7 +638,13 @@ renderer.mixin({
638
638
  tableFilterDefaultMethod: handleFilterMethod
639
639
  },
640
640
  VxeTextarea: {
641
- tableAutoFocus: 'VxeTextarea'
641
+ tableAutoFocus: 'textarea',
642
+ renderTableEdit: defaultEditRender,
643
+ renderTableCell (renderOpts, params) {
644
+ const { row, column } = params
645
+ const cellValue = XEUtils.get(row, column.field)
646
+ return getCellLabelVNs(renderOpts, params, cellValue)
647
+ }
642
648
  },
643
649
  VxeButton: {
644
650
  renderTableDefault: buttonCellRender
@@ -334,6 +334,7 @@ export default defineComponent({
334
334
  'col--tree-node': treeNode,
335
335
  'col--edit': isEdit,
336
336
  'col--ellipsis': hasEllipsis,
337
+ 'col--height': !!rowOpts.height,
337
338
  'fixed--hidden': fixedHiddenColumn,
338
339
  'col--dirty': isDirty,
339
340
  'col--active': editConfig && isEdit && (actived.row === row && (actived.column === column || editOpts.mode === 'row')),
@@ -34,6 +34,11 @@ export default {
34
34
  type: [Boolean, String] as PropType<VxeTablePropTypes.Border>,
35
35
  default: () => getConfig().table.border
36
36
  },
37
+ // 单元格是否有边距
38
+ padding: {
39
+ type: Boolean as PropType<VxeTablePropTypes.Padding>,
40
+ default: () => getConfig().table.padding
41
+ },
37
42
  // 是否圆角边框
38
43
  round: {
39
44
  type: Boolean as PropType<VxeTablePropTypes.Round>,
@@ -7045,6 +7045,7 @@ export default defineComponent({
7045
7045
  'is--fixed-left': leftList.length,
7046
7046
  'is--fixed-right': rightList.length,
7047
7047
  'is--animat': !!props.animat,
7048
+ 'is--padding': props.padding,
7048
7049
  'is--round': props.round,
7049
7050
  'is--stripe': !treeConfig && stripe,
7050
7051
  'is--loading': currLoading,
@@ -310,8 +310,11 @@ export default defineComponent({
310
310
  round: child.round,
311
311
  status: child.status,
312
312
  content: child.name,
313
- routerLink: item.routerLink,
314
- permissionCode: item.permissionCode,
313
+ title: child.title,
314
+ routerLink: child.routerLink,
315
+ permissionCode: child.permissionCode,
316
+ prefixTooltip: child.prefixTooltip,
317
+ suffixTooltip: child.suffixTooltip,
315
318
  onClick: ({ $event }) => isBtn ? btnEvent($event, child) : tolEvent($event, child)
316
319
  })
317
320
  : createCommentVNode()
@@ -354,8 +357,11 @@ export default defineComponent({
354
357
  round: item.round,
355
358
  status: item.status,
356
359
  content: item.name,
360
+ title: item.title,
357
361
  routerLink: item.routerLink,
358
362
  permissionCode: item.permissionCode,
363
+ prefixTooltip: item.prefixTooltip,
364
+ suffixTooltip: item.suffixTooltip,
359
365
  destroyOnClose: item.destroyOnClose,
360
366
  placement: item.placement,
361
367
  transfer: item.transfer,
@@ -411,8 +417,11 @@ export default defineComponent({
411
417
  round: item.round,
412
418
  status: item.status,
413
419
  content: item.name,
420
+ title: item.title,
414
421
  routerLink: item.routerLink,
415
422
  permissionCode: item.permissionCode,
423
+ prefixTooltip: item.prefixTooltip,
424
+ suffixTooltip: item.suffixTooltip,
416
425
  destroyOnClose: item.destroyOnClose,
417
426
  placement: item.placement,
418
427
  transfer: item.transfer,
@@ -17,6 +17,7 @@ VxeUI.setConfig({
17
17
  animat: true,
18
18
  delayHover: 250,
19
19
  autoResize: true,
20
+ padding: true,
20
21
  minHeight: 144,
21
22
  // keepSource: false,
22
23
  // showOverflow: null,
@@ -108,7 +109,8 @@ VxeUI.setConfig({
108
109
  editConfig: {
109
110
  // mode: 'cell',
110
111
  showIcon: true,
111
- showAsterisk: true
112
+ showAsterisk: true,
113
+ autoFocus: true
112
114
  },
113
115
  importConfig: {
114
116
  _typeMaps: {
@@ -130,6 +130,22 @@
130
130
  }
131
131
  }
132
132
  }
133
+ .vxe-body--column {
134
+ &.col--height {
135
+ & > .vxe-cell {
136
+ height: 100%;
137
+ & > .vxe-textarea,
138
+ & > .vxe-default-textarea {
139
+ height: 100%;
140
+ }
141
+ }
142
+ }
143
+ .vxe-cell--label {
144
+ &.is--textarea {
145
+ white-space: pre-line;
146
+ }
147
+ }
148
+ }
133
149
 
134
150
  .vxe-table--checkbox-range,
135
151
  .vxe-table--cell-main-area,
@@ -512,12 +528,12 @@
512
528
  font-family: var(--vxe-ui-font-family);
513
529
  direction: ltr;
514
530
  .vxe-table--body-wrapper {
515
- table {
531
+ & > table {
516
532
  background-color: var(--vxe-ui-layout-background-color);
517
533
  }
518
534
  }
519
535
  .vxe-table--footer-wrapper {
520
- table {
536
+ & > table {
521
537
  background-color: var(--vxe-ui-table-footer-background-color);
522
538
  }
523
539
  }
@@ -678,15 +694,25 @@
678
694
  }
679
695
  }
680
696
  }
697
+ &.is--padding {
698
+ .vxe-body--column {
699
+ &:not(.col--ellipsis) {
700
+ padding: var(--vxe-ui-table-column-padding-default);
701
+ }
702
+ }
703
+ }
704
+ .vxe-header--column,
705
+ .vxe-footer--column {
706
+ &:not(.col--ellipsis) {
707
+ padding: var(--vxe-ui-table-column-padding-default);
708
+ }
709
+ }
681
710
  .vxe-header--column,
682
711
  .vxe-body--column,
683
712
  .vxe-footer--column {
684
713
  position: relative;
685
714
  line-height: var(--vxe-ui-table-row-line-height);
686
715
  text-align: left;
687
- &:not(.col--ellipsis) {
688
- padding: var(--vxe-ui-table-column-padding-default);
689
- }
690
716
  &.col--current {
691
717
  background-color: var(--vxe-ui-table-column-current-background-color);
692
718
  // .vxe-tree--btn-wrapper {
@@ -731,6 +757,27 @@
731
757
  .vxe-table--footer-wrapper {
732
758
  border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
733
759
  }
760
+ // &.border--default,
761
+ // &.border--full,
762
+ // &.border--inner,
763
+ // &.border--outer {
764
+ // .vxe-body--row {
765
+ // &:last-child {
766
+ // & > .vxe-body--column {
767
+ // & > .vxe-cell {
768
+ // border-bottom: 1px solid transparent;
769
+ // }
770
+ // }
771
+ // }
772
+ // }
773
+ // .vxe-body--column {
774
+ // &:first-child {
775
+ // & > .vxe-cell {
776
+ // border-left: 1px solid transparent;
777
+ // }
778
+ // }
779
+ // }
780
+ // }
734
781
  &.border--default,
735
782
  &.border--full,
736
783
  &.border--outer {
@@ -883,11 +930,16 @@
883
930
  }
884
931
  }
885
932
  }
933
+
934
+ &.is--padding {
935
+ .vxe-cell {
936
+ padding-left: var(--vxe-ui-table-cell-padding-left);
937
+ padding-right: var(--vxe-ui-table-cell-padding-right);
938
+ }
939
+ }
886
940
  .vxe-cell {
887
941
  white-space: pre-line;
888
942
  word-break: break-all;
889
- padding-left: var(--vxe-ui-table-cell-padding-left);
890
- padding-right: var(--vxe-ui-table-cell-padding-right);
891
943
  }
892
944
 
893
945
  // 单元格占位符
@@ -1146,6 +1198,7 @@
1146
1198
  }
1147
1199
  }
1148
1200
 
1201
+
1149
1202
  /*溢出列*/
1150
1203
  .vxe-header--column,
1151
1204
  .vxe-body--column,
@@ -1159,8 +1212,10 @@
1159
1212
  white-space: nowrap;
1160
1213
  }
1161
1214
  }
1162
- & > .vxe-cell {
1163
- max-height: var(--vxe-ui-table-row-height-default);
1215
+ &:not(.col--height) {
1216
+ & > .vxe-cell {
1217
+ max-height: var(--vxe-ui-table-row-height-default);
1218
+ }
1164
1219
  }
1165
1220
  }
1166
1221
  }
@@ -1170,8 +1225,10 @@
1170
1225
  .vxe-footer--column {
1171
1226
  &.col--ellipsis {
1172
1227
  @extend %MediumColumnHeight;
1173
- & > .vxe-cell {
1174
- max-height: var(--vxe-ui-table-row-height-medium);
1228
+ &:not(.col--height) {
1229
+ & > .vxe-cell {
1230
+ max-height: var(--vxe-ui-table-row-height-medium);
1231
+ }
1175
1232
  }
1176
1233
  }
1177
1234
  }
@@ -1188,8 +1245,10 @@
1188
1245
  .vxe-footer--column {
1189
1246
  &.col--ellipsis {
1190
1247
  @extend %SmallColumnHeight;
1191
- & > .vxe-cell {
1192
- max-height: var(--vxe-ui-table-row-height-small);
1248
+ &:not(.col--height) {
1249
+ & > .vxe-cell {
1250
+ max-height: var(--vxe-ui-table-row-height-small);
1251
+ }
1193
1252
  }
1194
1253
  }
1195
1254
  }
@@ -1206,8 +1265,10 @@
1206
1265
  .vxe-footer--column {
1207
1266
  &.col--ellipsis {
1208
1267
  @extend %MiniColumnHeight;
1209
- & > .vxe-cell {
1210
- max-height: var(--vxe-ui-table-row-height-mini);
1268
+ &:not(.col--height) {
1269
+ & > .vxe-cell {
1270
+ max-height: var(--vxe-ui-table-row-height-mini);
1271
+ }
1211
1272
  }
1212
1273
  }
1213
1274
  }