@geelato/web-vue 2.57.1 → 2.58.2

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 (218) hide show
  1. package/dist/arco-vue.js +891 -536
  2. package/dist/arco-vue.js.map +1 -1
  3. package/dist/arco-vue.min.js +1648 -1546
  4. package/dist/arco-vue.min.js.map +1 -1
  5. package/dist/arco.css +39 -8
  6. package/dist/arco.min.css +1 -1
  7. package/es/_components/icon-hover.d.ts +3 -3
  8. package/es/_components/input-label/input-label.d.ts +5 -5
  9. package/es/_components/picker/input-range.d.ts +10 -10
  10. package/es/_components/picker/input.d.ts +8 -8
  11. package/es/_components/select-view/select-view.d.ts +6 -6
  12. package/es/_components/virtual-list-v2/virtual-list.d.ts +2 -2
  13. package/es/_hooks/use-form-item.d.ts +2 -2
  14. package/es/_hooks/use-size.d.ts +3 -3
  15. package/es/_utils/array.d.ts +1 -1
  16. package/es/_utils/array.js +18 -1
  17. package/es/alert/alert.d.ts +6 -6
  18. package/es/alert/index.d.ts +12 -12
  19. package/es/anchor/anchor.d.ts +1 -1
  20. package/es/anchor/index.d.ts +3 -3
  21. package/es/auto-complete/auto-complete.d.ts +3 -3
  22. package/es/auto-complete/index.d.ts +9 -9
  23. package/es/avatar/avatar.d.ts +1 -1
  24. package/es/avatar/index.d.ts +3 -3
  25. package/es/button/button-group.d.ts +2 -2
  26. package/es/button/button.d.ts +2 -2
  27. package/es/button/index.d.ts +5 -5
  28. package/es/calendar/calendar.d.ts +1 -1
  29. package/es/calendar/index.d.ts +3 -3
  30. package/es/card/card.d.ts +2 -2
  31. package/es/card/index.d.ts +3 -3
  32. package/es/carousel/carousel-indicator.d.ts +1 -1
  33. package/es/cascader/cascader-panel.d.ts +7 -7
  34. package/es/cascader/cascader.d.ts +33 -33
  35. package/es/cascader/index.d.ts +85 -85
  36. package/es/checkbox/checkbox-group.d.ts +2 -2
  37. package/es/checkbox/checkbox.d.ts +6 -6
  38. package/es/checkbox/index.d.ts +14 -14
  39. package/es/collapse/collapse-item.d.ts +3 -3
  40. package/es/collapse/index.d.ts +3 -3
  41. package/es/color-picker/color-picker.d.ts +4 -4
  42. package/es/color-picker/index.d.ts +9 -9
  43. package/es/comment/comment.d.ts +2 -2
  44. package/es/comment/index.d.ts +3 -3
  45. package/es/config-provider/config-provider.d.ts +3 -3
  46. package/es/config-provider/index.d.ts +6 -6
  47. package/es/date-picker/index.d.ts +66 -66
  48. package/es/date-picker/panels/date/index.d.ts +8 -8
  49. package/es/date-picker/panels/footer.d.ts +5 -5
  50. package/es/date-picker/panels/shortcuts.d.ts +5 -5
  51. package/es/date-picker/panels/week/index.d.ts +8 -8
  52. package/es/date-picker/picker-panel.d.ts +26 -26
  53. package/es/date-picker/picker.d.ts +61 -61
  54. package/es/date-picker/range-picker-panel.d.ts +27 -27
  55. package/es/date-picker/range-picker.d.ts +66 -66
  56. package/es/descriptions/descriptions.d.ts +4 -4
  57. package/es/descriptions/index.d.ts +9 -9
  58. package/es/drawer/drawer.d.ts +33 -9
  59. package/es/drawer/drawer.js +61 -6
  60. package/es/drawer/index.d.ts +64 -19
  61. package/es/drawer/style/index.css +10 -0
  62. package/es/drawer/style/index.less +12 -0
  63. package/es/dropdown/dropdown-button.d.ts +26 -26
  64. package/es/dropdown/dropdown-option.d.ts +2 -2
  65. package/es/dropdown/dropdown-panel.d.ts +6 -6
  66. package/es/dropdown/dropdown-submenu.d.ts +21 -21
  67. package/es/dropdown/dropdown.d.ts +18 -18
  68. package/es/dropdown/index.d.ts +85 -85
  69. package/es/form/form-item-label.d.ts +28 -28
  70. package/es/form/form-item.d.ts +35 -35
  71. package/es/form/form.d.ts +2 -2
  72. package/es/form/index.d.ts +38 -38
  73. package/es/image/preview-action.d.ts +27 -27
  74. package/es/image/preview-toolbar.d.ts +27 -27
  75. package/es/index.css +39 -8
  76. package/es/input/index.d.ts +22 -22
  77. package/es/input/input-password.d.ts +8 -8
  78. package/es/input/input-search.d.ts +2 -2
  79. package/es/input/input.d.ts +5 -5
  80. package/es/input-number/index.d.ts +18 -18
  81. package/es/input-number/input-number.d.ts +8 -8
  82. package/es/input-tag/index.d.ts +30 -30
  83. package/es/input-tag/input-tag.d.ts +11 -11
  84. package/es/list/index.d.ts +12 -12
  85. package/es/list/list.d.ts +5 -5
  86. package/es/mention/index.d.ts +15 -15
  87. package/es/mention/mention.d.ts +5 -5
  88. package/es/menu/base-menu.d.ts +1 -1
  89. package/es/menu/item.d.ts +1 -1
  90. package/es/menu/menu.d.ts +1 -1
  91. package/es/menu/sub-menu-pop.d.ts +15 -15
  92. package/es/message/message.d.ts +6 -6
  93. package/es/modal/index.d.ts +49 -19
  94. package/es/modal/modal.d.ts +24 -9
  95. package/es/modal/modal.js +23 -6
  96. package/es/modal/modal.vue_vue_type_script_lang.js +26 -2
  97. package/es/modal/style/index.css +7 -1
  98. package/es/modal/style/index.less +8 -1
  99. package/es/notification/notification.d.ts +4 -4
  100. package/es/page-header/index.d.ts +6 -6
  101. package/es/page-header/page-header.d.ts +3 -3
  102. package/es/pagination/index.d.ts +3 -3
  103. package/es/pagination/page-jumper.d.ts +18 -18
  104. package/es/pagination/page-options.d.ts +85 -85
  105. package/es/pagination/pagination.d.ts +2 -2
  106. package/es/popconfirm/index.d.ts +37 -37
  107. package/es/popconfirm/popconfirm.d.ts +18 -18
  108. package/es/popover/index.d.ts +24 -24
  109. package/es/popover/popover.d.ts +12 -12
  110. package/es/progress/circle.d.ts +5 -5
  111. package/es/progress/index.d.ts +36 -36
  112. package/es/progress/line.d.ts +5 -5
  113. package/es/progress/progress.d.ts +19 -19
  114. package/es/progress/steps.d.ts +2 -2
  115. package/es/radio/index.d.ts +16 -16
  116. package/es/radio/radio-group.d.ts +4 -4
  117. package/es/radio/radio.d.ts +5 -5
  118. package/es/rate/index.d.ts +9 -9
  119. package/es/rate/rate.d.ts +3 -3
  120. package/es/scrollbar/index.d.ts +6 -6
  121. package/es/scrollbar/scrollbar.d.ts +3 -3
  122. package/es/select/index.d.ts +85 -85
  123. package/es/select/option.d.ts +16 -16
  124. package/es/select/select-dropdown.d.ts +7 -7
  125. package/es/select/select.d.ts +30 -30
  126. package/es/skeleton/index.d.ts +3 -3
  127. package/es/skeleton/skeleton.d.ts +1 -1
  128. package/es/slider/index.d.ts +96 -96
  129. package/es/slider/slider-button.d.ts +27 -27
  130. package/es/slider/slider-input.d.ts +18 -18
  131. package/es/slider/slider.d.ts +47 -47
  132. package/es/space/index.d.ts +6 -6
  133. package/es/space/space.d.ts +3 -3
  134. package/es/split/index.d.ts +6 -6
  135. package/es/split/split.d.ts +2 -2
  136. package/es/statistic/countdown.d.ts +1 -1
  137. package/es/statistic/index.d.ts +4 -4
  138. package/es/statistic/statistic.d.ts +1 -1
  139. package/es/steps/index.d.ts +9 -9
  140. package/es/steps/step.d.ts +3 -3
  141. package/es/steps/steps.d.ts +3 -3
  142. package/es/switch/index.d.ts +15 -15
  143. package/es/switch/switch.d.ts +9 -9
  144. package/es/table/context.d.ts +3 -0
  145. package/es/table/hooks/use-row-selection.js +5 -3
  146. package/es/table/index.d.ts +24 -24
  147. package/es/table/interface.d.ts +1 -1
  148. package/es/table/style/index.css +22 -7
  149. package/es/table/style/index.less +25 -8
  150. package/es/table/table-column.d.ts +2 -2
  151. package/es/table/table-operation-td.d.ts +30 -30
  152. package/es/table/table-operation-td.js +6 -6
  153. package/es/table/table-operation-th.js +19 -7
  154. package/es/table/table-td.d.ts +1 -1
  155. package/es/table/table-td.js +2 -2
  156. package/es/table/table.d.ts +11 -11
  157. package/es/table/table.js +184 -34
  158. package/es/table/utils.d.ts +1 -1
  159. package/es/table/utils.js +9 -5
  160. package/es/tabs/index.d.ts +9 -9
  161. package/es/tabs/tabs-nav.d.ts +1 -1
  162. package/es/tabs/tabs-tab.d.ts +4 -4
  163. package/es/tabs/tabs.d.ts +4 -4
  164. package/es/tag/index.d.ts +12 -12
  165. package/es/tag/tag.d.ts +6 -6
  166. package/es/textarea/index.d.ts +15 -15
  167. package/es/textarea/textarea.d.ts +6 -6
  168. package/es/time-picker/index.d.ts +113 -113
  169. package/es/time-picker/panel.d.ts +8 -8
  170. package/es/time-picker/range-panel.d.ts +8 -8
  171. package/es/time-picker/time-picker.d.ts +54 -54
  172. package/es/timeline/index.d.ts +3 -3
  173. package/es/timeline/timeline.d.ts +2 -2
  174. package/es/tooltip/index.d.ts +27 -27
  175. package/es/tooltip/tooltip.d.ts +13 -13
  176. package/es/transfer/index.d.ts +90 -90
  177. package/es/transfer/transfer-view.d.ts +37 -37
  178. package/es/transfer/transfer.d.ts +44 -44
  179. package/es/tree/base-node.d.ts +14 -14
  180. package/es/tree/index.d.ts +13 -13
  181. package/es/tree/transition-node-list.d.ts +14 -14
  182. package/es/tree/tree.d.ts +6 -6
  183. package/es/tree-select/index.d.ts +83 -83
  184. package/es/tree-select/panel.d.ts +13 -13
  185. package/es/tree-select/tree-select.d.ts +39 -39
  186. package/es/trigger/index.d.ts +12 -12
  187. package/es/trigger/trigger.d.ts +7 -7
  188. package/es/typography/base.d.ts +2 -2
  189. package/es/typography/edit-content.d.ts +67 -67
  190. package/es/typography/index.d.ts +3 -3
  191. package/es/typography/operations.d.ts +27 -27
  192. package/es/typography/title.d.ts +3 -3
  193. package/es/upload/index.d.ts +6 -6
  194. package/es/upload/upload.d.ts +2 -2
  195. package/es/verification-code/index.d.ts +12 -12
  196. package/es/verification-code/verification-code.d.ts +5 -5
  197. package/json/vetur-attributes.json +2116 -2116
  198. package/json/vetur-tags.json +757 -757
  199. package/json/web-types.json +4117 -4117
  200. package/lib/_utils/array.js +18 -1
  201. package/lib/drawer/drawer.js +63 -8
  202. package/lib/drawer/style/index.css +10 -0
  203. package/lib/drawer/style/index.less +12 -0
  204. package/lib/index.css +39 -8
  205. package/lib/modal/modal.js +23 -6
  206. package/lib/modal/modal.vue_vue_type_script_lang.js +36 -12
  207. package/lib/modal/style/index.css +7 -1
  208. package/lib/modal/style/index.less +8 -1
  209. package/lib/table/hooks/use-row-selection.js +5 -3
  210. package/lib/table/style/index.css +22 -7
  211. package/lib/table/style/index.less +25 -8
  212. package/lib/table/table-operation-td.js +6 -6
  213. package/lib/table/table-operation-th.js +19 -7
  214. package/lib/table/table-td.js +2 -2
  215. package/lib/table/table.js +183 -33
  216. package/lib/table/utils.js +9 -5
  217. package/package.json +25 -24
  218. package/LICENSE +0 -21
