linkmore-design 1.1.26 → 1.1.27-alpha.1

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 (117) hide show
  1. package/dist/LmEditTable/DndContainer.d.ts +6 -3
  2. package/dist/LmEditTable/EditTable.d.ts +10 -5
  3. package/dist/LmEditTable/components/DraggableContainer.d.ts +10 -0
  4. package/dist/LmEditTable/components/QuickOpetate.d.ts +12 -0
  5. package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
  6. package/dist/LmEditTable/components/customRenderEmpty.d.ts +2 -0
  7. package/dist/LmEditTable/components/index.d.ts +17 -0
  8. package/dist/LmEditTable/hooks/useForkRef.d.ts +2 -0
  9. package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
  10. package/dist/LmEditTable/sortableItem.d.ts +3 -2
  11. package/dist/LmEditTable/util.d.ts +8 -0
  12. package/dist/LmEditTable/virtual/VirtualRow.d.ts +7 -0
  13. package/dist/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
  14. package/dist/LmEditTable/virtual/VirtualTable.d.ts +3 -0
  15. package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
  16. package/dist/LmEditTable/virtual/context.d.ts +13 -0
  17. package/dist/LmEditTable/virtual/index.d.ts +4 -0
  18. package/dist/LmTable/virTual/VirtualRow.d.ts +1 -1
  19. package/dist/index.d.ts +1 -2
  20. package/dist/index.umd.js +1380 -576
  21. package/dist/index.umd.min.js +21 -21
  22. package/dist/variables.css +92 -0
  23. package/es/InputNumber/index.js +7 -9
  24. package/es/LmEditTable/DndContainer.d.ts +6 -3
  25. package/es/LmEditTable/DndContainer.js +70 -10
  26. package/es/LmEditTable/DragHandle.js +1 -1
  27. package/es/LmEditTable/EditTable.d.ts +10 -5
  28. package/es/LmEditTable/EditTable.js +364 -360
  29. package/es/LmEditTable/components/DraggableContainer.d.ts +10 -0
  30. package/es/LmEditTable/components/DraggableContainer.js +39 -0
  31. package/es/LmEditTable/components/QuickOpetate.d.ts +12 -0
  32. package/es/LmEditTable/components/QuickOpetate.js +82 -0
  33. package/es/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
  34. package/es/LmEditTable/components/bottomOpetateComponent.js +23 -0
  35. package/es/LmEditTable/components/customRenderEmpty.d.ts +2 -0
  36. package/es/LmEditTable/components/customRenderEmpty.js +20 -0
  37. package/es/LmEditTable/components/index.d.ts +17 -0
  38. package/es/LmEditTable/components/index.js +8 -0
  39. package/es/LmEditTable/hooks/useForkRef.d.ts +2 -0
  40. package/es/LmEditTable/hooks/useForkRef.js +22 -0
  41. package/es/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
  42. package/es/LmEditTable/rowSort/DndContainerRow.js +81 -0
  43. package/es/LmEditTable/sortableItem.d.ts +3 -2
  44. package/es/LmEditTable/sortableItem.js +16 -4
  45. package/es/LmEditTable/sortableItemCol.js +40 -10
  46. package/es/LmEditTable/style/index.css +92 -0
  47. package/es/LmEditTable/style/variables.css +92 -0
  48. package/es/LmEditTable/util.d.ts +8 -0
  49. package/es/LmEditTable/util.js +103 -7
  50. package/es/LmEditTable/virtual/VirtualRow.d.ts +7 -0
  51. package/es/LmEditTable/virtual/VirtualRow.js +140 -0
  52. package/es/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
  53. package/es/LmEditTable/virtual/VirtualRow2.js +62 -0
  54. package/es/LmEditTable/virtual/VirtualTable.d.ts +3 -0
  55. package/es/LmEditTable/virtual/VirtualTable.js +62 -0
  56. package/es/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
  57. package/es/LmEditTable/virtual/VirtualWrapper.js +60 -0
  58. package/es/LmEditTable/virtual/context.d.ts +13 -0
  59. package/es/LmEditTable/virtual/context.js +66 -0
  60. package/es/LmEditTable/virtual/index.d.ts +4 -0
  61. package/es/LmEditTable/virtual/index.js +4 -0
  62. package/es/LmFilter/filterFns/index.js +7 -2
  63. package/es/LmTable/virTual/VirtualRow.d.ts +1 -1
  64. package/es/LmTable/virTual/VirtualRow.js +82 -48
  65. package/es/LmTable/virTual/VirtualTable.js +17 -9
  66. package/es/LmTable/virTual/context.js +14 -2
  67. package/es/hooks/useEvent/index.js +1 -1
  68. package/es/index.d.ts +1 -2
  69. package/es/styles/variables.css +92 -0
  70. package/lib/InputNumber/index.js +9 -9
  71. package/lib/LmEditTable/DndContainer.d.ts +6 -3
  72. package/lib/LmEditTable/DndContainer.js +74 -9
  73. package/lib/LmEditTable/DragHandle.js +1 -1
  74. package/lib/LmEditTable/EditTable.d.ts +10 -5
  75. package/lib/LmEditTable/EditTable.js +362 -357
  76. package/lib/LmEditTable/components/DraggableContainer.d.ts +10 -0
  77. package/lib/LmEditTable/components/DraggableContainer.js +52 -0
  78. package/lib/LmEditTable/components/QuickOpetate.d.ts +12 -0
  79. package/lib/LmEditTable/components/QuickOpetate.js +96 -0
  80. package/lib/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
  81. package/lib/LmEditTable/components/bottomOpetateComponent.js +34 -0
  82. package/lib/LmEditTable/components/customRenderEmpty.d.ts +2 -0
  83. package/lib/LmEditTable/components/customRenderEmpty.js +32 -0
  84. package/lib/LmEditTable/components/index.d.ts +17 -0
  85. package/lib/LmEditTable/components/index.js +45 -0
  86. package/lib/LmEditTable/hooks/useForkRef.d.ts +2 -0
  87. package/lib/LmEditTable/hooks/useForkRef.js +29 -0
  88. package/lib/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
  89. package/lib/LmEditTable/rowSort/DndContainerRow.js +99 -0
  90. package/lib/LmEditTable/sortableItem.d.ts +3 -2
  91. package/lib/LmEditTable/sortableItem.js +19 -5
  92. package/lib/LmEditTable/sortableItemCol.js +37 -8
  93. package/lib/LmEditTable/style/index.css +92 -0
  94. package/lib/LmEditTable/style/variables.css +92 -0
  95. package/lib/LmEditTable/util.d.ts +8 -0
  96. package/lib/LmEditTable/util.js +110 -6
  97. package/lib/LmEditTable/virtual/VirtualRow.d.ts +7 -0
  98. package/lib/LmEditTable/virtual/VirtualRow.js +155 -0
  99. package/lib/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
  100. package/lib/LmEditTable/virtual/VirtualRow2.js +78 -0
  101. package/lib/LmEditTable/virtual/VirtualTable.d.ts +3 -0
  102. package/lib/LmEditTable/virtual/VirtualTable.js +79 -0
  103. package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
  104. package/lib/LmEditTable/virtual/VirtualWrapper.js +73 -0
  105. package/lib/LmEditTable/virtual/context.d.ts +13 -0
  106. package/lib/LmEditTable/virtual/context.js +76 -0
  107. package/lib/LmEditTable/virtual/index.d.ts +4 -0
  108. package/lib/LmEditTable/virtual/index.js +31 -0
  109. package/lib/LmFilter/filterFns/index.js +7 -2
  110. package/lib/LmTable/virTual/VirtualRow.d.ts +1 -1
  111. package/lib/LmTable/virTual/VirtualRow.js +81 -48
  112. package/lib/LmTable/virTual/VirtualTable.js +16 -8
  113. package/lib/LmTable/virTual/context.js +14 -2
  114. package/lib/hooks/useEvent/index.js +1 -1
  115. package/lib/index.d.ts +1 -2
  116. package/lib/styles/variables.css +92 -0
  117. package/package.json +7 -9
