vxe-table 4.1.0 → 4.1.3

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 (72) hide show
  1. package/README.md +1 -0
  2. package/README.zh-TW.md +1 -0
  3. package/es/edit/src/hook.js +2 -2
  4. package/es/export/src/hook.js +24 -0
  5. package/es/export/src/util.js +20 -8
  6. package/es/footer/src/footer.js +4 -4
  7. package/es/form/src/form.js +13 -6
  8. package/es/form/src/render.js +4 -4
  9. package/es/grid/src/grid.js +48 -1
  10. package/es/header/src/header.js +7 -5
  11. package/es/select/src/select.js +5 -5
  12. package/es/table/src/body.js +18 -14
  13. package/es/table/src/cell.js +70 -54
  14. package/es/table/src/props.js +4 -1
  15. package/es/table/src/table.js +208 -97
  16. package/es/v-x-e-table/src/conf.js +2 -3
  17. package/es/validator/src/hook.js +12 -5
  18. package/helper/vetur/attributes.json +16 -8
  19. package/helper/vetur/tags.json +2 -0
  20. package/lib/edit/src/hook.js +2 -2
  21. package/lib/edit/src/hook.min.js +1 -1
  22. package/lib/export/src/hook.js +28 -0
  23. package/lib/export/src/hook.min.js +1 -1
  24. package/lib/export/src/util.js +21 -7
  25. package/lib/export/src/util.min.js +1 -1
  26. package/lib/footer/src/footer.js +4 -4
  27. package/lib/footer/src/footer.min.js +1 -1
  28. package/lib/form/src/form.js +23 -6
  29. package/lib/form/src/form.min.js +1 -1
  30. package/lib/form/src/render.js +4 -4
  31. package/lib/form/src/render.min.js +1 -1
  32. package/lib/grid/src/grid.js +56 -1
  33. package/lib/grid/src/grid.min.js +1 -1
  34. package/lib/header/src/header.js +7 -5
  35. package/lib/header/src/header.min.js +1 -1
  36. package/lib/index.umd.js +536 -220
  37. package/lib/index.umd.min.js +1 -1
  38. package/lib/select/src/select.js +5 -5
  39. package/lib/table/src/body.js +18 -14
  40. package/lib/table/src/body.min.js +1 -1
  41. package/lib/table/src/cell.js +92 -35
  42. package/lib/table/src/cell.min.js +1 -1
  43. package/lib/table/src/props.js +4 -1
  44. package/lib/table/src/props.min.js +1 -1
  45. package/lib/table/src/table.js +265 -133
  46. package/lib/table/src/table.min.js +1 -1
  47. package/lib/v-x-e-table/src/conf.js +2 -3
  48. package/lib/v-x-e-table/src/conf.min.js +1 -1
  49. package/lib/validator/src/hook.js +12 -5
  50. package/lib/validator/src/hook.min.js +1 -1
  51. package/package.json +2 -2
  52. package/packages/edit/src/hook.ts +2 -2
  53. package/packages/export/src/hook.ts +24 -0
  54. package/packages/export/src/util.ts +17 -5
  55. package/packages/footer/src/footer.ts +4 -4
  56. package/packages/form/src/form.ts +10 -6
  57. package/packages/form/src/render.ts +4 -4
  58. package/packages/grid/src/grid.ts +48 -1
  59. package/packages/header/src/header.ts +7 -5
  60. package/packages/select/src/select.ts +5 -5
  61. package/packages/table/src/body.ts +18 -14
  62. package/packages/table/src/cell.ts +77 -44
  63. package/packages/table/src/props.ts +4 -1
  64. package/packages/table/src/table.ts +211 -96
  65. package/packages/v-x-e-table/src/conf.ts +2 -3
  66. package/packages/validator/src/hook.ts +9 -5
  67. package/types/column.d.ts +5 -1
  68. package/types/form-item.d.ts +5 -1
  69. package/types/form.d.ts +5 -1
  70. package/types/modal.d.ts +4 -5
  71. package/types/table.d.ts +49 -14
  72. package/types/validator.d.ts +5 -1
