@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.
- package/dist/arco-vue.js +891 -536
- package/dist/arco-vue.js.map +1 -1
- package/dist/arco-vue.min.js +1648 -1546
- package/dist/arco-vue.min.js.map +1 -1
- package/dist/arco.css +39 -8
- package/dist/arco.min.css +1 -1
- package/es/_components/icon-hover.d.ts +3 -3
- package/es/_components/input-label/input-label.d.ts +5 -5
- package/es/_components/picker/input-range.d.ts +10 -10
- package/es/_components/picker/input.d.ts +8 -8
- package/es/_components/select-view/select-view.d.ts +6 -6
- package/es/_components/virtual-list-v2/virtual-list.d.ts +2 -2
- package/es/_hooks/use-form-item.d.ts +2 -2
- package/es/_hooks/use-size.d.ts +3 -3
- package/es/_utils/array.d.ts +1 -1
- package/es/_utils/array.js +18 -1
- package/es/alert/alert.d.ts +6 -6
- package/es/alert/index.d.ts +12 -12
- package/es/anchor/anchor.d.ts +1 -1
- package/es/anchor/index.d.ts +3 -3
- package/es/auto-complete/auto-complete.d.ts +3 -3
- package/es/auto-complete/index.d.ts +9 -9
- package/es/avatar/avatar.d.ts +1 -1
- package/es/avatar/index.d.ts +3 -3
- package/es/button/button-group.d.ts +2 -2
- package/es/button/button.d.ts +2 -2
- package/es/button/index.d.ts +5 -5
- package/es/calendar/calendar.d.ts +1 -1
- package/es/calendar/index.d.ts +3 -3
- package/es/card/card.d.ts +2 -2
- package/es/card/index.d.ts +3 -3
- package/es/carousel/carousel-indicator.d.ts +1 -1
- package/es/cascader/cascader-panel.d.ts +7 -7
- package/es/cascader/cascader.d.ts +33 -33
- package/es/cascader/index.d.ts +85 -85
- package/es/checkbox/checkbox-group.d.ts +2 -2
- package/es/checkbox/checkbox.d.ts +6 -6
- package/es/checkbox/index.d.ts +14 -14
- package/es/collapse/collapse-item.d.ts +3 -3
- package/es/collapse/index.d.ts +3 -3
- package/es/color-picker/color-picker.d.ts +4 -4
- package/es/color-picker/index.d.ts +9 -9
- package/es/comment/comment.d.ts +2 -2
- package/es/comment/index.d.ts +3 -3
- package/es/config-provider/config-provider.d.ts +3 -3
- package/es/config-provider/index.d.ts +6 -6
- package/es/date-picker/index.d.ts +66 -66
- package/es/date-picker/panels/date/index.d.ts +8 -8
- package/es/date-picker/panels/footer.d.ts +5 -5
- package/es/date-picker/panels/shortcuts.d.ts +5 -5
- package/es/date-picker/panels/week/index.d.ts +8 -8
- package/es/date-picker/picker-panel.d.ts +26 -26
- package/es/date-picker/picker.d.ts +61 -61
- package/es/date-picker/range-picker-panel.d.ts +27 -27
- package/es/date-picker/range-picker.d.ts +66 -66
- package/es/descriptions/descriptions.d.ts +4 -4
- package/es/descriptions/index.d.ts +9 -9
- package/es/drawer/drawer.d.ts +33 -9
- package/es/drawer/drawer.js +61 -6
- package/es/drawer/index.d.ts +64 -19
- package/es/drawer/style/index.css +10 -0
- package/es/drawer/style/index.less +12 -0
- package/es/dropdown/dropdown-button.d.ts +26 -26
- package/es/dropdown/dropdown-option.d.ts +2 -2
- package/es/dropdown/dropdown-panel.d.ts +6 -6
- package/es/dropdown/dropdown-submenu.d.ts +21 -21
- package/es/dropdown/dropdown.d.ts +18 -18
- package/es/dropdown/index.d.ts +85 -85
- package/es/form/form-item-label.d.ts +28 -28
- package/es/form/form-item.d.ts +35 -35
- package/es/form/form.d.ts +2 -2
- package/es/form/index.d.ts +38 -38
- package/es/image/preview-action.d.ts +27 -27
- package/es/image/preview-toolbar.d.ts +27 -27
- package/es/index.css +39 -8
- package/es/input/index.d.ts +22 -22
- package/es/input/input-password.d.ts +8 -8
- package/es/input/input-search.d.ts +2 -2
- package/es/input/input.d.ts +5 -5
- package/es/input-number/index.d.ts +18 -18
- package/es/input-number/input-number.d.ts +8 -8
- package/es/input-tag/index.d.ts +30 -30
- package/es/input-tag/input-tag.d.ts +11 -11
- package/es/list/index.d.ts +12 -12
- package/es/list/list.d.ts +5 -5
- package/es/mention/index.d.ts +15 -15
- package/es/mention/mention.d.ts +5 -5
- package/es/menu/base-menu.d.ts +1 -1
- package/es/menu/item.d.ts +1 -1
- package/es/menu/menu.d.ts +1 -1
- package/es/menu/sub-menu-pop.d.ts +15 -15
- package/es/message/message.d.ts +6 -6
- package/es/modal/index.d.ts +49 -19
- package/es/modal/modal.d.ts +24 -9
- package/es/modal/modal.js +23 -6
- package/es/modal/modal.vue_vue_type_script_lang.js +26 -2
- package/es/modal/style/index.css +7 -1
- package/es/modal/style/index.less +8 -1
- package/es/notification/notification.d.ts +4 -4
- package/es/page-header/index.d.ts +6 -6
- package/es/page-header/page-header.d.ts +3 -3
- package/es/pagination/index.d.ts +3 -3
- package/es/pagination/page-jumper.d.ts +18 -18
- package/es/pagination/page-options.d.ts +85 -85
- package/es/pagination/pagination.d.ts +2 -2
- package/es/popconfirm/index.d.ts +37 -37
- package/es/popconfirm/popconfirm.d.ts +18 -18
- package/es/popover/index.d.ts +24 -24
- package/es/popover/popover.d.ts +12 -12
- package/es/progress/circle.d.ts +5 -5
- package/es/progress/index.d.ts +36 -36
- package/es/progress/line.d.ts +5 -5
- package/es/progress/progress.d.ts +19 -19
- package/es/progress/steps.d.ts +2 -2
- package/es/radio/index.d.ts +16 -16
- package/es/radio/radio-group.d.ts +4 -4
- package/es/radio/radio.d.ts +5 -5
- package/es/rate/index.d.ts +9 -9
- package/es/rate/rate.d.ts +3 -3
- package/es/scrollbar/index.d.ts +6 -6
- package/es/scrollbar/scrollbar.d.ts +3 -3
- package/es/select/index.d.ts +85 -85
- package/es/select/option.d.ts +16 -16
- package/es/select/select-dropdown.d.ts +7 -7
- package/es/select/select.d.ts +30 -30
- package/es/skeleton/index.d.ts +3 -3
- package/es/skeleton/skeleton.d.ts +1 -1
- package/es/slider/index.d.ts +96 -96
- package/es/slider/slider-button.d.ts +27 -27
- package/es/slider/slider-input.d.ts +18 -18
- package/es/slider/slider.d.ts +47 -47
- package/es/space/index.d.ts +6 -6
- package/es/space/space.d.ts +3 -3
- package/es/split/index.d.ts +6 -6
- package/es/split/split.d.ts +2 -2
- package/es/statistic/countdown.d.ts +1 -1
- package/es/statistic/index.d.ts +4 -4
- package/es/statistic/statistic.d.ts +1 -1
- package/es/steps/index.d.ts +9 -9
- package/es/steps/step.d.ts +3 -3
- package/es/steps/steps.d.ts +3 -3
- package/es/switch/index.d.ts +15 -15
- package/es/switch/switch.d.ts +9 -9
- package/es/table/context.d.ts +3 -0
- package/es/table/hooks/use-row-selection.js +5 -3
- package/es/table/index.d.ts +24 -24
- package/es/table/interface.d.ts +1 -1
- package/es/table/style/index.css +22 -7
- package/es/table/style/index.less +25 -8
- package/es/table/table-column.d.ts +2 -2
- package/es/table/table-operation-td.d.ts +30 -30
- package/es/table/table-operation-td.js +6 -6
- package/es/table/table-operation-th.js +19 -7
- package/es/table/table-td.d.ts +1 -1
- package/es/table/table-td.js +2 -2
- package/es/table/table.d.ts +11 -11
- package/es/table/table.js +184 -34
- package/es/table/utils.d.ts +1 -1
- package/es/table/utils.js +9 -5
- package/es/tabs/index.d.ts +9 -9
- package/es/tabs/tabs-nav.d.ts +1 -1
- package/es/tabs/tabs-tab.d.ts +4 -4
- package/es/tabs/tabs.d.ts +4 -4
- package/es/tag/index.d.ts +12 -12
- package/es/tag/tag.d.ts +6 -6
- package/es/textarea/index.d.ts +15 -15
- package/es/textarea/textarea.d.ts +6 -6
- package/es/time-picker/index.d.ts +113 -113
- package/es/time-picker/panel.d.ts +8 -8
- package/es/time-picker/range-panel.d.ts +8 -8
- package/es/time-picker/time-picker.d.ts +54 -54
- package/es/timeline/index.d.ts +3 -3
- package/es/timeline/timeline.d.ts +2 -2
- package/es/tooltip/index.d.ts +27 -27
- package/es/tooltip/tooltip.d.ts +13 -13
- package/es/transfer/index.d.ts +90 -90
- package/es/transfer/transfer-view.d.ts +37 -37
- package/es/transfer/transfer.d.ts +44 -44
- package/es/tree/base-node.d.ts +14 -14
- package/es/tree/index.d.ts +13 -13
- package/es/tree/transition-node-list.d.ts +14 -14
- package/es/tree/tree.d.ts +6 -6
- package/es/tree-select/index.d.ts +83 -83
- package/es/tree-select/panel.d.ts +13 -13
- package/es/tree-select/tree-select.d.ts +39 -39
- package/es/trigger/index.d.ts +12 -12
- package/es/trigger/trigger.d.ts +7 -7
- package/es/typography/base.d.ts +2 -2
- package/es/typography/edit-content.d.ts +67 -67
- package/es/typography/index.d.ts +3 -3
- package/es/typography/operations.d.ts +27 -27
- package/es/typography/title.d.ts +3 -3
- package/es/upload/index.d.ts +6 -6
- package/es/upload/upload.d.ts +2 -2
- package/es/verification-code/index.d.ts +12 -12
- package/es/verification-code/verification-code.d.ts +5 -5
- package/json/vetur-attributes.json +2116 -2116
- package/json/vetur-tags.json +757 -757
- package/json/web-types.json +4117 -4117
- package/lib/_utils/array.js +18 -1
- package/lib/drawer/drawer.js +63 -8
- package/lib/drawer/style/index.css +10 -0
- package/lib/drawer/style/index.less +12 -0
- package/lib/index.css +39 -8
- package/lib/modal/modal.js +23 -6
- package/lib/modal/modal.vue_vue_type_script_lang.js +36 -12
- package/lib/modal/style/index.css +7 -1
- package/lib/modal/style/index.less +8 -1
- package/lib/table/hooks/use-row-selection.js +5 -3
- package/lib/table/style/index.css +22 -7
- package/lib/table/style/index.less +25 -8
- package/lib/table/table-operation-td.js +6 -6
- package/lib/table/table-operation-th.js +19 -7
- package/lib/table/table-td.js +2 -2
- package/lib/table/table.js +183 -33
- package/lib/table/utils.js +9 -5
- package/package.json +25 -24
- package/LICENSE +0 -21
|
@@ -29,15 +29,27 @@ var OperationTh = vue.defineComponent({
|
|
|
29
29
|
const prefixCls = globalConfig.getPrefixCls("table");
|
|
30
30
|
const tableCtx = vue.inject(context.tableInjectionKey, {});
|
|
31
31
|
const checkboxStatus = vue.computed(() => {
|
|
32
|
-
var _a, _b, _c, _d;
|
|
32
|
+
var _a, _b, _c, _d, _e;
|
|
33
33
|
let checked = false;
|
|
34
34
|
let indeterminate = false;
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const totalEnabledNumber = (_b = (_a = tableCtx.currentAllEnabledRowKeys) == null ? void 0 : _a.length) != null ? _b : 0;
|
|
36
|
+
if (totalEnabledNumber === 0) {
|
|
37
|
+
return {
|
|
38
|
+
checked,
|
|
39
|
+
indeterminate
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const enabledKeySet = (_d = tableCtx.currentAllEnabledRowKeySet) != null ? _d : new Set((_c = tableCtx.currentAllEnabledRowKeys) != null ? _c : []);
|
|
43
|
+
const currentSelectedRowKeys = (_e = tableCtx.currentSelectedRowKeys) != null ? _e : [];
|
|
44
|
+
let selectedNumber = 0;
|
|
45
|
+
for (const key of currentSelectedRowKeys) {
|
|
46
|
+
if (enabledKeySet.has(key)) {
|
|
47
|
+
selectedNumber += 1;
|
|
48
|
+
if (selectedNumber >= totalEnabledNumber) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
41
53
|
if (selectedNumber > 0) {
|
|
42
54
|
if (selectedNumber >= totalEnabledNumber) {
|
|
43
55
|
checked = true;
|
package/lib/table/table-td.js
CHANGED
|
@@ -107,13 +107,13 @@ var Td = vue.defineComponent({
|
|
|
107
107
|
};
|
|
108
108
|
const style = vue.computed(() => {
|
|
109
109
|
var _a;
|
|
110
|
-
const
|
|
110
|
+
const fixedStyle = utils.getStyle(props.column, {
|
|
111
111
|
dataColumns: props.dataColumns,
|
|
112
112
|
operations: props.operations
|
|
113
113
|
});
|
|
114
114
|
const customStyle = getCustomStyle();
|
|
115
115
|
return {
|
|
116
|
-
...
|
|
116
|
+
...fixedStyle,
|
|
117
117
|
...(_a = props.column) == null ? void 0 : _a.cellStyle,
|
|
118
118
|
...customStyle
|
|
119
119
|
};
|
package/lib/table/table.js
CHANGED
|
@@ -280,7 +280,7 @@ var _Table = vue.defineComponent({
|
|
|
280
280
|
const {
|
|
281
281
|
componentRef: virtualComRef,
|
|
282
282
|
elementRef: virtualRef
|
|
283
|
-
} = useComponentRef.useComponentRef("
|
|
283
|
+
} = useComponentRef.useComponentRef("containerRef");
|
|
284
284
|
const {
|
|
285
285
|
componentRef: theadComRef,
|
|
286
286
|
elementRef: theadRef
|
|
@@ -476,6 +476,9 @@ var _Table = vue.defineComponent({
|
|
|
476
476
|
currentAllEnabledRowKeys,
|
|
477
477
|
emit
|
|
478
478
|
});
|
|
479
|
+
const currentAllEnabledRowKeySet = vue.computed(() => new Set(currentAllEnabledRowKeys.value));
|
|
480
|
+
const currentSelectedRowKeySet = vue.computed(() => new Set(currentSelectedRowKeys.value));
|
|
481
|
+
const selectedRowKeySet = vue.computed(() => new Set(selectedRowKeys.value));
|
|
479
482
|
const {
|
|
480
483
|
expandedRowKeys,
|
|
481
484
|
handleExpand,
|
|
@@ -531,18 +534,27 @@ var _Table = vue.defineComponent({
|
|
|
531
534
|
expand: _record.expand,
|
|
532
535
|
isLeaf: _record.isLeaf
|
|
533
536
|
};
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
+
const recordChildren = _record.children;
|
|
538
|
+
if (Array.isArray(recordChildren)) {
|
|
539
|
+
if (recordChildren.length > 0) {
|
|
540
|
+
record.isLeaf = false;
|
|
541
|
+
record.children = travel(recordChildren);
|
|
542
|
+
} else if (showEmptyTree.value) {
|
|
543
|
+
record.isLeaf = false;
|
|
544
|
+
record.children = [];
|
|
545
|
+
} else {
|
|
546
|
+
record.isLeaf = true;
|
|
547
|
+
}
|
|
537
548
|
} else if (props.loadMore && !_record.isLeaf) {
|
|
538
549
|
record.isLeaf = false;
|
|
539
|
-
|
|
540
|
-
|
|
550
|
+
const lazyChildren = lazyLoadData[record.key];
|
|
551
|
+
if (lazyChildren) {
|
|
552
|
+
record.children = travel(lazyChildren);
|
|
541
553
|
}
|
|
542
554
|
} else {
|
|
543
555
|
record.isLeaf = true;
|
|
544
556
|
}
|
|
545
|
-
record.hasSubtree = Boolean(record.children ? props.hideExpandButtonOnEmpty ? record.children.length > 0 :
|
|
557
|
+
record.hasSubtree = Boolean(record.children ? props.hideExpandButtonOnEmpty ? record.children.length > 0 : showEmptyTree.value || record.children.length > 0 : props.loadMore && !record.isLeaf);
|
|
546
558
|
result.push(record);
|
|
547
559
|
}
|
|
548
560
|
return result;
|
|
@@ -860,7 +872,10 @@ var _Table = vue.defineComponent({
|
|
|
860
872
|
resizingColumn,
|
|
861
873
|
checkStrictly,
|
|
862
874
|
currentAllEnabledRowKeys,
|
|
875
|
+
currentAllEnabledRowKeySet,
|
|
863
876
|
currentSelectedRowKeys,
|
|
877
|
+
currentSelectedRowKeySet,
|
|
878
|
+
selectedRowKeySet,
|
|
864
879
|
addColumn,
|
|
865
880
|
removeColumn,
|
|
866
881
|
onSelectAll: handleSelectAll,
|
|
@@ -880,7 +895,8 @@ var _Table = vue.defineComponent({
|
|
|
880
895
|
[`${prefixCls}-dragging`]: dragState.dragging,
|
|
881
896
|
[`${prefixCls}-type-selection`]: Boolean(props.rowSelection),
|
|
882
897
|
[`${prefixCls}-empty`]: props.data && flattenData.value.length === 0,
|
|
883
|
-
[`${prefixCls}-layout-fixed`]: props.tableLayoutFixed || isScroll.value.x || splitTable.value || hasEllipsis.value
|
|
898
|
+
[`${prefixCls}-layout-fixed`]: props.tableLayoutFixed || isScroll.value.x || splitTable.value || hasEllipsis.value,
|
|
899
|
+
[`${prefixCls}-virtualized`]: Boolean(props.virtualListProps)
|
|
884
900
|
}]);
|
|
885
901
|
const paginationCls = vue.computed(() => [`${prefixCls}-pagination`, {
|
|
886
902
|
[`${prefixCls}-pagination-left`]: props.pagePosition === "tl" || props.pagePosition === "bl",
|
|
@@ -907,6 +923,13 @@ var _Table = vue.defineComponent({
|
|
|
907
923
|
}
|
|
908
924
|
thWidth.value = width;
|
|
909
925
|
};
|
|
926
|
+
vue.watch(columnWidth, () => {
|
|
927
|
+
if (isVirtualList.value) {
|
|
928
|
+
vue.nextTick(getThWidth);
|
|
929
|
+
}
|
|
930
|
+
}, {
|
|
931
|
+
deep: true
|
|
932
|
+
});
|
|
910
933
|
const hasScrollBar = vue.ref(false);
|
|
911
934
|
const isTbodyHasScrollBar = () => {
|
|
912
935
|
if (tbodyRef.value) {
|
|
@@ -979,11 +1002,16 @@ var _Table = vue.defineComponent({
|
|
|
979
1002
|
columns: allColumns
|
|
980
1003
|
});
|
|
981
1004
|
const getVirtualColumnStyle = (name) => {
|
|
982
|
-
|
|
1005
|
+
var _a;
|
|
1006
|
+
if (!isVirtualList.value || !name) {
|
|
1007
|
+
return void 0;
|
|
1008
|
+
}
|
|
1009
|
+
const width = (_a = columnWidth[name]) != null ? _a : thWidth.value[name];
|
|
1010
|
+
if (!width) {
|
|
983
1011
|
return void 0;
|
|
984
1012
|
}
|
|
985
1013
|
return {
|
|
986
|
-
width: `${
|
|
1014
|
+
width: `${width}px`
|
|
987
1015
|
};
|
|
988
1016
|
};
|
|
989
1017
|
const renderSummaryRow = (record, rowIndex) => {
|
|
@@ -1099,16 +1127,14 @@ var _Table = vue.defineComponent({
|
|
|
1099
1127
|
}
|
|
1100
1128
|
return null;
|
|
1101
1129
|
};
|
|
1102
|
-
const
|
|
1130
|
+
const renderRecordRow = (record, rowIndex, {
|
|
1103
1131
|
indentSize = 0,
|
|
1104
1132
|
indexPath,
|
|
1105
1133
|
allowDrag = true
|
|
1106
1134
|
} = {}) => {
|
|
1107
|
-
var _a;
|
|
1108
1135
|
const currentKey = record.key;
|
|
1109
1136
|
const currentPath = (indexPath != null ? indexPath : []).concat(rowIndex);
|
|
1110
1137
|
const expandContent = renderExpandContent(record);
|
|
1111
|
-
const showExpand = expandedRowKeys.value.includes(currentKey);
|
|
1112
1138
|
const isDragTarget = dragState.sourceKey === record.key;
|
|
1113
1139
|
const dragSourceEvent = dragType.value ? {
|
|
1114
1140
|
draggable: allowDrag,
|
|
@@ -1141,7 +1167,7 @@ var _Table = vue.defineComponent({
|
|
|
1141
1167
|
handleDrop(ev);
|
|
1142
1168
|
}
|
|
1143
1169
|
} : {};
|
|
1144
|
-
return vue.createVNode(
|
|
1170
|
+
return vue.createVNode(tableTr, vue.mergeProps({
|
|
1145
1171
|
"key": currentKey,
|
|
1146
1172
|
"class": [{
|
|
1147
1173
|
[`${prefixCls}-tr-draggable`]: dragType.value === "row",
|
|
@@ -1149,15 +1175,15 @@ var _Table = vue.defineComponent({
|
|
|
1149
1175
|
}, is.isFunction(props.rowClass) ? props.rowClass(record.raw, rowIndex) : props.rowClass],
|
|
1150
1176
|
"rowIndex": rowIndex,
|
|
1151
1177
|
"record": record,
|
|
1152
|
-
"checked": props.rowSelection &&
|
|
1178
|
+
"checked": props.rowSelection && selectedRowKeySet.value.has(currentKey),
|
|
1153
1179
|
"onClick": (ev) => handleRowClick(record, ev),
|
|
1154
1180
|
"onDblclick": (ev) => handleRowDblclick(record, ev),
|
|
1155
1181
|
"onContextmenu": (ev) => handleRowContextMenu(record, ev)
|
|
1156
1182
|
}, dragType.value === "row" ? dragSourceEvent : {}, dragTargetEvent), {
|
|
1157
1183
|
default: () => [operations.value.map((operation, index2) => {
|
|
1158
|
-
var
|
|
1184
|
+
var _a;
|
|
1159
1185
|
const cellId = `${rowIndex}-${index2}-${record.key}`;
|
|
1160
|
-
const [rowspan, colspan] = props.spanAll ? (
|
|
1186
|
+
const [rowspan, colspan] = props.spanAll ? (_a = tableSpan.value[cellId]) != null ? _a : [1, 1] : [1, 1];
|
|
1161
1187
|
if (props.spanAll && removedCells.value.includes(cellId)) {
|
|
1162
1188
|
return null;
|
|
1163
1189
|
}
|
|
@@ -1177,9 +1203,9 @@ var _Table = vue.defineComponent({
|
|
|
1177
1203
|
"drag-handle-icon": slots["drag-handle-icon"]
|
|
1178
1204
|
});
|
|
1179
1205
|
}), dataColumns.value.map((column, index2) => {
|
|
1180
|
-
var
|
|
1206
|
+
var _a;
|
|
1181
1207
|
const cellId = `${rowIndex}-${props.spanAll ? operations.value.length + index2 : index2}-${record.key}`;
|
|
1182
|
-
const [rowspan, colspan] = (
|
|
1208
|
+
const [rowspan, colspan] = (_a = tableSpan.value[cellId]) != null ? _a : [1, 1];
|
|
1183
1209
|
if (removedCells.value.includes(cellId)) {
|
|
1184
1210
|
return null;
|
|
1185
1211
|
}
|
|
@@ -1210,13 +1236,123 @@ var _Table = vue.defineComponent({
|
|
|
1210
1236
|
});
|
|
1211
1237
|
})],
|
|
1212
1238
|
tr: slots.tr
|
|
1239
|
+
});
|
|
1240
|
+
};
|
|
1241
|
+
const renderRecord = (record, rowIndex, {
|
|
1242
|
+
indentSize = 0,
|
|
1243
|
+
indexPath,
|
|
1244
|
+
allowDrag = true
|
|
1245
|
+
} = {}) => {
|
|
1246
|
+
const currentKey = record.key;
|
|
1247
|
+
const currentPath = (indexPath != null ? indexPath : []).concat(rowIndex);
|
|
1248
|
+
const expandContent = renderExpandContent(record);
|
|
1249
|
+
const showExpand = expandedRowKeys.value.includes(currentKey);
|
|
1250
|
+
return vue.createVNode(vue.Fragment, null, [renderRecordRow(record, rowIndex, {
|
|
1251
|
+
indentSize,
|
|
1252
|
+
indexPath,
|
|
1253
|
+
allowDrag
|
|
1213
1254
|
}), showExpand && renderExpand(record, {
|
|
1214
1255
|
indentSize: indentSize + props.indentSize,
|
|
1215
1256
|
indexPath: currentPath,
|
|
1216
|
-
allowDrag
|
|
1257
|
+
allowDrag,
|
|
1217
1258
|
expandContent
|
|
1218
1259
|
})]);
|
|
1219
1260
|
};
|
|
1261
|
+
const renderVirtualEmptyRow = (key) => {
|
|
1262
|
+
return vue.createVNode(tableTr, {
|
|
1263
|
+
"key": key,
|
|
1264
|
+
"empty": true
|
|
1265
|
+
}, {
|
|
1266
|
+
default: () => [vue.createVNode(tableTd, {
|
|
1267
|
+
"colSpan": dataColumns.value.length + operations.value.length
|
|
1268
|
+
}, {
|
|
1269
|
+
default: () => {
|
|
1270
|
+
var _a, _b, _c, _d, _e;
|
|
1271
|
+
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, {
|
|
1272
|
+
component: "table"
|
|
1273
|
+
})) != null ? _e : vue.createVNode(index$3, null, null)];
|
|
1274
|
+
}
|
|
1275
|
+
})]
|
|
1276
|
+
});
|
|
1277
|
+
};
|
|
1278
|
+
const virtualListData = vue.computed(() => {
|
|
1279
|
+
if (!isVirtualList.value || flattenData.value.length === 0) {
|
|
1280
|
+
return [];
|
|
1281
|
+
}
|
|
1282
|
+
const hasSubData = flattenData.value.some((record) => Boolean(record.hasSubtree));
|
|
1283
|
+
const baseIndentSize = hasSubData ? 20 : 0;
|
|
1284
|
+
const expandedKeySet = new Set(expandedRowKeys.value);
|
|
1285
|
+
const list = [];
|
|
1286
|
+
let recordIndex = 0;
|
|
1287
|
+
const travel = (data, indentSize, indexPath) => {
|
|
1288
|
+
data.forEach((record, index2) => {
|
|
1289
|
+
var _a;
|
|
1290
|
+
const currentPath = indexPath.concat(index2);
|
|
1291
|
+
list.push({
|
|
1292
|
+
type: "record",
|
|
1293
|
+
_key: `r-${String(record.key)}`,
|
|
1294
|
+
record,
|
|
1295
|
+
rowIndex: recordIndex,
|
|
1296
|
+
indentSize,
|
|
1297
|
+
indexPath: currentPath
|
|
1298
|
+
});
|
|
1299
|
+
recordIndex += 1;
|
|
1300
|
+
if (!expandedKeySet.has(record.key))
|
|
1301
|
+
return;
|
|
1302
|
+
if (record.hasSubtree) {
|
|
1303
|
+
if (((_a = record.children) == null ? void 0 : _a.length) === 0 && showEmptyTree.value) {
|
|
1304
|
+
list.push({
|
|
1305
|
+
type: "empty-subtree",
|
|
1306
|
+
_key: `empty-subtree-${String(record.key)}`
|
|
1307
|
+
});
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
if (record.children && record.children.length > 0) {
|
|
1311
|
+
travel(record.children, indentSize + props.indentSize, currentPath);
|
|
1312
|
+
}
|
|
1313
|
+
return;
|
|
1314
|
+
}
|
|
1315
|
+
const expandContent = renderExpandContent(record);
|
|
1316
|
+
if (expandContent) {
|
|
1317
|
+
list.push({
|
|
1318
|
+
type: "expand",
|
|
1319
|
+
_key: `expand-${String(record.key)}`,
|
|
1320
|
+
record
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
});
|
|
1324
|
+
};
|
|
1325
|
+
travel(flattenData.value, baseIndentSize, []);
|
|
1326
|
+
return list;
|
|
1327
|
+
});
|
|
1328
|
+
const renderVirtualItem = (item) => {
|
|
1329
|
+
if (item.type === "record") {
|
|
1330
|
+
return renderRecordRow(item.record, item.rowIndex, {
|
|
1331
|
+
indentSize: item.indentSize,
|
|
1332
|
+
indexPath: item.indexPath
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
if (item.type === "empty-subtree") {
|
|
1336
|
+
return renderVirtualEmptyRow(item._key);
|
|
1337
|
+
}
|
|
1338
|
+
const expandContent = renderExpandContent(item.record);
|
|
1339
|
+
if (!expandContent) {
|
|
1340
|
+
return null;
|
|
1341
|
+
}
|
|
1342
|
+
const scrollContainer = containerElement.value;
|
|
1343
|
+
return vue.createVNode(tableTr, {
|
|
1344
|
+
"key": `${item.record.key}-expand`,
|
|
1345
|
+
"expand": true
|
|
1346
|
+
}, {
|
|
1347
|
+
default: () => [vue.createVNode(tableTd, {
|
|
1348
|
+
"isFixedExpand": hasLeftFixedColumn.value || hasRightFixedColumn.value,
|
|
1349
|
+
"containerWidth": scrollContainer == null ? void 0 : scrollContainer.clientWidth,
|
|
1350
|
+
"colSpan": dataColumns.value.length + operations.value.length
|
|
1351
|
+
}, _isSlot(expandContent) ? expandContent : {
|
|
1352
|
+
default: () => [expandContent]
|
|
1353
|
+
})]
|
|
1354
|
+
});
|
|
1355
|
+
};
|
|
1220
1356
|
const renderBody = () => {
|
|
1221
1357
|
const hasSubData = flattenData.value.some((record) => Boolean(record.hasSubtree));
|
|
1222
1358
|
return vue.createVNode(tableTbody, null, {
|
|
@@ -1245,7 +1381,7 @@ var _Table = vue.defineComponent({
|
|
|
1245
1381
|
"rowSpan": groupColumns.value.length
|
|
1246
1382
|
}, null);
|
|
1247
1383
|
}), row.map((column, index3) => {
|
|
1248
|
-
const resizable = props.columnResizable && Boolean(column.dataIndex) && index3 < row.length - 1;
|
|
1384
|
+
const resizable = props.columnResizable && Boolean(column.dataIndex) && index3 < row.length - 1 && !column.fixed;
|
|
1249
1385
|
return vue.createVNode(tableTh, {
|
|
1250
1386
|
"key": `th-${index3}`,
|
|
1251
1387
|
"ref": (ins) => {
|
|
@@ -1265,6 +1401,24 @@ var _Table = vue.defineComponent({
|
|
|
1265
1401
|
}))],
|
|
1266
1402
|
thead: slots.thead
|
|
1267
1403
|
});
|
|
1404
|
+
const VirtualListTable = vue.defineComponent({
|
|
1405
|
+
setup(_props, {
|
|
1406
|
+
attrs,
|
|
1407
|
+
slots: slots2
|
|
1408
|
+
}) {
|
|
1409
|
+
return () => {
|
|
1410
|
+
var _a;
|
|
1411
|
+
return vue.createVNode("table", vue.mergeProps(attrs, {
|
|
1412
|
+
"cellpadding": 0,
|
|
1413
|
+
"cellspacing": 0
|
|
1414
|
+
}), [vue.createVNode(tableColGroup, {
|
|
1415
|
+
"dataColumns": dataColumns.value,
|
|
1416
|
+
"operations": operations.value,
|
|
1417
|
+
"columnWidth": columnWidth
|
|
1418
|
+
}, null), (_a = slots2.default) == null ? void 0 : _a.call(slots2)]);
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1268
1422
|
const renderContent = () => {
|
|
1269
1423
|
var _a, _b;
|
|
1270
1424
|
if (splitTable.value) {
|
|
@@ -1308,17 +1462,14 @@ var _Table = vue.defineComponent({
|
|
|
1308
1462
|
"onResize": handleTbodyResize
|
|
1309
1463
|
}, {
|
|
1310
1464
|
default: () => {
|
|
1311
|
-
var _a2, _b2;
|
|
1465
|
+
var _a2, _b2, _c, _d;
|
|
1312
1466
|
return [isVirtualList.value && flattenData.value.length ? vue.createVNode(virtualList, vue.mergeProps({
|
|
1313
|
-
"ref":
|
|
1314
|
-
if (ins == null ? void 0 : ins.$el)
|
|
1315
|
-
tbodyRef.value = ins.$el;
|
|
1316
|
-
},
|
|
1467
|
+
"ref": virtualComRef.value,
|
|
1317
1468
|
"class": `${prefixCls}-body`,
|
|
1318
|
-
"data":
|
|
1469
|
+
"data": virtualListData.value,
|
|
1319
1470
|
"itemKey": "_key",
|
|
1320
1471
|
"component": {
|
|
1321
|
-
list:
|
|
1472
|
+
list: VirtualListTable,
|
|
1322
1473
|
content: "tbody"
|
|
1323
1474
|
},
|
|
1324
1475
|
"listAttrs": {
|
|
@@ -1326,19 +1477,18 @@ var _Table = vue.defineComponent({
|
|
|
1326
1477
|
style: contentStyle.value
|
|
1327
1478
|
},
|
|
1328
1479
|
"paddingPosition": "list",
|
|
1329
|
-
"height": "auto"
|
|
1480
|
+
"height": (_b2 = (_a2 = props.scroll) == null ? void 0 : _a2.y) != null ? _b2 : "auto"
|
|
1330
1481
|
}, props.virtualListProps, {
|
|
1331
1482
|
"onScroll": onTbodyScroll
|
|
1332
1483
|
}), {
|
|
1333
1484
|
item: ({
|
|
1334
|
-
item
|
|
1335
|
-
|
|
1336
|
-
}) => renderRecord(item, index2)
|
|
1485
|
+
item
|
|
1486
|
+
}) => renderVirtualItem(item)
|
|
1337
1487
|
}) : vue.createVNode(Component, vue.mergeProps({
|
|
1338
1488
|
"ref": tbodyComRef,
|
|
1339
1489
|
"class": `${prefixCls}-body`,
|
|
1340
1490
|
"style": {
|
|
1341
|
-
maxHeight: is.isNumber((
|
|
1491
|
+
maxHeight: is.isNumber((_c = props.scroll) == null ? void 0 : _c.y) ? `${(_d = props.scroll) == null ? void 0 : _d.y}px` : "100%"
|
|
1342
1492
|
}
|
|
1343
1493
|
}, scrollbar.value ? {
|
|
1344
1494
|
outerStyle: {
|
package/lib/table/utils.js
CHANGED
|
@@ -261,11 +261,15 @@ const getLeafKeys = (record) => {
|
|
|
261
261
|
const getSelectionStatus = (selectedRowKeys, leafKeys) => {
|
|
262
262
|
let checked = false;
|
|
263
263
|
let indeterminate = false;
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
)
|
|
267
|
-
|
|
268
|
-
|
|
264
|
+
const selectedSet = selectedRowKeys instanceof Set ? selectedRowKeys : new Set(selectedRowKeys);
|
|
265
|
+
let selectedLeafCount = 0;
|
|
266
|
+
for (const key of leafKeys) {
|
|
267
|
+
if (selectedSet.has(key)) {
|
|
268
|
+
selectedLeafCount += 1;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (selectedLeafCount > 0) {
|
|
272
|
+
if (selectedLeafCount >= leafKeys.length) {
|
|
269
273
|
checked = true;
|
|
270
274
|
} else {
|
|
271
275
|
indeterminate = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geelato/web-vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.58.2",
|
|
4
4
|
"description": "Arco Design Vue 2.0: A Vue.js 3 UI Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arco",
|
|
@@ -29,6 +29,25 @@
|
|
|
29
29
|
"lib/**/style/*",
|
|
30
30
|
"*.less"
|
|
31
31
|
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"init": "pnpm run icongen && pnpm run lessgen && arco-vue-scripts build:component",
|
|
34
|
+
"start": "arco-vue-scripts dev:component",
|
|
35
|
+
"docgen": "arco-vue-scripts docgen",
|
|
36
|
+
"icongen": "arco-vue-scripts icongen && pnpm run dtsgen:icon",
|
|
37
|
+
"lessgen": "arco-vue-scripts lessgen",
|
|
38
|
+
"jsongen": "arco-vue-scripts jsongen",
|
|
39
|
+
"build": "pnpm run build:component && pnpm run build:style && pnpm run dtsgen && pnpm run jsongen",
|
|
40
|
+
"build:component": "arco-vue-scripts build:component -u",
|
|
41
|
+
"build:module": "arco-vue-scripts build:component",
|
|
42
|
+
"build:style": "arco-vue-scripts build:style",
|
|
43
|
+
"dtsgen": "arco-vue-scripts dtsgen 'components/**/*.{ts,tsx,vue}'",
|
|
44
|
+
"dtsgen:icon": "arco-vue-scripts dtsgen 'components/icon/**/*.{ts,tsx,vue}' -o 'components/icon/@types'",
|
|
45
|
+
"test": "arco-vue-scripts test --coverage",
|
|
46
|
+
"test:update": "arco-vue-scripts test --coverage -u",
|
|
47
|
+
"test:screenshot": "arco-vue-scripts test:screenshot -o ./__screenshots__/",
|
|
48
|
+
"changelog": "arco-vue-scripts changelog",
|
|
49
|
+
"lint-staged": "npx lint-staged"
|
|
50
|
+
},
|
|
32
51
|
"peerDependencies": {
|
|
33
52
|
"vue": ">=3.1.0"
|
|
34
53
|
},
|
|
@@ -43,6 +62,7 @@
|
|
|
43
62
|
]
|
|
44
63
|
},
|
|
45
64
|
"devDependencies": {
|
|
65
|
+
"@arco-design/arco-vue-scripts": "workspace:*",
|
|
46
66
|
"@babel/core": "^7.26.9",
|
|
47
67
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
48
68
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
@@ -69,8 +89,7 @@
|
|
|
69
89
|
"stylelint-config-standard": "^20.0.0",
|
|
70
90
|
"stylelint-order": "^4.1.0",
|
|
71
91
|
"typescript": "^4.9.5",
|
|
72
|
-
"vue-jest": "5.0.0-alpha.10"
|
|
73
|
-
"@arco-design/arco-vue-scripts": "0.2.10"
|
|
92
|
+
"vue-jest": "5.0.0-alpha.10"
|
|
74
93
|
},
|
|
75
94
|
"dependencies": {
|
|
76
95
|
"@arco-design/color": "^0.4.0",
|
|
@@ -87,27 +106,9 @@
|
|
|
87
106
|
"tags": "json/vetur-tags.json",
|
|
88
107
|
"attributes": "json/vetur-attributes.json"
|
|
89
108
|
},
|
|
90
|
-
"web-types": "json/web-types.json"
|
|
109
|
+
"web-types": "json/web-types.json"
|
|
110
|
+
,
|
|
91
111
|
"publishConfig": {
|
|
92
112
|
"access": "public"
|
|
93
|
-
},
|
|
94
|
-
"scripts": {
|
|
95
|
-
"init": "pnpm run icongen && pnpm run lessgen && arco-vue-scripts build:component",
|
|
96
|
-
"start": "arco-vue-scripts dev:component",
|
|
97
|
-
"docgen": "arco-vue-scripts docgen",
|
|
98
|
-
"icongen": "arco-vue-scripts icongen && pnpm run dtsgen:icon",
|
|
99
|
-
"lessgen": "arco-vue-scripts lessgen",
|
|
100
|
-
"jsongen": "arco-vue-scripts jsongen",
|
|
101
|
-
"build": "pnpm run build:component && pnpm run build:style && pnpm run dtsgen && pnpm run jsongen",
|
|
102
|
-
"build:component": "arco-vue-scripts build:component -u",
|
|
103
|
-
"build:module": "arco-vue-scripts build:component",
|
|
104
|
-
"build:style": "arco-vue-scripts build:style",
|
|
105
|
-
"dtsgen": "arco-vue-scripts dtsgen 'components/**/*.{ts,tsx,vue}'",
|
|
106
|
-
"dtsgen:icon": "arco-vue-scripts dtsgen 'components/icon/**/*.{ts,tsx,vue}' -o 'components/icon/@types'",
|
|
107
|
-
"test": "arco-vue-scripts test --coverage",
|
|
108
|
-
"test:update": "arco-vue-scripts test --coverage -u",
|
|
109
|
-
"test:screenshot": "arco-vue-scripts test:screenshot -o ./__screenshots__/",
|
|
110
|
-
"changelog": "arco-vue-scripts changelog",
|
|
111
|
-
"lint-staged": "npx lint-staged"
|
|
112
113
|
}
|
|
113
|
-
}
|
|
114
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Bytedance, Inc. and its affiliates.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|