@@ -1,3 +1,7 @@
1
+ .lm_editTable_warpper {
2
+ height: 100%;
3
+ width: 100%;
4
+ }
1
5
  .lm_editTable_warpper .ant-picker {
2
6
  width: 100%;
3
7
  }
@@ -26,6 +30,9 @@
26
30
  width: 32px;
27
31
  padding: 0 8px;
28
32
  }
33
+ .lm_editTable_warpper .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before {
34
+ height: 100%;
35
+ }
29
36
  .lm_editTable_warpper .lm_editTable_cell {
30
37
  cursor: pointer;
31
38
  height: 40px;
@@ -37,6 +44,21 @@
37
44
  letter-spacing: 0px;
38
45
  color: var(--color-85);
39
46
  }
47
+ .lm_editTable_warpper .lm_custom_cell_td {
48
+ position: relative;
49
+ }
50
+ .lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append {
51
+ display: flex;
52
+ flex-direction: row;
53
+ flex-wrap: nowrap;
54
+ }
55
+ .lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append .ant-table-row-expand-icon {
56
+ margin-right: 8px;
57
+ flex: none;
58
+ }
59
+ .lm_editTable_warpper .lm_custom_cell_td > .ant-form-item {
60
+ flex: 1 1 auto;
61
+ }
40
62
  .lm_editTable_warpper .lm_custom_cell_td .ant-form-item-control-input-content {
41
63
  display: flex;
42
64
  flex-direction: row;
@@ -48,6 +70,32 @@
48
70
  .lm_editTable_warpper .lm_custom_cell_td .ant-table-row-expand-icon {
49
71
  margin-top: 6px;
50
72
  }
73
+ .lm_editTable_warpper .lm_custom_cell_td .quick_copy_warp {
74
+ font-size: 8px;
75
+ position: absolute;
76
+ left: calc(50% - 10px);
77
+ z-index: 100;
78
+ width: 20px;
79
+ height: 10px;
80
+ background-color: var(--color-6);
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: center;
84
+ color: #D8D8D8;
85
+ }
86
+ .lm_editTable_warpper .lm_custom_cell_td .quick_copy_warp:hover {
87
+ cursor: pointer;
88
+ background-color: var(--primary-color);
89
+ color: #fff;
90
+ }
91
+ .lm_editTable_warpper .lm_custom_cell_td .quick_copy_up {
92
+ top: -4px;
93
+ left: calc(50% - 10px);
94
+ }
95
+ .lm_editTable_warpper .lm_custom_cell_td .quick_copy_down {
96
+ bottom: -6px;
97
+ left: calc(50% - 10px);
98
+ }
51
99
  .lm_editTable_warpper .lm_editTable_cell_edit {
52
100
  height: 40px;
53
101
  padding: 8px 8px !important;
@@ -59,6 +107,9 @@
59
107
  .lm_editTable_warpper .lm_table_quickcopy .anticon {
60
108
  color: var(--text-color);
61
109
  }
110
+ .lm_editTable_warpper .ant-table-body {
111
+ scroll-behavior: smooth;
112
+ }
62
113
  .lm_editTable_warpper .icon_drag {
63
114
  color: var(--tip-text-color);
64
115
  }
@@ -75,6 +126,32 @@
75
126
  .lm_editTable_warpper .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before {
76
127
  background-color: rgba(0, 0, 0, 0.06) !important;
77
128
  }
129
+ .lm_editTable_warpper .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before {
130
+ background-color: rgba(0, 0, 0, 0.06) !important;
131
+ }
132
+ .lm_editTable_warpper .lm_table_empty {
133
+ display: flex;
134
+ flex-direction: column;
135
+ align-items: center;
136
+ padding: 12px 0;
137
+ font-size: 12px;
138
+ }
139
+ .lm_editTable_warpper .lm_table_empty > img {
140
+ width: 130px;
141
+ height: 80px;
142
+ margin-bottom: 8px;
143
+ }
144
+ .lm_editTable_warpper .lm_table_empty .empty_img {
145
+ margin-bottom: 8px;
146
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAACgCAYAAADq8hJGAAAABHNCSVQICAgIfAhkiAAADh9JREFUeJzt3U1sG2d+x/HvMy98EUlblivHbmPXrrN14KCbLBrEhwViC0jjxusgiz3oViC5NLdstkCBHraoChRFT6mL9uJLHBQoUCiHtnBgBHBQ+VAECGDD6SHZYOvYRrqxEzu2JVMWxZeZpwdyJpJqSRQ15PDl97mMHHGGfzLUPD8+8zzPGKQrZmdnMwD5fN4DePXVV5fa3G8CoFAolACWl5cBCILgNsD09HStC+X2rZmZGQfghRde8AFc1/UAbt26FQAUCoU6wPT0dJBWjcPESbsAEekfJu0Chs2HH364DyAIgidW/vcgCOoA1tqvAF577bUywOzsrAtQKBQOtx469rjjNhqNEMBxnGvQfuIYNBcuXNgBUK/X9wB4nldsZ7/o/XVddxEgDMNHAMVicR5gamqq0Y16h40SgojElBASMjs7uxMgn88fbOfxlUrl1wC5XG4SwBizq539jDE1gNOnT/+qo0L7TJSQcrncAQBjzI4kjx8EQdg67h2Aq1ev3gWYmZkJk3yeYaGEICIxJYSEnD9//gcAnufl29yl2tpmO3k+a+1tgFOnTt3tZP+0XbhwIQv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thugEvq7AOqL9x6APrcJsqCEICIreEAFoFAoaNxBG2q1TAYgdHN7AQLLPgA3444BeLZ6DcB4Y1oPIVHV7wA8b/cPAcYmd9cBamH9DoBbDW4B5POVxbQqHET5fH5Vn4wSgojE4i+6c3NzHkClUhkD8P0eL+Pb5zxvYhKgYbOHARwn3PBk6u46/GcAxs281P3qhldYX/4PgHDhxtl2Hu8Z9xuAWu3W9W7WNSwePHhQA5ienq6AEoKIrPD/UsDZs2d9gP379+d7X07/KRR+ZzeAdbMHOzqAmy8COJniU8lVNfzCyt1Pt7P/cm3pPkC4/M2NZCoaTq+88koZwBijqwwistq6/QRRn8LExEQWwOv2zfv61MNK5vcBshk/m3Yt0j5rbbPFC+e/AMhkMo10K+ovR48eXQYwxqx6X5QQRCS2aas/OzvrAhw5ciTX/XL6T93fuQPAs+xNuxZp35ifXwCoVL75Nu1a+onneXWAZ555pva43yshiEis7X6BmZkZB+D48eMZgFKpNFInE9/3iwAmt2MCwGiyQn9yGosA1fn5e2mX0k/K5XINYGpqasO+lJH6oxaRjXXcykV9C5OTkz5ANpsdiRYzk8m0XmdpDCCf91ojOz3NBemhIAhDAN8PlgCq1eoSwMLCQpBmXf2iWq1agBMnTtQAjDFtrSOhhCAiscRadWttdHKJ7kwwaieb6PX6K7ePHsUrW49EgkqatQQAxSJRr3i9tVUSWC1aFyIAMMZ09P6M2h+tiGyga62WtTY69tqTjllnO+zWvh9rt+u9X8MmasnCTbZaCWljaxNBImtNDvuHT0S2oG9a5xWJYr3kMGqJYj3tvv7NHrf29+22yEk/TtqzKkFFsxOTpoQgIrGBb21XJIvIeq9pqy2mSBpW9aF0KwmsRwlBRGJqFdv0mCQS6TSRyGhZ29KnkgA2o4QgIjG1YkNug2Qjbei3FrzblBBERERERGQD/wcbRqz954lTWQAAAABJRU5ErkJggg==');
147
+ background-size: cover;
148
+ }
149
+ .lm_editTable_warpper .lm_table_empty > span {
150
+ color: var(--font-color);
151
+ }
152
+ .lm_editTable_warpper .ant-table-empty table {
153
+ height: 100%;
154
+ }
78
155
  .lm_editTable_warpper .ant-picker {
79
156
  height: 24px !important;
80
157
  padding: 2px 8px;
@@ -118,3 +195,18 @@
118
195
  .lm_table_append_add_popover .ant-popover-inner-content ul li:hover {
119
196
  background-color: var(--color-15);
120
197
  }
198
+ .lm_edittable_col_sort_item {
199
+ overflow: hidden;
200
+ }
201
+ .lm_editable_col_drag {
202
+ background-color: #fff;
203
+ font-size: 12px;
204
+ display: flex;
205
+ box-sizing: border-box;
206
+ transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));
207
+ transform-origin: 0 0;
208
+ touch-action: manipulation;
209
+ scale: 1.05;
210
+ box-shadow: 0 0 0 calc(1px / var(--scale-x, 1)) rgba(63, 63, 68, 0.05), 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(34, 33, 81, 0.15);
211
+ padding: 8px;
212
+ }
@@ -2,6 +2,14 @@ export declare function isObjEmpty(obj: Record<string, any>): boolean;
2
2
  export declare function deepDataSourcePreKeys(dataSource: any[], rowKey: string): any;
3
3
  export declare function isExpandRow(children: any): boolean;
4
4
  export declare function checkRowKeyByDataSource(dataSource: any, rowKey: any): any;
5
+ export declare function getExpandStatus(children: any): any;
6
+ export declare function checkMemoShouldUploadSpecialFun(prev: any, next: any): any;
7
+ export declare function checkExpandIconColumnIndex({ rowSelection, sortOpen, indexCol }: {
8
+ rowSelection: any;
9
+ sortOpen: any;
10
+ indexCol: any;
11
+ }): number;
12
+ export declare function checkDataSourceIsEmpty(config: any, dataSource: any): any;
5
13
  declare const _default: {
6
14
  isObjEmpty: typeof isObjEmpty;
7
15
  };
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
- import { keyBy } from 'lodash';
3
+ import { keyBy, isEqual, pick, isFunction, omit } from 'lodash';
4
4
  export function isObjEmpty(obj) {
5
5
  var _a;
6
6
 
@@ -9,19 +9,20 @@ export function isObjEmpty(obj) {
9
9
  export function deepDataSourcePreKeys(dataSource, rowKey) {
10
10
  var deepDataSource = [];
11
11
 
12
- var eachChildren = function eachChildren(children, preKeys) {
13
- children === null || children === void 0 ? void 0 : children.forEach(function (item) {
12
+ var eachChildren = function eachChildren(children, preKeys, deepIds) {
13
+ children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
14
14
  deepDataSource.push(Object.assign(Object.assign({}, item), {
15
- preKeys: [].concat(_toConsumableArray(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])
15
+ preKeys: [].concat(_toConsumableArray(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]]),
16
+ _deepIds: [].concat(_toConsumableArray(deepIds), [index + 1])
16
17
  }));
17
18
 
18
19
  if (item === null || item === void 0 ? void 0 : item.children) {
19
- eachChildren(item === null || item === void 0 ? void 0 : item.children, [].concat(_toConsumableArray(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])); // deepDataSource.push({ ...item, preKeys: [...preKeys, item[rowKey]] })
20
+ eachChildren(item === null || item === void 0 ? void 0 : item.children, [].concat(_toConsumableArray(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]]), [].concat(_toConsumableArray(deepIds), [index + 1])); // deepDataSource.push({ ...item, preKeys: [...preKeys, item[rowKey]] })
20
21
  }
21
22
  });
22
23
  };
23
24
 
24
- eachChildren(dataSource, []);
25
+ eachChildren(dataSource, [], []);
25
26
  return keyBy(deepDataSource, rowKey);
26
27
  }
27
28
  export function isExpandRow(children) {
@@ -53,7 +54,102 @@ export function checkRowKeyByDataSource(dataSource, rowKey) {
53
54
 
54
55
  return Object.assign(Object.assign({}, v), _defineProperty({}, rowKey, v[rowKey] || "v".concat(idx + 1)));
55
56
  });
56
- return res;
57
+ return res || [];
58
+ }
59
+ export function getExpandStatus(children) {
60
+ var _a, _b, _c, _d, _e;
61
+
62
+ return isExpandRow(children) ? (_e = (_d = (_c = (_b = (_a = children === null || children === void 0 ? void 0 : children[0]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c[1]) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e['aria-label'] : '';
63
+ }
64
+ export function checkMemoShouldUploadSpecialFun(prev, next) {
65
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
66
+
67
+ var checkExpandStatus = getExpandStatus(prev.children) === getExpandStatus(next.children);
68
+
69
+ if (!checkExpandStatus) {
70
+ return false;
71
+ }
72
+
73
+ var prevCol = prev === null || prev === void 0 ? void 0 : prev.col;
74
+ var nextCol = next === null || next === void 0 ? void 0 : next.col;
75
+ /** TODO: 使用了自定义render, 是否要判断rowIndex? 这样排序之后,渲染的性能就会变差 */
76
+
77
+ if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.render) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.render)) && !isEqual(pick(prev, ['colIndex', 'record', 'children']), pick(next, ['colIndex', 'record', 'children']))) {
78
+ return false;
79
+ }
80
+
81
+ if (!(next === null || next === void 0 ? void 0 : next.quickOpetateClearAll) && ((next === null || next === void 0 ? void 0 : next.getLength) < 2 || (prev === null || prev === void 0 ? void 0 : prev.getLength) === 1) && (next === null || next === void 0 ? void 0 : next.dataIndex) === 'lm_edit_opetate') {
82
+ return false;
83
+ }
84
+
85
+ if (prev.isEdit !== next.isEdit) {
86
+ return false;
87
+ } // console.log(22, prevCol?.editable === 'render', nextCol?.editable === 'render', prevCol?.componentProps, prevCol?.componentProps)
88
+
89
+
90
+ if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.editable) === 'render' || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.editable) === 'render') && (((_a = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _a === void 0 ? void 0 : _a.render) || ((_b = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _b === void 0 ? void 0 : _b.render)) && (!isEqual(omit(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, ['render']), omit(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps, ['render'])) || !isEqual(pick(prev, ['colIndex', 'record', 'rowIndex']), pick(next, ['colIndex', 'record', 'rowIndex'])))) {
91
+ return false;
92
+ }
93
+
94
+ if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.fixed) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.fixed)) && !isEqual(prev === null || prev === void 0 ? void 0 : prev.style, next === null || next === void 0 ? void 0 : next.style)) {
95
+ return false;
96
+ }
97
+
98
+ if ((((_c = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _c === void 0 ? void 0 : _c.optionOnly) || ((_d = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _d === void 0 ? void 0 : _d.optionOnly)) && !isEqual((_e = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _e === void 0 ? void 0 : _e.options, (_f = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _f === void 0 ? void 0 : _f.options)) {
99
+ return false;
100
+ }
101
+
102
+ if ((((_g = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _g === void 0 ? void 0 : _g.options) || ((_h = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _h === void 0 ? void 0 : _h.options)) && !isEqual((_j = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _j === void 0 ? void 0 : _j.options, (_k = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _k === void 0 ? void 0 : _k.options)) {
103
+ return false;
104
+ }
105
+
106
+ if ((isFunction(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) || isFunction(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) && !isEqual(prevCol.newOptions, nextCol.newOptions) && !isEqual(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) {
107
+ return false;
108
+ }
109
+
110
+ if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.order) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.order)) && !isEqual(prevCol === null || prevCol === void 0 ? void 0 : prevCol.order, nextCol === null || nextCol === void 0 ? void 0 : nextCol.order)) {
111
+ // return isEqual(prevCol?.order, nextCol?.fixed)
112
+ return false;
113
+ }
114
+
115
+ if (next.className.indexOf('drag-visible') > -1) {
116
+ return isEqual(prev.style, next.style);
117
+ }
118
+
119
+ if (next.className.indexOf('ant-table-selection-column') > -1) {
120
+ return isEqual((_m = (_l = prev.children) === null || _l === void 0 ? void 0 : _l[1]) === null || _m === void 0 ? void 0 : _m.props, (_p = (_o = next.children) === null || _o === void 0 ? void 0 : _o[1]) === null || _p === void 0 ? void 0 : _p.props);
121
+ }
122
+ /** 如果启用了快速复制功能,需要实时判断rowIndex与getLength */
123
+
124
+
125
+ if (((_q = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _q === void 0 ? void 0 : _q.quickcopy) || ((_r = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _r === void 0 ? void 0 : _r.quickcopy)) {
126
+ var pickProps = ['record', 'colIndex', 'rowIndex', 'getLength'];
127
+ var p = pick(prev, pickProps);
128
+ var n = pick(next, pickProps);
129
+ return isEqual(p, n);
130
+ }
131
+
132
+ return true;
133
+ }
134
+ export function checkExpandIconColumnIndex(_ref) {
135
+ var rowSelection = _ref.rowSelection,
136
+ sortOpen = _ref.sortOpen,
137
+ indexCol = _ref.indexCol;
138
+ var arr = [rowSelection, sortOpen, indexCol].filter(function (item) {
139
+ return !!item;
140
+ });
141
+ return arr.length;
142
+ }
143
+ export function checkDataSourceIsEmpty(config, dataSource) {
144
+ if (dataSource.length) {
145
+ return config;
146
+ }
147
+
148
+ return Object.assign(Object.assign({}, config), {
149
+ components: Object.assign(Object.assign({}, config.components), {
150
+ body: {}
151
+ })
152
+ });
57
153
  }
58
154
  export default {
59
155
  isObjEmpty: isObjEmpty
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface rowProps {
3
+ children?: any;
4
+ pref?: any;
5
+ }
6
+ declare const VirtualRow: React.NamedExoticComponent<rowProps>;
7
+ export default VirtualRow;
@@ -0,0 +1,140 @@
1
+ var __rest = this && this.__rest || function (s, e) {
2
+ var t = {};
3
+
4
+ for (var p in s) {
5
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
6
+ }
7
+
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+
14
+ import React, { useRef, useMemo, useEffect } from 'react';
15
+ import { useStore } from './context';
16
+ import useForkRef from '../hooks/useForkRef';
17
+
18
+ var useOptions = function useOptions(_ref) {
19
+ var children = _ref.children,
20
+ ref = _ref.ref,
21
+ trRef = _ref.trRef;
22
+
23
+ var _useStore = useStore(),
24
+ state = _useStore.state,
25
+ dispatch = _useStore.dispatch,
26
+ instance = _useStore.instance;
27
+
28
+ var virtualItems = instance.columnVirtual.virtualItems;
29
+ var rowHeight = state.rowHeight,
30
+ totalLen = state.totalLen;
31
+ var sliceColumns = useMemo(function () {
32
+ return children === null || children === void 0 ? void 0 : children.reduce(function (pre, cur) {
33
+ var _a, _b;
34
+
35
+ if (typeof ((_a = cur.props) === null || _a === void 0 ? void 0 : _a.fixLeft) === 'number') {
36
+ pre.leftColumns.push(cur);
37
+ return pre;
38
+ }
39
+
40
+ if (typeof ((_b = cur.props) === null || _b === void 0 ? void 0 : _b.fixRight) === 'number') {
41
+ pre.rightColumns.push(cur);
42
+ return pre;
43
+ }
44
+
45
+ pre.centerColumns.push(cur);
46
+ return pre;
47
+ }, {
48
+ leftColumns: [],
49
+ rightColumns: [],
50
+ centerColumns: []
51
+ });
52
+ }, [children]);
53
+ useEffect(function () {
54
+ dispatch({
55
+ type: 'changeSliceColumns',
56
+ sliceColumns: sliceColumns
57
+ });
58
+ }, [sliceColumns]); // 非固定列长度
59
+
60
+ var centerColumnsLen = useMemo(function () {
61
+ var _a;
62
+
63
+ return (_a = sliceColumns.centerColumns.length) !== null && _a !== void 0 ? _a : 0;
64
+ }, [sliceColumns]);
65
+ useEffect(function () {
66
+ if (state.columnsLen !== centerColumnsLen) {
67
+ dispatch({
68
+ type: 'changeColumnsLen',
69
+ columnsLen: centerColumnsLen !== null && centerColumnsLen !== void 0 ? centerColumnsLen : 0
70
+ });
71
+ }
72
+ }, [centerColumnsLen, dispatch, state.columnsLen]); // 获取行的高度
73
+
74
+ useEffect(function () {
75
+ var initHeight = function initHeight(tempRef) {
76
+ var _a, _b, _c;
77
+
78
+ if (((_a = tempRef === null || tempRef === void 0 ? void 0 : tempRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) && !rowHeight && totalLen) {
79
+ var tempRowHeight = (_c = (_b = tempRef === null || tempRef === void 0 ? void 0 : tempRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) !== null && _c !== void 0 ? _c : 0;
80
+ dispatch({
81
+ type: 'initHeight',
82
+ rowHeight: tempRowHeight + 1
83
+ });
84
+ }
85
+ };
86
+
87
+ initHeight(Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef);
88
+ }, [trRef, dispatch, rowHeight, totalLen, ref]); // 横向单元格合并
89
+
90
+ var leftColSpan = useMemo(function () {
91
+ var _a;
92
+
93
+ return (_a = virtualItems[0]) === null || _a === void 0 ? void 0 : _a.index;
94
+ }, [virtualItems]); // 右侧隐藏数量
95
+
96
+ var rightColSpan = useMemo(function () {
97
+ return sliceColumns.centerColumns.length - virtualItems.length - leftColSpan || 0;
98
+ }, [sliceColumns.centerColumns.length, virtualItems.length, leftColSpan]);
99
+ return Object.assign(Object.assign({
100
+ virtualItems: virtualItems
101
+ }, sliceColumns), {
102
+ leftColSpan: leftColSpan,
103
+ rightColSpan: rightColSpan
104
+ });
105
+ };
106
+
107
+ var VirtualRow = /*#__PURE__*/React.memo(function (_a, ref) {
108
+ var children = _a.children,
109
+ pref = _a.pref,
110
+ resetProps = __rest(_a, ["children", "pref"]);
111
+
112
+ var trRef = useRef(null);
113
+
114
+ var _useOptions = useOptions({
115
+ children: children,
116
+ ref: ref,
117
+ trRef: trRef
118
+ }),
119
+ virtualItems = _useOptions.virtualItems,
120
+ leftColumns = _useOptions.leftColumns,
121
+ centerColumns = _useOptions.centerColumns,
122
+ rightColumns = _useOptions.rightColumns,
123
+ leftColSpan = _useOptions.leftColSpan,
124
+ rightColSpan = _useOptions.rightColSpan;
125
+
126
+ return /*#__PURE__*/React.createElement("tr", Object.assign({}, resetProps, {
127
+ ref: useForkRef(pref, trRef)
128
+ }), leftColumns, !!leftColSpan && /*#__PURE__*/React.createElement("td", {
129
+ key: "leftColSpan",
130
+ colSpan: leftColSpan
131
+ }), virtualItems.map(function (virtualCol) {
132
+ return /*#__PURE__*/React.cloneElement(centerColumns[virtualCol.index], {
133
+ ref: virtualCol.measureRef
134
+ });
135
+ }), !!rightColSpan && /*#__PURE__*/React.createElement("td", {
136
+ key: "rightColSpan",
137
+ colSpan: rightColSpan
138
+ }), rightColumns);
139
+ });
140
+ export default VirtualRow;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface rowProps {
3
+ children?: any;
4
+ pref?: any;
5
+ }
6
+ declare const VirtualRow: React.NamedExoticComponent<rowProps>;
7
+ export default VirtualRow;
@@ -0,0 +1,62 @@
1
+ var __rest = this && this.__rest || function (s, e) {
2
+ var t = {};
3
+
4
+ for (var p in s) {
5
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
6
+ }
7
+
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+
14
+ import React, { useRef, useMemo, useEffect } from 'react';
15
+ import { useStore } from './context';
16
+ import useForkRef from '../hooks/useForkRef';
17
+ var VirtualRow = /*#__PURE__*/React.memo(function (_a, ref) {
18
+ var children = _a.children,
19
+ pref = _a.pref,
20
+ resetProps = __rest(_a, ["children", "pref"]);
21
+
22
+ var _useStore = useStore(),
23
+ state = _useStore.state,
24
+ dispatch = _useStore.dispatch;
25
+
26
+ var rowHeight = state.rowHeight,
27
+ totalLen = state.totalLen;
28
+ var trRef = useRef(null); // 列长度
29
+
30
+ var columnsLen = useMemo(function () {
31
+ var _a;
32
+
33
+ return (_a = children === null || children === void 0 ? void 0 : children.length) !== null && _a !== void 0 ? _a : 0;
34
+ }, [children]);
35
+ useEffect(function () {
36
+ if (state.columnsLen !== columnsLen) {
37
+ dispatch({
38
+ type: 'changeColumnsLen',
39
+ columnsLen: columnsLen !== null && columnsLen !== void 0 ? columnsLen : 0
40
+ });
41
+ }
42
+ }, [columnsLen, dispatch, state.columnsLen]);
43
+ useEffect(function () {
44
+ var initHeight = function initHeight(tempRef) {
45
+ var _a, _b, _c;
46
+
47
+ if (((_a = tempRef === null || tempRef === void 0 ? void 0 : tempRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) && !rowHeight && totalLen) {
48
+ var tempRowHeight = (_c = (_b = tempRef === null || tempRef === void 0 ? void 0 : tempRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) !== null && _c !== void 0 ? _c : 0;
49
+ dispatch({
50
+ type: 'initHeight',
51
+ rowHeight: tempRowHeight
52
+ });
53
+ }
54
+ };
55
+
56
+ initHeight(trRef);
57
+ }, [trRef, dispatch, rowHeight, totalLen, ref]);
58
+ return /*#__PURE__*/React.createElement("tr", Object.assign({}, resetProps, {
59
+ ref: useForkRef(pref, trRef)
60
+ }), children);
61
+ });
62
+ export default VirtualRow;
@@ -0,0 +1,3 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ declare const VirtualTable: React.MemoExoticComponent<(tableProps: PropsWithChildren<any>) => JSX.Element>;
3
+ export default VirtualTable;
@@ -0,0 +1,62 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useCallback, useRef } from 'react';
3
+ import { useVirtual } from 'react-virtual';
4
+ import { TableContext, useRealive } from './context';
5
+ var VirtualTable = /*#__PURE__*/React.memo(function (tableProps) {
6
+ var _a, _b, _c, _d;
7
+
8
+ var bodyRef = useRef(null);
9
+
10
+ var _useRealive = useRealive(),
11
+ _useRealive2 = _slicedToArray(_useRealive, 2),
12
+ state = _useRealive2[0],
13
+ dispatch = _useRealive2[1]; // 行虚拟化 { totalSize, virtualItems }
14
+
15
+
16
+ var rowVirtual = useVirtual({
17
+ size: state.totalLen,
18
+ // 绑定父节点
19
+ parentRef: {
20
+ current: (_a = bodyRef === null || bodyRef === void 0 ? void 0 : bodyRef.current) === null || _a === void 0 ? void 0 : _a.parentNode
21
+ },
22
+ estimateSize: React.useCallback(function () {
23
+ return state.rowHeight;
24
+ }, [state.rowHeight]),
25
+ overscan: 5
26
+ }); // 列动态宽度
27
+
28
+ var columnEstimateSize = useCallback(function (i) {
29
+ var _a, _b;
30
+
31
+ var colWidths = (_b = (_a = tableProps === null || tableProps === void 0 ? void 0 : tableProps.children[0]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.colWidths;
32
+ var leftColumnsLen = state.sliceColumns.leftColumns.length;
33
+ var centerColumnsLen = state.sliceColumns.centerColumns.length; // 获取非固定列
34
+
35
+ var virList = colWidths.slice(leftColumnsLen, leftColumnsLen + centerColumnsLen);
36
+ return virList[i] || 0;
37
+ }, [(_c = (_b = tableProps.children[0]) === null || _b === void 0 ? void 0 : _b.props) === null || _c === void 0 ? void 0 : _c.colWidths, state.sliceColumns.leftColumns.length, state.sliceColumns.centerColumns.length]); // 列虚拟化
38
+
39
+ var columnVirtual = useVirtual({
40
+ horizontal: true,
41
+ size: state.columnsLen,
42
+ parentRef: {
43
+ current: (_d = bodyRef === null || bodyRef === void 0 ? void 0 : bodyRef.current) === null || _d === void 0 ? void 0 : _d.parentNode
44
+ },
45
+ estimateSize: columnEstimateSize,
46
+ overscan: 5
47
+ });
48
+ var instance = {
49
+ rowVirtual: rowVirtual,
50
+ columnVirtual: columnVirtual
51
+ };
52
+ return /*#__PURE__*/React.createElement(TableContext.Provider, {
53
+ value: {
54
+ state: state,
55
+ dispatch: dispatch,
56
+ instance: instance
57
+ }
58
+ }, /*#__PURE__*/React.createElement("table", Object.assign({
59
+ ref: bodyRef
60
+ }, tableProps)));
61
+ });
62
+ export default VirtualTable;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const VirtualWrapper: React.MemoExoticComponent<(wrapperProps: React.PropsWithChildren<any>) => JSX.Element>;
3
+ export default VirtualWrapper;
@@ -0,0 +1,60 @@
1
+ var __rest = this && this.__rest || function (s, e) {
2
+ var t = {};
3
+
4
+ for (var p in s) {
5
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
6
+ }
7
+
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+
14
+ import React, { useEffect, useMemo } from 'react';
15
+ import { useStore } from './context';
16
+ var VirtualWrapper = /*#__PURE__*/React.memo(function (wrapperProps) {
17
+ var _a, _b;
18
+
19
+ var children = wrapperProps.children,
20
+ resetProps = __rest(wrapperProps, ["children"]);
21
+
22
+ var _useStore = useStore(),
23
+ state = _useStore.state,
24
+ dispatch = _useStore.dispatch,
25
+ instance = _useStore.instance;
26
+
27
+ var _instance$rowVirtual = instance.rowVirtual,
28
+ virtualItems = _instance$rowVirtual.virtualItems,
29
+ totalSize = _instance$rowVirtual.totalSize;
30
+ var contents = useMemo(function () {
31
+ return children[1];
32
+ }, [children]);
33
+ var contentsLen = useMemo(function () {
34
+ var _a;
35
+
36
+ return (_a = contents === null || contents === void 0 ? void 0 : contents.length) !== null && _a !== void 0 ? _a : 0;
37
+ }, [contents]);
38
+ useEffect(function () {
39
+ if (state.totalLen !== contentsLen) {
40
+ dispatch({
41
+ type: 'changeTotalLen',
42
+ totalLen: contentsLen !== null && contentsLen !== void 0 ? contentsLen : 0
43
+ });
44
+ }
45
+ }, [contentsLen, dispatch, state.totalLen]);
46
+ var paddingTop = virtualItems.length > 0 ? ((_a = virtualItems === null || virtualItems === void 0 ? void 0 : virtualItems[0]) === null || _a === void 0 ? void 0 : _a.start) || 0 : 0;
47
+ var paddingBottom = virtualItems.length > 0 ? totalSize - (((_b = virtualItems === null || virtualItems === void 0 ? void 0 : virtualItems[virtualItems.length - 1]) === null || _b === void 0 ? void 0 : _b.end) || 0) : 0;
48
+ return /*#__PURE__*/React.createElement("tbody", Object.assign({}, resetProps), paddingTop > 0 && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
49
+ style: {
50
+ height: "".concat(paddingTop, "px")
51
+ }
52
+ })), children[0], virtualItems.map(function (virtualRow) {
53
+ return contents[virtualRow.index];
54
+ }), paddingBottom > 0 && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
55
+ style: {
56
+ height: "".concat(paddingBottom, "px")
57
+ }
58
+ })));
59
+ });
60
+ export default VirtualWrapper;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ declare const TableContext: import("react").Context<{
3
+ state: any;
4
+ dispatch: any;
5
+ instance: any;
6
+ }>;
7
+ declare const useStore: () => {
8
+ state: any;
9
+ dispatch: any;
10
+ instance: any;
11
+ };
12
+ declare const useRealive: () => [any, import("react").Dispatch<any>];
13
+ export { TableContext, useStore, useRealive };