package/types/table.d.ts CHANGED
@@ -55,6 +55,8 @@ export interface TablePrivateComputed {
55
55
  computeValidOpts: ComputedRef<VxeTablePropTypes.ValidOpts>;
56
56
  computeSXOpts: ComputedRef<VxeTablePropTypes.SXOpts>;
57
57
  computeSYOpts: ComputedRef<VxeTablePropTypes.SYOpts>;
58
+ computeColumnOpts: ComputedRef<VxeTablePropTypes.ColumnOpts>;
59
+ computeRowOpts: ComputedRef<VxeTablePropTypes.RowOpts>;
58
60
  computeResizableOpts: ComputedRef<VxeTablePropTypes.ResizableOpts>;
59
61
  computeSeqOpts: ComputedRef<VxeTablePropTypes.SeqOpts>;
60
62
  computeRadioOpts: ComputedRef<VxeTablePropTypes.RadioOpts>;
@@ -127,7 +129,7 @@ export interface TablePublicMethods {
127
129
  * @param row 行对象
128
130
  * @param children 子节点
129
131
  */
130
- loadChildren(row: any, children: any[]): Promise<any[]>;
132
+ loadTreeChildren(row: any, children: any[]): Promise<any[]>;
131
133
  /**
132
134
  * 加载列配置
133
135
  * @param columns 列对象
@@ -488,10 +490,14 @@ export interface TablePublicMethods {
488
490
  */
489
491
  clearRowExpandLoaded(row: any): Promise<any>;
490
492
  /**
491
- * 用于懒加载展开行,重新加载展开行的内容
492
- * @param rows 指定行
493
+ * 重新懒加载展开行,并展开内容
494
+ * @param row 指定行
493
495
  */
494
- reloadExpandContent(rows: any | any[]): Promise<any>;
496
+ reloadRowExpand(row: any): Promise<any>;
497
+ /**
498
+ * @deprecated 已废弃,请使用 reloadRowExpand
499
+ */
500
+ reloadExpandContent(row: any): Promise<any>;
495
501
  /**
496
502
  * 用于 type=expand,切换展开行的状态
497
503
  * @param row 指定行
@@ -540,10 +546,14 @@ export interface TablePublicMethods {
540
546
  */
541
547
  clearTreeExpandLoaded(row: any): Promise<any>;
542
548
  /**
543
- * 用于懒加载树表格,重新加载子节点
549
+ * 重新懒加载树节点,并展开该节点
544
550
  * @param rows 指定行
545
551
  */
546
- reloadTreeChilds(rows: any | any[]): Promise<any>;
552
+ reloadTreeExpand(row: any): Promise<any>;
553
+ /**
554
+ * @deprecated 已废弃,请使用 reloadTreeExpand
555
+ */
556
+ reloadTreeChilds(row: any): Promise<any>;
547
557
  /**
548
558
  * 用于 tree-config,切换展开树形节点的状态
549
559
  * @param row 指定行
@@ -660,7 +670,7 @@ export interface TablePrivateMethods {
660
670
  getExcludeHeight(): number;
661
671
  defineField(record: any): any;
662
672
  handleTableData(force?: boolean): Promise<any>;
663
- updateCache(isSource?: boolean): void;
673
+ cacheRowMap(isSource?: boolean): void;
664
674
  saveCustomResizable(isReset?: boolean): void;
665
675
  saveCustomVisible(): void;
666
676
  analyColumnWidth(): void;
@@ -946,6 +956,7 @@ export interface TableInternalData {
946
956
  afterFullData: any[];
947
957
  tableSynchData: any[];
948
958
  tableSourceData: any[];
959
+ treeFullData: any[];
949
960
  // 收集的列配置(带分组)
950
961
  collectColumn: VxeTableDefines.ColumnInfo[],
951
962
  // 完整所有列(不带分组)
@@ -962,6 +973,7 @@ export interface TableInternalData {
962
973
  _index: number;
963
974
  items: any[];
964
975
  parent: any;
976
+ level: number;
965
977
  treeLoaded?: boolean;
966
978
  expandLoaded?: boolean;
967
979
  formatData?: {
@@ -981,6 +993,7 @@ export interface TableInternalData {
981
993
  _index: number;
982
994
  items: any[];
983
995
  parent: any;
996
+ level: number;
984
997
  }
985
998
  };
986
999
  fullColumnIdData: {
@@ -1192,14 +1205,23 @@ export namespace VxeTablePropTypes {
1192
1205
  export type SyncResize = boolean | string | number;
1193
1206
 
1194
1207
  /**
1195
- * 列的默认配置
1208
+ * 列配置信息
1196
1209
  */
1197
1210
  export interface ColumnConfig {
1198
- width?: number;
1199
- minWidth?: number;
1211
+ resizable?: VxeColumnPropTypes.Resizable;
1212
+ width?: VxeColumnPropTypes.Width;
1213
+ minWidth?: VxeColumnPropTypes.MinWidth;
1200
1214
  }
1201
1215
  export interface ColumnOpts extends ColumnConfig { }
1202
1216
 
1217
+ /**
1218
+ * 行配置信息
1219
+ */
1220
+ export interface RowConfig {
1221
+ height?: number;
1222
+ }
1223
+ export interface RowOpts extends RowConfig { }
1224
+
1203
1225
  /**
1204
1226
  * 自定义列配置项
1205
1227
  */
@@ -1212,6 +1234,9 @@ export namespace VxeTablePropTypes {
1212
1234
  }
1213
1235
  export interface CustomOpts extends CustomConfig { }
1214
1236
 
1237
+ /**
1238
+ * 列调整配置项
1239
+ */
1215
1240
  export interface ResizableConfig {
1216
1241
  minWidth?: number | string | ((params: {
1217
1242
  $table: VxeTableConstructor & VxeTablePrivateMethods;
@@ -1296,6 +1321,9 @@ export namespace VxeTablePropTypes {
1296
1321
  checkMethod?(params: {
1297
1322
  row: any;
1298
1323
  }): boolean;
1324
+ visibleMethod?(params: {
1325
+ row: any;
1326
+ }): boolean;
1299
1327
  trigger?: 'default' | 'cell' | 'row';
1300
1328
  highlight?: boolean;
1301
1329
  strict?: boolean;
@@ -1318,6 +1346,9 @@ export namespace VxeTablePropTypes {
1318
1346
  checkMethod?(params: {
1319
1347
  row: any;
1320
1348
  }): boolean;
1349
+ visibleMethod?(params: {
1350
+ row: any;
1351
+ }): boolean;
1321
1352
  trigger?: 'default' | 'cell' | 'row';
1322
1353
  highlight?: boolean;
1323
1354
  range?: boolean;
@@ -1390,8 +1421,8 @@ export namespace VxeTablePropTypes {
1390
1421
  */
1391
1422
  export interface TreeConfig {
1392
1423
  transform?: boolean;
1393
- rowtKey?: string;
1394
- parentKey?: string;
1424
+ rowField?: string;
1425
+ parentField?: string;
1395
1426
  children?: string;
1396
1427
  indent?: number;
1397
1428
  line?: boolean;
@@ -1420,8 +1451,8 @@ export namespace VxeTablePropTypes {
1420
1451
  iconLoaded?: string;
1421
1452
  }
1422
1453
  export interface TreeOpts extends TreeConfig {
1423
- rowtKey: string;
1424
- parentKey: string;
1454
+ rowField: string;
1455
+ parentField: string;
1425
1456
  children: string;
1426
1457
  indent: number;
1427
1458
  hasChild: string;
@@ -1852,6 +1883,9 @@ export namespace VxeTablePropTypes {
1852
1883
  gt?: number;
1853
1884
  oSize?: number;
1854
1885
  enabled?: boolean;
1886
+ /**
1887
+ * @deprecated 请使用 row-config.height
1888
+ */
1855
1889
  rHeight?: number;
1856
1890
  adaptive?: boolean;
1857
1891
  }
@@ -1911,6 +1945,7 @@ export type VxeTableProps<D = any> = {
1911
1945
  autoResize?: VxeTablePropTypes.AutoResize;
1912
1946
  syncResize?: VxeTablePropTypes.SyncResize;
1913
1947
  columnConfig?: VxeTablePropTypes.ColumnConfig;
1948
+ rowConfig?: VxeTablePropTypes.RowConfig;
1914
1949
  customConfig?: VxeTablePropTypes.CustomConfig;
1915
1950
  resizableConfig?: VxeTablePropTypes.ResizableConfig;
1916
1951
  seqConfig?: VxeTablePropTypes.SeqConfig;
@@ -70,9 +70,13 @@ declare module './table' {
70
70
  /**
71
71
  * 提示消息
72
72
  */
73
- message?: string;
73
+ content?: string;
74
74
  trigger?: 'blur' | 'change' | 'manual';
75
75
  maxWidth?: number;
76
+ /**
77
+ * @deprecated 已废弃,请使用 content
78
+ */
79
+ message?: string;
76
80
  }
77
81
  export interface ValidatorErrorParams {
78
82
  $table: VxeTableConstructor;