vxe-table 4.2.0-beta.4 → 4.2.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon--",GlobalConfig={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,radioConfig:{strict:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,message:"default"},sortConfig:{showIcon:!0},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",children:"children",hasChild:"hasChild",mapChildren:"_X_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0},importConfig:{modes:["insert","covering"]},exportConfig:{modes:["current","selected"]},printConfig:{modes:["current","selected"]},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{selectCellByHeader:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{enabled:!0,gt:60},scrollY:{enabled:!0,gt:100}},export:{types:{}},icon:{TABLE_SORT_ASC:iconPrefix+"caret-top",TABLE_SORT_DESC:iconPrefix+"caret-bottom",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit-outline",TABLE_HELP:iconPrefix+"question",TABLE_TREE_LOADED:iconPrefix+"refresh roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"refresh roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",BUTTON_DROPDOWN:iconPrefix+"arrow-bottom",BUTTON_LOADING:iconPrefix+"refresh roll",SELECT_LOADED:iconPrefix+"refresh roll",SELECT_OPEN:iconPrefix+"caret-bottom rotate180",SELECT_CLOSE:iconPrefix+"caret-bottom",PAGER_JUMP_PREV:iconPrefix+"d-arrow-left",PAGER_JUMP_NEXT:iconPrefix+"d-arrow-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"more",INPUT_CLEAR:iconPrefix+"close",INPUT_PWD:iconPrefix+"eye-slash",INPUT_SHOW_PWD:iconPrefix+"eye",INPUT_PREV_NUM:iconPrefix+"caret-top",INPUT_NEXT_NUM:iconPrefix+"caret-bottom",INPUT_DATE:iconPrefix+"calendar",INPUT_SEARCH:iconPrefix+"search",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"zoomout",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info",MODAL_SUCCESS:iconPrefix+"success",MODAL_WARNING:iconPrefix+"warning",MODAL_ERROR:iconPrefix+"error",MODAL_QUESTION:iconPrefix+"question",MODAL_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_REFRESH:iconPrefix+"refresh",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_ZOOM_IN:iconPrefix+"zoomin",TOOLBAR_TOOLS_ZOOM_OUT:iconPrefix+"zoomout",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"menu",FORM_PREFIX:iconPrefix+"question",FORM_SUFFIX:iconPrefix+"question",FORM_FOLDING:iconPrefix+"arrow-top rotate180",FORM_UNFOLDING:iconPrefix+"arrow-top"},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,message:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300},pager:{},form:{validConfig:{showMessage:!0,autoPos:!0},tooltipConfig:{enterable:!0},titleAsterisk:!0},input:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},textarea:{},select:{multiCharOverflow:8},toolbar:{},button:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},checkbox:{},switch:{},modal:{top:15,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,draggable:!0,storageKey:"VXE_MODAL_POSITION"},list:{scrollY:{enabled:!0,gt:100}},i18n:function(e){return e}},_default=GlobalConfig;exports.default=_default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon--",GlobalConfig={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,radioConfig:{strict:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,message:"default"},sortConfig:{showIcon:!0},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",children:"children",hasChild:"hasChild",mapChildren:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0},importConfig:{modes:["insert","covering"]},exportConfig:{modes:["current","selected"]},printConfig:{modes:["current","selected"]},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{selectCellByHeader:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{enabled:!0,gt:60},scrollY:{enabled:!0,gt:100}},export:{types:{}},icon:{TABLE_SORT_ASC:iconPrefix+"caret-top",TABLE_SORT_DESC:iconPrefix+"caret-bottom",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit-outline",TABLE_HELP:iconPrefix+"question",TABLE_TREE_LOADED:iconPrefix+"refresh roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"refresh roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",BUTTON_DROPDOWN:iconPrefix+"arrow-bottom",BUTTON_LOADING:iconPrefix+"refresh roll",SELECT_LOADED:iconPrefix+"refresh roll",SELECT_OPEN:iconPrefix+"caret-bottom rotate180",SELECT_CLOSE:iconPrefix+"caret-bottom",PAGER_JUMP_PREV:iconPrefix+"d-arrow-left",PAGER_JUMP_NEXT:iconPrefix+"d-arrow-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"more",INPUT_CLEAR:iconPrefix+"close",INPUT_PWD:iconPrefix+"eye-slash",INPUT_SHOW_PWD:iconPrefix+"eye",INPUT_PREV_NUM:iconPrefix+"caret-top",INPUT_NEXT_NUM:iconPrefix+"caret-bottom",INPUT_DATE:iconPrefix+"calendar",INPUT_SEARCH:iconPrefix+"search",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"zoomout",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info",MODAL_SUCCESS:iconPrefix+"success",MODAL_WARNING:iconPrefix+"warning",MODAL_ERROR:iconPrefix+"error",MODAL_QUESTION:iconPrefix+"question",MODAL_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_REFRESH:iconPrefix+"refresh",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_ZOOM_IN:iconPrefix+"zoomin",TOOLBAR_TOOLS_ZOOM_OUT:iconPrefix+"zoomout",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"menu",FORM_PREFIX:iconPrefix+"question",FORM_SUFFIX:iconPrefix+"question",FORM_FOLDING:iconPrefix+"arrow-top rotate180",FORM_UNFOLDING:iconPrefix+"arrow-top"},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,message:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300},pager:{},form:{validConfig:{showMessage:!0,autoPos:!0},tooltipConfig:{enterable:!0},titleAsterisk:!0},input:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},textarea:{},select:{multiCharOverflow:8},toolbar:{},button:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},checkbox:{},switch:{},modal:{top:15,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,draggable:!0,storageKey:"VXE_MODAL_POSITION"},list:{scrollY:{enabled:!0,gt:100}},i18n:function(e){return e}},_default=GlobalConfig;exports.default=_default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "4.2.0-beta.4",
3
+ "version": "4.2.0",
4
4
  "description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、贼灵活的配置项、扩展接口等...",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,4 +1,4 @@
1
- import { defineComponent, h, onUnmounted, inject, ref, Ref, onMounted, PropType, reactive } from 'vue'
1
+ import { defineComponent, h, onUnmounted, inject, ref, Ref, onMounted, PropType } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import GlobalConfig from '../../v-x-e-table/src/conf'
4
4
  import { VXETable } from '../../v-x-e-table'
@@ -34,7 +34,7 @@ export default defineComponent({
34
34
  const refElem = ref() as Ref<HTMLDivElement>
35
35
  const $xeform = inject('$xeform', {} as VxeFormConstructor & VxeFormPrivateMethods)
36
36
  const formGather = inject('xeformgather', null as XEFormItemProvide | null)
37
- const formItem = reactive(createItem($xeform, props))
37
+ const formItem = createItem($xeform, props)
38
38
  formItem.slots = slots
39
39
 
40
40
  watchItem(props, formItem)
@@ -672,6 +672,7 @@ export default defineComponent({
672
672
  const renderVN = () => {
673
673
  const { loading, className, data, titleColon, titleAsterisk, customLayout } = props
674
674
  const { formItems } = reactData
675
+ // const formItems: any[] = []
675
676
  const vSize = computeSize.value
676
677
  const tooltipOpts = computeTooltipOpts.value
677
678
  const defaultSlot = slots.default
@@ -5376,12 +5376,18 @@ export default defineComponent({
5376
5376
  nextTick(updateStyle)
5377
5377
  },
5378
5378
  updateScrollXData () {
5379
- handleTableColumn()
5380
- tablePrivateMethods.updateScrollXSpace()
5379
+ reactData.tableColumn = []
5380
+ nextTick(() => {
5381
+ handleTableColumn()
5382
+ tablePrivateMethods.updateScrollXSpace()
5383
+ })
5381
5384
  },
5382
5385
  updateScrollYData () {
5383
- tablePrivateMethods.handleTableData()
5384
- tablePrivateMethods.updateScrollYSpace()
5386
+ reactData.tableData = []
5387
+ nextTick(() => {
5388
+ tablePrivateMethods.handleTableData()
5389
+ tablePrivateMethods.updateScrollYSpace()
5390
+ })
5385
5391
  },
5386
5392
  /**
5387
5393
  * 处理固定列的显示状态
@@ -5713,13 +5719,13 @@ export default defineComponent({
5713
5719
 
5714
5720
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
5715
5721
  // if (props.rowId) {
5716
- // warnLog('vxe.error.delProp', ['rowId', 'row-config.keyField'])
5722
+ // warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField'])
5717
5723
  // }
5718
5724
  // if (props.rowKey) {
5719
- // warnLog('vxe.error.delProp', ['rowId', 'row-config.useKey'])
5725
+ // warnLog('vxe.error.delProp', ['row-id', 'row-config.useKey'])
5720
5726
  // }
5721
5727
  // if (props.columnKey) {
5722
- // warnLog('vxe.error.delProp', ['rowId', 'column-config.useKey'])
5728
+ // warnLog('vxe.error.delProp', ['row-id', 'column-config.useKey'])
5723
5729
  // }
5724
5730
  if (!(props.rowId || rowOpts.keyField) && (checkboxOpts.reserve || checkboxOpts.checkRowKeys || radioOpts.reserve || radioOpts.checkRowKey || expandOpts.expandRowKeys || treeOpts.expandRowKeys)) {
5725
5731
  warnLog('vxe.error.reqProp', ['row-config.keyField'])
@@ -5736,6 +5742,18 @@ export default defineComponent({
5736
5742
  if (props.showFooter && !props.footerMethod) {
5737
5743
  warnLog('vxe.error.reqProp', ['footer-method'])
5738
5744
  }
5745
+ // if (props.highlightCurrentRow) {
5746
+ // warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent'])
5747
+ // }
5748
+ // if (props.highlightHoverRow) {
5749
+ // warnLog('vxe.error.delProp', ['highlight-hover-row', 'row-config.isHover'])
5750
+ // }
5751
+ // if (props.highlightCurrentColumn) {
5752
+ // warnLog('vxe.error.delProp', ['highlight-current-column', 'column-config.isCurrent'])
5753
+ // }
5754
+ // if (props.highlightHoverColumn) {
5755
+ // warnLog('vxe.error.delProp', ['highlight-hover-column', 'column-config.isHover'])
5756
+ // }
5739
5757
  // 检查导入导出类型,如果自定义导入导出方法,则不校验类型
5740
5758
  const { exportConfig, importConfig } = props
5741
5759
  const exportOpts = computeExportOpts.value
@@ -70,7 +70,7 @@ const GlobalConfig: VXETableGlobalConfig = {
70
70
  parentField: 'parentId',
71
71
  children: 'children',
72
72
  hasChild: 'hasChild',
73
- mapChildren: '_X_CHILD',
73
+ mapChildren: '_X_ROW_CHILD',
74
74
  indent: 20,
75
75
  showIcon: true
76
76
  },
package/types/table.d.ts CHANGED
@@ -400,7 +400,7 @@ export interface TablePublicMethods {
400
400
  */
401
401
  clearCheckboxRow(): Promise<any>
402
402
  /**
403
- * 用于 highlight-current-row,设置某一行为高亮状态
403
+ * 用于 row-config.isCurrent,设置某一行为高亮状态
404
404
  * @param row 指定行
405
405
  */
406
406
  setCurrentRow(row: any): Promise<any>
@@ -423,7 +423,7 @@ export interface TablePublicMethods {
423
423
  */
424
424
  clearMergeFooterItems(): Promise<any>
425
425
  /**
426
- * 用于 highlight-current-row,手动清空当前高亮的状态
426
+ * 用于 row-config.isCurrent,手动清空当前高亮的状态
427
427
  */
428
428
  clearCurrentRow(): Promise<any>
429
429
  /**
@@ -439,11 +439,11 @@ export interface TablePublicMethods {
439
439
  */
440
440
  getMergeFooterItems(): VxeTableDefines.MergeInfo[]
441
441
  /**
442
- * 用于 highlight-current-column,获取当前列
442
+ * 用于 column-config.isCurrent,获取当前列
443
443
  */
444
444
  getCurrentColumn(): VxeTableDefines.ColumnInfo | null
445
445
  /**
446
- * 用于 highlight-current-row,获取当前行的行数据
446
+ * 用于 row-config.isCurrent,获取当前行的行数据
447
447
  */
448
448
  getCurrentRecord(): any
449
449
  /**
@@ -451,12 +451,12 @@ export interface TablePublicMethods {
451
451
  */
452
452
  getRadioRecord(isFull?: boolean): any
453
453
  /**
454
- * 用于 highlight-current-column,设置某列行为高亮状态
454
+ * 用于 column-config.isCurrent,设置某列行为高亮状态
455
455
  * @param columnOrField 列对象或字段名
456
456
  */
457
457
  setCurrentColumn(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo): Promise<any>
458
458
  /**
459
- * 用于 highlight-current-column,手动清空当前高亮的状态
459
+ * 用于 column-config.isCurrent,手动清空当前高亮的状态
460
460
  */
461
461
  clearCurrentColumn(): Promise<any>
462
462
  /**