package/es/table/table.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, inject, toRefs, computed, ref, reactive, watch, watchEffect, provide, onMounted, createVNode, Fragment, mergeProps, isVNode } from "vue";
1
+ import { defineComponent, inject, toRefs, computed, ref, reactive, watch, watchEffect, provide, nextTick, onMounted, createVNode, mergeProps, Fragment, isVNode } from "vue";
2
2
  import { getPrefixCls } from "../_utils/global-config.js";
3
3
  import { isObject, isFunction, isNumber, isString, isArray, isUndefined, isNull } from "../_utils/is.js";
4
4
  import { debounce } from "../_utils/debounce.js";
@@ -279,7 +279,7 @@ var _Table = defineComponent({
279
279
  const {
280
280
  componentRef: virtualComRef,
281
281
  elementRef: virtualRef
282
- } = useComponentRef("viewportRef");
282
+ } = useComponentRef("containerRef");
283
283
  const {
284
284
  componentRef: theadComRef,
285
285
  elementRef: theadRef
@@ -475,6 +475,9 @@ var _Table = defineComponent({
475
475
  currentAllEnabledRowKeys,
476
476
  emit
477
477
  });
478
+ const currentAllEnabledRowKeySet = computed(() => new Set(currentAllEnabledRowKeys.value));
479
+ const currentSelectedRowKeySet = computed(() => new Set(currentSelectedRowKeys.value));
480
+ const selectedRowKeySet = computed(() => new Set(selectedRowKeys.value));
478
481
  const {
479
482
  expandedRowKeys,
480
483
  handleExpand,
@@ -530,18 +533,27 @@ var _Table = defineComponent({
530
533
  expand: _record.expand,
531
534
  isLeaf: _record.isLeaf
532
535
  };
533
- if (_record.children) {
534
- record.isLeaf = false;
535
- record.children = travel(_record.children);
536
+ const recordChildren = _record.children;
537
+ if (Array.isArray(recordChildren)) {
538
+ if (recordChildren.length > 0) {
539
+ record.isLeaf = false;
540
+ record.children = travel(recordChildren);
541
+ } else if (showEmptyTree.value) {
542
+ record.isLeaf = false;
543
+ record.children = [];
544
+ } else {
545
+ record.isLeaf = true;
546
+ }
536
547
  } else if (props.loadMore && !_record.isLeaf) {
537
548
  record.isLeaf = false;
538
- if (lazyLoadData[record.key]) {
539
- record.children = travel(lazyLoadData[record.key]);
549
+ const lazyChildren = lazyLoadData[record.key];
550
+ if (lazyChildren) {
551
+ record.children = travel(lazyChildren);
540
552
  }
541
553
  } else {
542
554
  record.isLeaf = true;
543
555
  }
544
- record.hasSubtree = Boolean(record.children ? props.hideExpandButtonOnEmpty ? record.children.length > 0 : true : props.loadMore && !record.isLeaf);
556
+ record.hasSubtree = Boolean(record.children ? props.hideExpandButtonOnEmpty ? record.children.length > 0 : showEmptyTree.value || record.children.length > 0 : props.loadMore && !record.isLeaf);
545
557
  result.push(record);
546
558
  }
547
559
  return result;
@@ -859,7 +871,10 @@ var _Table = defineComponent({
859
871
  resizingColumn,
860
872
  checkStrictly,
861
873
  currentAllEnabledRowKeys,
874
+ currentAllEnabledRowKeySet,
862
875
  currentSelectedRowKeys,
876
+ currentSelectedRowKeySet,
877
+ selectedRowKeySet,
863
878
  addColumn,
864
879
  removeColumn,
865
880
  onSelectAll: handleSelectAll,
@@ -879,7 +894,8 @@ var _Table = defineComponent({
879
894
  [`${prefixCls}-dragging`]: dragState.dragging,
880
895
  [`${prefixCls}-type-selection`]: Boolean(props.rowSelection),
881
896
  [`${prefixCls}-empty`]: props.data && flattenData.value.length === 0,
882
- [`${prefixCls}-layout-fixed`]: props.tableLayoutFixed || isScroll.value.x || splitTable.value || hasEllipsis.value
897
+ [`${prefixCls}-layout-fixed`]: props.tableLayoutFixed || isScroll.value.x || splitTable.value || hasEllipsis.value,
898
+ [`${prefixCls}-virtualized`]: Boolean(props.virtualListProps)
883
899
  }]);
884
900
  const paginationCls = computed(() => [`${prefixCls}-pagination`, {
885
901
  [`${prefixCls}-pagination-left`]: props.pagePosition === "tl" || props.pagePosition === "bl",
@@ -906,6 +922,13 @@ var _Table = defineComponent({
906
922
  }
907
923
  thWidth.value = width;
908
924
  };
925
+ watch(columnWidth, () => {
926
+ if (isVirtualList.value) {
927
+ nextTick(getThWidth);
928
+ }
929
+ }, {
930
+ deep: true
931
+ });
909
932
  const hasScrollBar = ref(false);
910
933
  const isTbodyHasScrollBar = () => {
911
934
  if (tbodyRef.value) {
@@ -978,11 +1001,16 @@ var _Table = defineComponent({
978
1001
  columns: allColumns
979
1002
  });
980
1003
  const getVirtualColumnStyle = (name) => {
981
- if (!isVirtualList.value || !name || !thWidth.value[name]) {
1004
+ var _a;
1005
+ if (!isVirtualList.value || !name) {
1006
+ return void 0;
1007
+ }
1008
+ const width = (_a = columnWidth[name]) != null ? _a : thWidth.value[name];
1009
+ if (!width) {
982
1010
  return void 0;
983
1011
  }
984
1012
  return {
985
- width: `${thWidth.value[name]}px`
1013
+ width: `${width}px`
986
1014
  };
987
1015
  };
988
1016
  const renderSummaryRow = (record, rowIndex) => {
@@ -1098,16 +1126,14 @@ var _Table = defineComponent({
1098
1126
  }
1099
1127
  return null;
1100
1128
  };
1101
- const renderRecord = (record, rowIndex, {
1129
+ const renderRecordRow = (record, rowIndex, {
1102
1130
  indentSize = 0,
1103
1131
  indexPath,
1104
1132
  allowDrag = true
1105
1133
  } = {}) => {
1106
- var _a;
1107
1134
  const currentKey = record.key;
1108
1135
  const currentPath = (indexPath != null ? indexPath : []).concat(rowIndex);
1109
1136
  const expandContent = renderExpandContent(record);
1110
- const showExpand = expandedRowKeys.value.includes(currentKey);
1111
1137
  const isDragTarget = dragState.sourceKey === record.key;
1112
1138
  const dragSourceEvent = dragType.value ? {
1113
1139
  draggable: allowDrag,
@@ -1140,7 +1166,7 @@ var _Table = defineComponent({
1140
1166
  handleDrop(ev);
1141
1167
  }
1142
1168
  } : {};
1143
- return createVNode(Fragment, null, [createVNode(Tr, mergeProps({
1169
+ return createVNode(Tr, mergeProps({
1144
1170
  "key": currentKey,
1145
1171
  "class": [{
1146
1172
  [`${prefixCls}-tr-draggable`]: dragType.value === "row",
@@ -1148,15 +1174,15 @@ var _Table = defineComponent({
1148
1174
  }, isFunction(props.rowClass) ? props.rowClass(record.raw, rowIndex) : props.rowClass],
1149
1175
  "rowIndex": rowIndex,
1150
1176
  "record": record,
1151
- "checked": props.rowSelection && ((_a = selectedRowKeys.value) == null ? void 0 : _a.includes(currentKey)),
1177
+ "checked": props.rowSelection && selectedRowKeySet.value.has(currentKey),
1152
1178
  "onClick": (ev) => handleRowClick(record, ev),
1153
1179
  "onDblclick": (ev) => handleRowDblclick(record, ev),
1154
1180
  "onContextmenu": (ev) => handleRowContextMenu(record, ev)
1155
1181
  }, dragType.value === "row" ? dragSourceEvent : {}, dragTargetEvent), {
1156
1182
  default: () => [operations.value.map((operation, index) => {
1157
- var _a2;
1183
+ var _a;
1158
1184
  const cellId = `${rowIndex}-${index}-${record.key}`;
1159
- const [rowspan, colspan] = props.spanAll ? (_a2 = tableSpan.value[cellId]) != null ? _a2 : [1, 1] : [1, 1];
1185
+ const [rowspan, colspan] = props.spanAll ? (_a = tableSpan.value[cellId]) != null ? _a : [1, 1] : [1, 1];
1160
1186
  if (props.spanAll && removedCells.value.includes(cellId)) {
1161
1187
  return null;
1162
1188
  }
@@ -1176,9 +1202,9 @@ var _Table = defineComponent({
1176
1202
  "drag-handle-icon": slots["drag-handle-icon"]
1177
1203
  });
1178
1204
  }), dataColumns.value.map((column, index) => {
1179
- var _a2;
1205
+ var _a;
1180
1206
  const cellId = `${rowIndex}-${props.spanAll ? operations.value.length + index : index}-${record.key}`;
1181
- const [rowspan, colspan] = (_a2 = tableSpan.value[cellId]) != null ? _a2 : [1, 1];
1207
+ const [rowspan, colspan] = (_a = tableSpan.value[cellId]) != null ? _a : [1, 1];
1182
1208
  if (removedCells.value.includes(cellId)) {
1183
1209
  return null;
1184
1210
  }
@@ -1209,13 +1235,123 @@ var _Table = defineComponent({
1209
1235
  });
1210
1236
  })],
1211
1237
  tr: slots.tr
1238
+ });
1239
+ };
1240
+ const renderRecord = (record, rowIndex, {
1241
+ indentSize = 0,
1242
+ indexPath,
1243
+ allowDrag = true
1244
+ } = {}) => {
1245
+ const currentKey = record.key;
1246
+ const currentPath = (indexPath != null ? indexPath : []).concat(rowIndex);
1247
+ const expandContent = renderExpandContent(record);
1248
+ const showExpand = expandedRowKeys.value.includes(currentKey);
1249
+ return createVNode(Fragment, null, [renderRecordRow(record, rowIndex, {
1250
+ indentSize,
1251
+ indexPath,
1252
+ allowDrag
1212
1253
  }), showExpand && renderExpand(record, {
1213
1254
  indentSize: indentSize + props.indentSize,
1214
1255
  indexPath: currentPath,
1215
- allowDrag: allowDrag && !isDragTarget,
1256
+ allowDrag,
1216
1257
  expandContent
1217
1258
  })]);
1218
1259
  };
1260
+ const renderVirtualEmptyRow = (key) => {
1261
+ return createVNode(Tr, {
1262
+ "key": key,
1263
+ "empty": true
1264
+ }, {
1265
+ default: () => [createVNode(Td, {
1266
+ "colSpan": dataColumns.value.length + operations.value.length
1267
+ }, {
1268
+ default: () => {
1269
+ var _a, _b, _c, _d, _e;
1270
+ return [(_e = (_d = (_a = slots.empty) == null ? void 0 : _a.call(slots)) != null ? _d : (_c = configCtx == null ? void 0 : (_b = configCtx.slots).empty) == null ? void 0 : _c.call(_b, {
1271
+ component: "table"
1272
+ })) != null ? _e : createVNode(Empty, null, null)];
1273
+ }
1274
+ })]
1275
+ });
1276
+ };
1277
+ const virtualListData = computed(() => {
1278
+ if (!isVirtualList.value || flattenData.value.length === 0) {
1279
+ return [];
1280
+ }
1281
+ const hasSubData = flattenData.value.some((record) => Boolean(record.hasSubtree));
1282
+ const baseIndentSize = hasSubData ? 20 : 0;
1283
+ const expandedKeySet = new Set(expandedRowKeys.value);
1284
+ const list = [];
1285
+ let recordIndex = 0;
1286
+ const travel = (data, indentSize, indexPath) => {
1287
+ data.forEach((record, index) => {
1288
+ var _a;
1289
+ const currentPath = indexPath.concat(index);
1290
+ list.push({
1291
+ type: "record",
1292
+ _key: `r-${String(record.key)}`,
1293
+ record,
1294
+ rowIndex: recordIndex,
1295
+ indentSize,
1296
+ indexPath: currentPath
1297
+ });
1298
+ recordIndex += 1;
1299
+ if (!expandedKeySet.has(record.key))
1300
+ return;
1301
+ if (record.hasSubtree) {
1302
+ if (((_a = record.children) == null ? void 0 : _a.length) === 0 && showEmptyTree.value) {
1303
+ list.push({
1304
+ type: "empty-subtree",
1305
+ _key: `empty-subtree-${String(record.key)}`
1306
+ });
1307
+ return;
1308
+ }
1309
+ if (record.children && record.children.length > 0) {
1310
+ travel(record.children, indentSize + props.indentSize, currentPath);
1311
+ }
1312
+ return;
1313
+ }
1314
+ const expandContent = renderExpandContent(record);
1315
+ if (expandContent) {
1316
+ list.push({
1317
+ type: "expand",
1318
+ _key: `expand-${String(record.key)}`,
1319
+ record
1320
+ });
1321
+ }
1322
+ });
1323
+ };
1324
+ travel(flattenData.value, baseIndentSize, []);
1325
+ return list;
1326
+ });
1327
+ const renderVirtualItem = (item) => {
1328
+ if (item.type === "record") {
1329
+ return renderRecordRow(item.record, item.rowIndex, {
1330
+ indentSize: item.indentSize,
1331
+ indexPath: item.indexPath
1332
+ });
1333
+ }
1334
+ if (item.type === "empty-subtree") {
1335
+ return renderVirtualEmptyRow(item._key);
1336
+ }
1337
+ const expandContent = renderExpandContent(item.record);
1338
+ if (!expandContent) {
1339
+ return null;
1340
+ }
1341
+ const scrollContainer = containerElement.value;
1342
+ return createVNode(Tr, {
1343
+ "key": `${item.record.key}-expand`,
1344
+ "expand": true
1345
+ }, {
1346
+ default: () => [createVNode(Td, {
1347
+ "isFixedExpand": hasLeftFixedColumn.value || hasRightFixedColumn.value,
1348
+ "containerWidth": scrollContainer == null ? void 0 : scrollContainer.clientWidth,
1349
+ "colSpan": dataColumns.value.length + operations.value.length
1350
+ }, _isSlot(expandContent) ? expandContent : {
1351
+ default: () => [expandContent]
1352
+ })]
1353
+ });
1354
+ };
1219
1355
  const renderBody = () => {
1220
1356
  const hasSubData = flattenData.value.some((record) => Boolean(record.hasSubtree));
1221
1357
  return createVNode(Tbody, null, {
@@ -1244,7 +1380,7 @@ var _Table = defineComponent({
1244
1380
  "rowSpan": groupColumns.value.length
1245
1381
  }, null);
1246
1382
  }), row.map((column, index2) => {
1247
- const resizable = props.columnResizable && Boolean(column.dataIndex) && index2 < row.length - 1;
1383
+ const resizable = props.columnResizable && Boolean(column.dataIndex) && index2 < row.length - 1 && !column.fixed;
1248
1384
  return createVNode(Th, {
1249
1385
  "key": `th-${index2}`,
1250
1386
  "ref": (ins) => {
@@ -1264,6 +1400,24 @@ var _Table = defineComponent({
1264
1400
  }))],
1265
1401
  thead: slots.thead
1266
1402
  });
1403
+ const VirtualListTable = defineComponent({
1404
+ setup(_props, {
1405
+ attrs,
1406
+ slots: slots2
1407
+ }) {
1408
+ return () => {
1409
+ var _a;
1410
+ return createVNode("table", mergeProps(attrs, {
1411
+ "cellpadding": 0,
1412
+ "cellspacing": 0
1413
+ }), [createVNode(ColGroup, {
1414
+ "dataColumns": dataColumns.value,
1415
+ "operations": operations.value,
1416
+ "columnWidth": columnWidth
1417
+ }, null), (_a = slots2.default) == null ? void 0 : _a.call(slots2)]);
1418
+ };
1419
+ }
1420
+ });
1267
1421
  const renderContent = () => {
1268
1422
  var _a, _b;
1269
1423
  if (splitTable.value) {
@@ -1307,17 +1461,14 @@ var _Table = defineComponent({
1307
1461
  "onResize": handleTbodyResize
1308
1462
  }, {
1309
1463
  default: () => {
1310
- var _a2, _b2;
1464
+ var _a2, _b2, _c, _d;
1311
1465
  return [isVirtualList.value && flattenData.value.length ? createVNode(VirtualList, mergeProps({
1312
- "ref": (ins) => {
1313
- if (ins == null ? void 0 : ins.$el)
1314
- tbodyRef.value = ins.$el;
1315
- },
1466
+ "ref": virtualComRef.value,
1316
1467
  "class": `${prefixCls}-body`,
1317
- "data": flattenData.value,
1468
+ "data": virtualListData.value,
1318
1469
  "itemKey": "_key",
1319
1470
  "component": {
1320
- list: "table",
1471
+ list: VirtualListTable,
1321
1472
  content: "tbody"
1322
1473
  },
1323
1474
  "listAttrs": {
@@ -1325,19 +1476,18 @@ var _Table = defineComponent({
1325
1476
  style: contentStyle.value
1326
1477
  },
1327
1478
  "paddingPosition": "list",
1328
- "height": "auto"
1479
+ "height": (_b2 = (_a2 = props.scroll) == null ? void 0 : _a2.y) != null ? _b2 : "auto"
1329
1480
  }, props.virtualListProps, {
1330
1481
  "onScroll": onTbodyScroll
1331
1482
  }), {
1332
1483
  item: ({
1333
- item,
1334
- index
1335
- }) => renderRecord(item, index)
1484
+ item
1485
+ }) => renderVirtualItem(item)
1336
1486
  }) : createVNode(Component, mergeProps({
1337
1487
  "ref": tbodyComRef,
1338
1488
  "class": `${prefixCls}-body`,
1339
1489
  "style": {
1340
- maxHeight: isNumber((_a2 = props.scroll) == null ? void 0 : _a2.y) ? `${(_b2 = props.scroll) == null ? void 0 : _b2.y}px` : "100%"
1490
+ maxHeight: isNumber((_c = props.scroll) == null ? void 0 : _c.y) ? `${(_d = props.scroll) == null ? void 0 : _d.y}px` : "100%"
1341
1491
  }
1342
1492
  }, scrollbar.value ? {
1343
1493
  outerStyle: {
@@ -28,7 +28,7 @@ export declare function mapArrayWithChildren<T extends Array<{
28
28
  }>>(arr: T): T;
29
29
  export declare function mapRawTableData<T extends TableDataWithRaw[]>(arr: T): TableDataWithRaw['raw'][];
30
30
  export declare const getLeafKeys: (record: TableDataWithRaw) => BaseType[];
31
- export declare const getSelectionStatus: (selectedRowKeys: BaseType[], leafKeys: BaseType[]) => {
31
+ export declare const getSelectionStatus: (selectedRowKeys: BaseType[] | Set<BaseType>, leafKeys: BaseType[]) => {
32
32
  checked: boolean;
33
33
  indeterminate: boolean;
34
34
  };
package/es/table/utils.js CHANGED
@@ -259,11 +259,15 @@ const getLeafKeys = (record) => {
259
259
  const getSelectionStatus = (selectedRowKeys, leafKeys) => {
260
260
  let checked = false;
261
261
  let indeterminate = false;
262
- const selectedLeafKeys = leafKeys.filter(
263
- (key) => selectedRowKeys.includes(key)
264
- );
265
- if (selectedLeafKeys.length > 0) {
266
- if (selectedLeafKeys.length >= leafKeys.length) {
262
+ const selectedSet = selectedRowKeys instanceof Set ? selectedRowKeys : new Set(selectedRowKeys);
263
+ let selectedLeafCount = 0;
264
+ for (const key of leafKeys) {
265
+ if (selectedSet.has(key)) {
266
+ selectedLeafCount += 1;
267
+ }
268
+ }
269
+ if (selectedLeafCount > 0) {
270
+ if (selectedLeafCount >= leafKeys.length) {
267
271
  checked = true;
268
272
  } else {
269
273
  indeterminate = true;
@@ -17,7 +17,7 @@ declare const Tabs: {
17
17
  default: string;
18
18
  };
19
19
  size: {
20
- type: import("vue").PropType<"mini" | "medium" | "large" | "small">;
20
+ type: import("vue").PropType<"mini" | "small" | "medium" | "large">;
21
21
  };
22
22
  type: {
23
23
  type: import("vue").PropType<import("./interface").TabsType>;
@@ -84,12 +84,12 @@ declare const Tabs: {
84
84
  add: (ev: Event) => true;
85
85
  delete: (key: string | number, ev: Event) => true;
86
86
  }, import("vue").PublicProps, {
87
+ type: import("./interface").TabsType;
87
88
  trigger: import("./interface").TabTriggerEvent;
88
89
  position: import("./interface").TabsPosition;
89
90
  justify: boolean;
90
- type: import("./interface").TabsType;
91
- direction: "horizontal" | "vertical";
92
91
  animation: boolean;
92
+ direction: "horizontal" | "vertical";
93
93
  activeKey: string | number;
94
94
  defaultActiveKey: string | number;
95
95
  destroyOnHide: boolean;
@@ -121,7 +121,7 @@ declare const Tabs: {
121
121
  default: string;
122
122
  };
123
123
  size: {
124
- type: import("vue").PropType<"mini" | "medium" | "large" | "small">;
124
+ type: import("vue").PropType<"mini" | "small" | "medium" | "large">;
125
125
  };
126
126
  type: {
127
127
  type: import("vue").PropType<import("./interface").TabsType>;
@@ -182,12 +182,12 @@ declare const Tabs: {
182
182
  "onUpdate:activeKey"?: ((key: string | number) => any) | undefined;
183
183
  onTabClick?: ((key: string | number, ev: Event) => any) | undefined;
184
184
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
185
+ type: import("./interface").TabsType;
185
186
  trigger: import("./interface").TabTriggerEvent;
186
187
  position: import("./interface").TabsPosition;
187
188
  justify: boolean;
188
- type: import("./interface").TabsType;
189
- direction: "horizontal" | "vertical";
190
189
  animation: boolean;
190
+ direction: "horizontal" | "vertical";
191
191
  activeKey: string | number;
192
192
  defaultActiveKey: string | number;
193
193
  destroyOnHide: boolean;
@@ -216,7 +216,7 @@ declare const Tabs: {
216
216
  default: string;
217
217
  };
218
218
  size: {
219
- type: import("vue").PropType<"mini" | "medium" | "large" | "small">;
219
+ type: import("vue").PropType<"mini" | "small" | "medium" | "large">;
220
220
  };
221
221
  type: {
222
222
  type: import("vue").PropType<import("./interface").TabsType>;
@@ -283,12 +283,12 @@ declare const Tabs: {
283
283
  add: (ev: Event) => true;
284
284
  delete: (key: string | number, ev: Event) => true;
285
285
  }, string, {
286
+ type: import("./interface").TabsType;
286
287
  trigger: import("./interface").TabTriggerEvent;
287
288
  position: import("./interface").TabsPosition;
288
289
  justify: boolean;
289
- type: import("./interface").TabsType;
290
- direction: "horizontal" | "vertical";
291
290
  animation: boolean;
291
+ direction: "horizontal" | "vertical";
292
292
  activeKey: string | number;
293
293
  defaultActiveKey: string | number;
294
294
  destroyOnHide: boolean;
@@ -48,7 +48,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
48
48
  type: PropType<ScrollPosition>;
49
49
  default: string;
50
50
  };
51
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "add" | "delete")[], "click" | "delete" | "add", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
51
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "add" | "delete")[], "delete" | "add" | "click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
52
52
  tabs: {
53
53
  type: PropType<TabData[]>;
54
54
  required: true;
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
22
22
  onKeydown: (ev: KeyboardEvent) => void;
23
23
  }>;
24
24
  handleDelete: (e: Event) => void;
25
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "delete")[], "click" | "delete", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "delete")[], "delete" | "click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
26
  tab: {
27
27
  type: PropType<TabData>;
28
28
  required: true;
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
41
41
  type: StringConstructor;
42
42
  };
43
43
  size: {
44
- type: PropType<"mini" | "medium" | "large" | "small">;
44
+ type: PropType<"mini" | "small" | "medium" | "large">;
45
45
  default: string;
46
46
  };
47
47
  disabled: {
@@ -55,7 +55,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
55
55
  type: StringConstructor;
56
56
  };
57
57
  size: {
58
- type: PropType<"mini" | "medium" | "large" | "small">;
58
+ type: PropType<"mini" | "small" | "medium" | "large">;
59
59
  default: string;
60
60
  };
61
61
  disabled: {
@@ -63,8 +63,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
63
63
  default: boolean;
64
64
  };
65
65
  }>> & Readonly<{}>, {
66
+ size: "mini" | "small" | "medium" | "large";
66
67
  disabled: boolean;
67
- size: "mini" | "medium" | "large" | "small";
68
68
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
69
69
  IconClose: any;
70
70
  }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/es/tabs/tabs.d.ts CHANGED
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
14
14
  default: string;
15
15
  };
16
16
  size: {
17
- type: PropType<"mini" | "medium" | "large" | "small">;
17
+ type: PropType<"mini" | "small" | "medium" | "large">;
18
18
  };
19
19
  type: {
20
20
  type: PropType<TabsType>;
@@ -88,7 +88,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
88
88
  default: string;
89
89
  };
90
90
  size: {
91
- type: PropType<"mini" | "medium" | "large" | "small">;
91
+ type: PropType<"mini" | "small" | "medium" | "large">;
92
92
  };
93
93
  type: {
94
94
  type: PropType<TabsType>;
@@ -149,12 +149,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
149
149
  "onUpdate:activeKey"?: ((key: string | number) => any) | undefined;
150
150
  onTabClick?: ((key: string | number, ev: Event) => any) | undefined;
151
151
  }>, {
152
+ type: TabsType;
152
153
  trigger: TabTriggerEvent;
153
154
  position: TabsPosition;
154
155
  justify: boolean;
155
- type: TabsType;
156
- direction: "horizontal" | "vertical";
157
156
  animation: boolean;
157
+ direction: "horizontal" | "vertical";
158
158
  activeKey: string | number;
159
159
  defaultActiveKey: string | number;
160
160
  destroyOnHide: boolean;
package/es/tag/index.d.ts CHANGED
@@ -7,7 +7,7 @@ declare const Tag: {
7
7
  type: import("vue").PropType<string>;
8
8
  };
9
9
  size: {
10
- type: import("vue").PropType<"medium" | "large" | "small">;
10
+ type: import("vue").PropType<"small" | "medium" | "large">;
11
11
  };
12
12
  bordered: {
13
13
  type: BooleanConstructor;
@@ -71,17 +71,17 @@ declare const Tag: {
71
71
  loading: boolean;
72
72
  bordered: boolean;
73
73
  closable: boolean;
74
+ defaultChecked: boolean;
74
75
  defaultVisible: boolean;
75
76
  checked: boolean;
76
77
  checkable: boolean;
77
- defaultChecked: boolean;
78
78
  }, true, {}, {}, {
79
79
  IconHover: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
80
80
  prefix: {
81
81
  type: StringConstructor;
82
82
  };
83
83
  size: {
84
- type: import("vue").PropType<"mini" | "medium" | "large" | "small">;
84
+ type: import("vue").PropType<"mini" | "small" | "medium" | "large">;
85
85
  default: string;
86
86
  };
87
87
  disabled: {
@@ -95,7 +95,7 @@ declare const Tag: {
95
95
  type: StringConstructor;
96
96
  };
97
97
  size: {
98
- type: import("vue").PropType<"mini" | "medium" | "large" | "small">;
98
+ type: import("vue").PropType<"mini" | "small" | "medium" | "large">;
99
99
  default: string;
100
100
  };
101
101
  disabled: {
@@ -103,8 +103,8 @@ declare const Tag: {
103
103
  default: boolean;
104
104
  };
105
105
  }>> & Readonly<{}>, {
106
+ size: "mini" | "small" | "medium" | "large";
106
107
  disabled: boolean;
107
- size: "mini" | "medium" | "large" | "small";
108
108
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
109
109
  IconClose: any;
110
110
  IconLoading: any;
@@ -120,7 +120,7 @@ declare const Tag: {
120
120
  type: import("vue").PropType<string>;
121
121
  };
122
122
  size: {
123
- type: import("vue").PropType<"medium" | "large" | "small">;
123
+ type: import("vue").PropType<"small" | "medium" | "large">;
124
124
  };
125
125
  bordered: {
126
126
  type: BooleanConstructor;
@@ -179,10 +179,10 @@ declare const Tag: {
179
179
  loading: boolean;
180
180
  bordered: boolean;
181
181
  closable: boolean;
182
+ defaultChecked: boolean;
182
183
  defaultVisible: boolean;
183
184
  checked: boolean;
184
185
  checkable: boolean;
185
- defaultChecked: boolean;
186
186
  }>;
187
187
  __isFragment?: undefined;
188
188
  __isTeleport?: undefined;
@@ -192,7 +192,7 @@ declare const Tag: {
192
192
  type: import("vue").PropType<string>;
193
193
  };
194
194
  size: {
195
- type: import("vue").PropType<"medium" | "large" | "small">;
195
+ type: import("vue").PropType<"small" | "medium" | "large">;
196
196
  };
197
197
  bordered: {
198
198
  type: BooleanConstructor;
@@ -256,17 +256,17 @@ declare const Tag: {
256
256
  loading: boolean;
257
257
  bordered: boolean;
258
258
  closable: boolean;
259
+ defaultChecked: boolean;
259
260
  defaultVisible: boolean;
260
261
  checked: boolean;
261
262
  checkable: boolean;
262
- defaultChecked: boolean;
263
263
  }, {}, string, {}, {
264
264
  IconHover: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
265
265
  prefix: {
266
266
  type: StringConstructor;
267
267
  };
268
268
  size: {
269
- type: import("vue").PropType<"mini" | "medium" | "large" | "small">;
269
+ type: import("vue").PropType<"mini" | "small" | "medium" | "large">;
270
270
  default: string;
271
271
  };
272
272
  disabled: {
@@ -280,7 +280,7 @@ declare const Tag: {
280
280
  type: StringConstructor;
281
281
  };
282
282
  size: {
283
- type: import("vue").PropType<"mini" | "medium" | "large" | "small">;
283
+ type: import("vue").PropType<"mini" | "small" | "medium" | "large">;
284
284
  default: string;
285
285
  };
286
286
  disabled: {
@@ -288,8 +288,8 @@ declare const Tag: {
288
288
  default: boolean;
289
289
  };
290
290
  }>> & Readonly<{}>, {
291
+ size: "mini" | "small" | "medium" | "large";
291
292
  disabled: boolean;
292
- size: "mini" | "medium" | "large" | "small";
293
293
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
294
294
  IconClose: any;
295
295
  IconLoading: any;