@sdata/web-vue 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/sd.css +89 -9
- package/dist/sd.min.css +1 -1
- package/es/_components/select-view/style/index.css +4 -2
- package/es/_components/virtual-list-v2/hooks/use-size.d.ts +17 -0
- package/es/_components/virtual-list-v2/hooks/use-size.js +95 -0
- package/es/_components/virtual-list-v2/index.d.ts +2 -0
- package/es/_components/virtual-list-v2/index.js +5 -0
- package/es/_components/virtual-list-v2/interface.d.ts +44 -0
- package/es/_components/virtual-list-v2/virtual-list-item.d.ts +22 -0
- package/es/_components/virtual-list-v2/virtual-list-item.js +37 -0
- package/es/_components/virtual-list-v2/virtual-list.js +47 -0
- package/es/_components/virtual-list-v2/virtual-list.vue.d.ts +749 -0
- package/es/_components/virtual-list-v2/virtual-list.vue_vue_type_script_lang.js +179 -0
- package/es/_hooks/use-config-provider-prop.d.ts +1 -1
- package/es/_virtual/_plugin-vue_export-helper.js +8 -0
- package/es/color-picker/hooks/use-control-block.js +4 -1
- package/es/components.d.ts +1 -0
- package/es/config-provider/config-provider.vue.d.ts +7 -1
- package/es/config-provider/config-provider.vue_vue_type_script_setup_true_lang.js +7 -1
- package/es/config-provider/context.d.ts +14 -0
- package/es/config-provider/index.d.ts +9 -0
- package/es/index.css +89 -9
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -1
- package/es/index.scss +1 -0
- package/es/input-tag/style/index.css +4 -2
- package/es/input-tag/style/input-tag.scss +29 -7
- package/es/message/message.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/pagination/pagination.js +101 -19
- package/es/sd-vue.js +2 -0
- package/es/table/context.d.ts +1 -1
- package/es/table/hooks/use-column-resize.d.ts +3 -2
- package/es/table/hooks/use-column-resize.js +21 -48
- package/es/table/hooks/use-drag.d.ts +1 -3
- package/es/table/hooks/use-drag.js +2 -18
- package/es/table/index.d.ts +21 -36
- package/es/table/style/index.css +12 -5
- package/es/table/style/index.scss +16 -6
- package/es/table/table-operation-td.js +15 -12
- package/es/table/table-operation-th.js +2 -2
- package/es/table/table-tbody.js +3 -1
- package/es/table/table-td.js +3 -4
- package/es/table/table-th.js +24 -40
- package/es/table/table-thead.js +3 -1
- package/es/table/table.d.ts +13 -19
- package/es/table/table.js +205 -424
- package/es/table/utils.d.ts +2 -0
- package/es/table/utils.js +11 -1
- package/es/tag/index.d.ts +3 -3
- package/es/tag/tag.vue.d.ts +2 -2
- package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +16 -5
- package/es/toolbar/index.d.ts +72 -0
- package/es/toolbar/index.js +10 -0
- package/es/toolbar/style/css.js +2 -0
- package/es/toolbar/style/index.css +85 -0
- package/es/toolbar/style/index.d.ts +2 -0
- package/es/toolbar/style/index.js +2 -0
- package/es/toolbar/style/index.scss +97 -0
- package/es/toolbar/style/token.scss +25 -0
- package/es/toolbar/toolbar.js +5 -0
- package/es/toolbar/toolbar.vue.d.ts +44 -0
- package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +197 -0
- package/es/toolbar/types.d.ts +26 -0
- package/es/trigger/trigger.js +5 -1
- package/json/vetur-attributes.json +76 -1
- package/json/vetur-tags.json +24 -0
- package/json/web-types.json +163 -7
- package/package.json +1 -1
- package/es/table/table-col-group.vue.d.ts +0 -29
package/es/table/style/index.css
CHANGED
|
@@ -129,6 +129,9 @@
|
|
|
129
129
|
grid-column: 1/-1;
|
|
130
130
|
grid-template-columns: var(--sd-table-grid-template, minmax(0, 1fr));
|
|
131
131
|
}
|
|
132
|
+
.sd-table-thead > .sd-table-tr, .sd-table-tbody > .sd-table-tr, .sd-table-tfoot-content > .sd-table-tr {
|
|
133
|
+
display: contents;
|
|
134
|
+
}
|
|
132
135
|
.sd-table-tbody > .sd-virtual-list, .sd-table-tbody > .sd-table-body {
|
|
133
136
|
grid-column: 1/-1;
|
|
134
137
|
width: 100%;
|
|
@@ -463,9 +466,10 @@
|
|
|
463
466
|
flex-direction: column;
|
|
464
467
|
width: auto;
|
|
465
468
|
height: 100%;
|
|
469
|
+
overflow: hidden;
|
|
466
470
|
}
|
|
467
471
|
.sd-table-container .sd-table-content-scroll-x {
|
|
468
|
-
overflow:
|
|
472
|
+
overflow: hidden;
|
|
469
473
|
}
|
|
470
474
|
.sd-table-container::before, .sd-table-container::after {
|
|
471
475
|
position: absolute;
|
|
@@ -494,6 +498,7 @@
|
|
|
494
498
|
box-shadow: inset -6px 0 8px -3px rgba(0, 0, 0, 0.15);
|
|
495
499
|
}
|
|
496
500
|
.sd-table-header {
|
|
501
|
+
flex: 0 0 auto;
|
|
497
502
|
width: 100%;
|
|
498
503
|
min-width: 100%;
|
|
499
504
|
overflow: hidden;
|
|
@@ -518,13 +523,15 @@
|
|
|
518
523
|
background-color: transparent;
|
|
519
524
|
}
|
|
520
525
|
.sd-table.sd-table-empty .sd-table-header {
|
|
521
|
-
overflow-x:
|
|
526
|
+
overflow-x: hidden;
|
|
522
527
|
}
|
|
523
528
|
.sd-table-body {
|
|
524
529
|
position: relative;
|
|
530
|
+
flex: 1 1 auto;
|
|
525
531
|
width: 100%;
|
|
526
|
-
min-
|
|
527
|
-
|
|
532
|
+
min-width: 0;
|
|
533
|
+
min-height: 0;
|
|
534
|
+
overflow: hidden;
|
|
528
535
|
background-color: var(--sd-color-bg-2);
|
|
529
536
|
}
|
|
530
537
|
.sd-table-border .sd-table-container {
|
|
@@ -644,7 +651,7 @@
|
|
|
644
651
|
z-index: 1;
|
|
645
652
|
flex-shrink: 0;
|
|
646
653
|
width: 100%;
|
|
647
|
-
overflow-x:
|
|
654
|
+
overflow-x: hidden;
|
|
648
655
|
background-color: var(--sd-color-neutral-2);
|
|
649
656
|
box-shadow: 0 -1px 0 var(--sd-color-neutral-3);
|
|
650
657
|
scrollbar-color: transparent transparent;
|
|
@@ -190,6 +190,12 @@ $table-cls-td: string.unquote('#{$table-prefix-cls}-td');
|
|
|
190
190
|
grid-template-columns: var(--sd-table-grid-template, minmax(0, 1fr));
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
&-thead > &-tr,
|
|
194
|
+
&-tbody > &-tr,
|
|
195
|
+
&-tfoot-content > &-tr {
|
|
196
|
+
display: contents;
|
|
197
|
+
}
|
|
198
|
+
|
|
193
199
|
&-tbody > .#{theme.$prefix}-virtual-list,
|
|
194
200
|
&-tbody > .#{$table-prefix-cls}-body {
|
|
195
201
|
grid-column: 1 / -1;
|
|
@@ -435,7 +441,7 @@ $table-cls-td: string.unquote('#{$table-prefix-cls}-td');
|
|
|
435
441
|
padding-left: 0;
|
|
436
442
|
}
|
|
437
443
|
|
|
438
|
-
//
|
|
444
|
+
// operation column sizing
|
|
439
445
|
&-selection-checkbox-col,
|
|
440
446
|
&-selection-radio-col {
|
|
441
447
|
@include fixed-width($table-size-selection-col-width);
|
|
@@ -607,9 +613,10 @@ $table-cls-td: string.unquote('#{$table-prefix-cls}-td');
|
|
|
607
613
|
flex-direction: column;
|
|
608
614
|
width: auto;
|
|
609
615
|
height: 100%;
|
|
616
|
+
overflow: hidden;
|
|
610
617
|
|
|
611
618
|
&-scroll-x {
|
|
612
|
-
overflow:
|
|
619
|
+
overflow: hidden;
|
|
613
620
|
}
|
|
614
621
|
}
|
|
615
622
|
|
|
@@ -657,6 +664,7 @@ $table-cls-td: string.unquote('#{$table-prefix-cls}-td');
|
|
|
657
664
|
}
|
|
658
665
|
|
|
659
666
|
&-header {
|
|
667
|
+
flex: 0 0 auto;
|
|
660
668
|
width: 100%;
|
|
661
669
|
min-width: 100%;
|
|
662
670
|
overflow: hidden;
|
|
@@ -687,14 +695,16 @@ $table-cls-td: string.unquote('#{$table-prefix-cls}-td');
|
|
|
687
695
|
}
|
|
688
696
|
|
|
689
697
|
&#{&}-empty &-header {
|
|
690
|
-
overflow-x:
|
|
698
|
+
overflow-x: hidden;
|
|
691
699
|
}
|
|
692
700
|
|
|
693
701
|
&-body {
|
|
694
702
|
position: relative;
|
|
703
|
+
flex: 1 1 auto;
|
|
695
704
|
width: 100%;
|
|
696
|
-
min-
|
|
697
|
-
|
|
705
|
+
min-width: 0;
|
|
706
|
+
min-height: 0;
|
|
707
|
+
overflow: hidden;
|
|
698
708
|
background-color: $table-color-body-background;
|
|
699
709
|
}
|
|
700
710
|
|
|
@@ -911,7 +921,7 @@ $table-cls-td: string.unquote('#{$table-prefix-cls}-td');
|
|
|
911
921
|
z-index: 1;
|
|
912
922
|
flex-shrink: 0;
|
|
913
923
|
width: 100%;
|
|
914
|
-
overflow-x:
|
|
924
|
+
overflow-x: hidden;
|
|
915
925
|
background-color: $table-color-bg-tfoot;
|
|
916
926
|
box-shadow: 0 (-$table-border-width) 0 $table-color-border;
|
|
917
927
|
scrollbar-color: transparent transparent;
|
|
@@ -6,8 +6,8 @@ import IconMinus from "../icon/icon-minus/index.js";
|
|
|
6
6
|
import IconPlus from "../icon/icon-plus/index.js";
|
|
7
7
|
import IconDragDotVertical from "../icon/icon-drag-dot-vertical/index.js";
|
|
8
8
|
import { tableInjectionKey } from "./context.js";
|
|
9
|
-
import { getLeafKeys, getOperationFixedCls, getOperationStyle, getSelectionStatus } from "./utils.js";
|
|
10
|
-
import { computed, createVNode, defineComponent, inject
|
|
9
|
+
import { getGridSpanStyle, getLeafKeys, getOperationFixedCls, getOperationStyle, getSelectionStatus } from "./utils.js";
|
|
10
|
+
import { computed, createVNode, defineComponent, inject } from "vue";
|
|
11
11
|
//#region components/table/table-operation-td.tsx
|
|
12
12
|
var table_operation_td_default = /* @__PURE__ */ defineComponent({
|
|
13
13
|
name: "OperationTd",
|
|
@@ -53,7 +53,7 @@ var table_operation_td_default = /* @__PURE__ */ defineComponent({
|
|
|
53
53
|
setup(props, { slots }) {
|
|
54
54
|
const prefixCls = getPrefixCls("table");
|
|
55
55
|
const tableCtx = inject(tableInjectionKey, {});
|
|
56
|
-
const style = computed(() => _objectSpread2(_objectSpread2(
|
|
56
|
+
const style = computed(() => _objectSpread2(_objectSpread2({}, getOperationStyle(props.operationColumn, props.operations)), getGridSpanStyle(props.rowSpan, props.colSpan)));
|
|
57
57
|
const cls = computed(() => [
|
|
58
58
|
`${prefixCls}-td`,
|
|
59
59
|
`${prefixCls}-operation`,
|
|
@@ -76,7 +76,7 @@ var table_operation_td_default = /* @__PURE__ */ defineComponent({
|
|
|
76
76
|
if (props.operationColumn.name === "selection-checkbox") {
|
|
77
77
|
var _props$selectedRowKey, _props$selectedRowKey2;
|
|
78
78
|
const value = props.record.key;
|
|
79
|
-
if (!tableCtx.checkStrictly && !props.record.isLeaf) return createVNode(Checkbox,
|
|
79
|
+
if (!tableCtx.checkStrictly && !props.record.isLeaf) return createVNode(Checkbox, {
|
|
80
80
|
"modelValue": selectionStatus.value.checked,
|
|
81
81
|
"indeterminate": selectionStatus.value.indeterminate,
|
|
82
82
|
"disabled": Boolean(props.record.disabled),
|
|
@@ -84,30 +84,33 @@ var table_operation_td_default = /* @__PURE__ */ defineComponent({
|
|
|
84
84
|
"onChange": (checked) => {
|
|
85
85
|
var _tableCtx$onSelectAll;
|
|
86
86
|
return (_tableCtx$onSelectAll = tableCtx.onSelectAllLeafs) === null || _tableCtx$onSelectAll === void 0 ? void 0 : _tableCtx$onSelectAll.call(tableCtx, props.record, checked);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
},
|
|
88
|
+
"onClick": (ev) => ev.stopPropagation()
|
|
89
|
+
}, null);
|
|
90
|
+
return createVNode(Checkbox, {
|
|
90
91
|
"modelValue": (_props$selectedRowKey = (_props$selectedRowKey2 = props.selectedRowKeys) === null || _props$selectedRowKey2 === void 0 ? void 0 : _props$selectedRowKey2.includes(value)) !== null && _props$selectedRowKey !== void 0 ? _props$selectedRowKey : false,
|
|
91
92
|
"disabled": Boolean(props.record.disabled),
|
|
92
93
|
"uninjectGroupContext": true,
|
|
93
94
|
"onChange": (checked) => {
|
|
94
95
|
var _tableCtx$onSelect;
|
|
95
96
|
return (_tableCtx$onSelect = tableCtx.onSelect) === null || _tableCtx$onSelect === void 0 ? void 0 : _tableCtx$onSelect.call(tableCtx, checked, props.record);
|
|
96
|
-
}
|
|
97
|
-
|
|
97
|
+
},
|
|
98
|
+
"onClick": (ev) => ev.stopPropagation()
|
|
99
|
+
}, null);
|
|
98
100
|
}
|
|
99
101
|
if (props.operationColumn.name === "selection-radio") {
|
|
100
102
|
var _props$selectedRowKey3, _props$selectedRowKey4;
|
|
101
103
|
const value = props.record.key;
|
|
102
|
-
return createVNode(Radio,
|
|
104
|
+
return createVNode(Radio, {
|
|
103
105
|
"modelValue": (_props$selectedRowKey3 = (_props$selectedRowKey4 = props.selectedRowKeys) === null || _props$selectedRowKey4 === void 0 ? void 0 : _props$selectedRowKey4.includes(value)) !== null && _props$selectedRowKey3 !== void 0 ? _props$selectedRowKey3 : false,
|
|
104
106
|
"disabled": Boolean(props.record.disabled),
|
|
105
107
|
"uninjectGroupContext": true,
|
|
106
108
|
"onChange": (checked) => {
|
|
107
109
|
var _tableCtx$onSelect2;
|
|
108
110
|
return (_tableCtx$onSelect2 = tableCtx.onSelect) === null || _tableCtx$onSelect2 === void 0 ? void 0 : _tableCtx$onSelect2.call(tableCtx, checked, props.record);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
+
},
|
|
112
|
+
"onClick": (ev) => ev.stopPropagation()
|
|
113
|
+
}, null);
|
|
111
114
|
}
|
|
112
115
|
if (props.operationColumn.name === "expand") {
|
|
113
116
|
if (props.hasExpand && props.renderExpandBtn) return props.renderExpandBtn(props.record);
|
|
@@ -3,7 +3,7 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
3
3
|
import { isFunction } from "../_utils/is.js";
|
|
4
4
|
import Checkbox from "../checkbox/index.js";
|
|
5
5
|
import { tableInjectionKey } from "./context.js";
|
|
6
|
-
import { getOperationFixedCls, getOperationStyle } from "./utils.js";
|
|
6
|
+
import { getGridSpanStyle, getOperationFixedCls, getOperationStyle } from "./utils.js";
|
|
7
7
|
import { computed, createVNode, defineComponent, inject } from "vue";
|
|
8
8
|
//#region components/table/table-operation-th.tsx
|
|
9
9
|
var table_operation_th_default = /* @__PURE__ */ defineComponent({
|
|
@@ -58,7 +58,7 @@ var table_operation_th_default = /* @__PURE__ */ defineComponent({
|
|
|
58
58
|
if (props.operationColumn.title) return isFunction(props.operationColumn.title) ? props.operationColumn.title() : props.operationColumn.title;
|
|
59
59
|
return null;
|
|
60
60
|
};
|
|
61
|
-
const style = computed(() => _objectSpread2(_objectSpread2({}, getOperationStyle(props.operationColumn, props.operations)), props.rowSpan
|
|
61
|
+
const style = computed(() => _objectSpread2(_objectSpread2({}, getOperationStyle(props.operationColumn, props.operations)), getGridSpanStyle(props.rowSpan)));
|
|
62
62
|
const cls = computed(() => [
|
|
63
63
|
`${prefixCls}-th`,
|
|
64
64
|
`${prefixCls}-operation`,
|
package/es/table/table-tbody.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { getPrefixCls } from "../_utils/global-config.js";
|
|
1
2
|
import { createVNode, defineComponent } from "vue";
|
|
2
3
|
//#region components/table/table-tbody.tsx
|
|
3
4
|
var table_tbody_default = /* @__PURE__ */ defineComponent({
|
|
4
5
|
name: "Tbody",
|
|
5
6
|
setup(_, { slots }) {
|
|
7
|
+
const prefixCls = getPrefixCls("table");
|
|
6
8
|
return () => {
|
|
7
9
|
var _slots$tbody$, _slots$tbody;
|
|
8
|
-
return createVNode((_slots$tbody$ = (_slots$tbody = slots.tbody) === null || _slots$tbody === void 0 ? void 0 : _slots$tbody.call(slots)[0]) !== null && _slots$tbody$ !== void 0 ? _slots$tbody$ : "div", { class:
|
|
10
|
+
return createVNode((_slots$tbody$ = (_slots$tbody = slots.tbody) === null || _slots$tbody === void 0 ? void 0 : _slots$tbody.call(slots)[0]) !== null && _slots$tbody$ !== void 0 ? _slots$tbody$ : "div", { class: `${prefixCls}-tbody` }, { default: slots.default });
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
13
|
});
|
package/es/table/table-td.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isFunction, isObject } from "../_utils/is.js";
|
|
|
4
4
|
import IconLoading from "../icon/icon-loading/index.js";
|
|
5
5
|
import { getValueByPath } from "../_utils/get-value-by-path.js";
|
|
6
6
|
import { tableInjectionKey } from "./context.js";
|
|
7
|
-
import { getFixedCls, getStyle } from "./utils.js";
|
|
7
|
+
import { getFixedCls, getGridSpanStyle, getStyle } from "./utils.js";
|
|
8
8
|
import auto_tooltip_default from "../_components/auto-tooltip/auto-tooltip.js";
|
|
9
9
|
import { computed, createVNode, defineComponent, inject, isVNode, ref } from "vue";
|
|
10
10
|
//#region components/table/table-td.tsx
|
|
@@ -112,7 +112,7 @@ var table_td_default = /* @__PURE__ */ defineComponent({
|
|
|
112
112
|
operations: props.operations
|
|
113
113
|
});
|
|
114
114
|
const customStyle = getCustomStyle();
|
|
115
|
-
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(
|
|
115
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, style), getGridSpanStyle(props.rowSpan, props.colSpan)), (_props$column13 = props.column) === null || _props$column13 === void 0 ? void 0 : _props$column13.cellStyle), customStyle);
|
|
116
116
|
});
|
|
117
117
|
const cellStyle = computed(() => {
|
|
118
118
|
if (props.isFixedExpand && props.containerWidth) return { width: `${props.containerWidth}px` };
|
|
@@ -166,8 +166,7 @@ var table_td_default = /* @__PURE__ */ defineComponent({
|
|
|
166
166
|
"style": cellStyle.value
|
|
167
167
|
}, [
|
|
168
168
|
props.indentSize > 0 && createVNode("span", { "style": { paddingLeft: `${props.indentSize}px` } }, null),
|
|
169
|
-
props.showExpandBtn && createVNode("
|
|
170
|
-
"type": "button",
|
|
169
|
+
props.showExpandBtn && createVNode("span", {
|
|
171
170
|
"class": `${prefixCls}-cell-inline-icon`,
|
|
172
171
|
"onClick": handleClick
|
|
173
172
|
}, [isLoading.value ? createVNode(IconLoading, null, null) : (_props$renderExpandBt = props.renderExpandBtn) === null || _props$renderExpandBt === void 0 ? void 0 : _props$renderExpandBt.call(props, props.record, false)]),
|
package/es/table/table-th.js
CHANGED
|
@@ -9,13 +9,13 @@ import Checkbox from "../checkbox/index.js";
|
|
|
9
9
|
import Radio from "../radio/index.js";
|
|
10
10
|
import IconCaretDown from "../icon/icon-caret-down/index.js";
|
|
11
11
|
import { tableInjectionKey } from "./context.js";
|
|
12
|
-
import { getFixedCls, getStyle } from "./utils.js";
|
|
12
|
+
import { getFixedCls, getGridSpanStyle, getStyle } from "./utils.js";
|
|
13
13
|
import auto_tooltip_default from "../_components/auto-tooltip/auto-tooltip.js";
|
|
14
14
|
import IconCaretUp from "../icon/icon-caret-up/index.js";
|
|
15
15
|
import IconFilter from "../icon/icon-filter/index.js";
|
|
16
16
|
import { useColumnFilter } from "./hooks/use-column-filter.js";
|
|
17
17
|
import { useColumnSorter } from "./hooks/use-column-sorter.js";
|
|
18
|
-
import {
|
|
18
|
+
import { computed, createVNode, defineComponent, inject, isVNode, mergeProps, toRefs } from "vue";
|
|
19
19
|
//#region components/table/table-th.tsx
|
|
20
20
|
function _isSlot(s) {
|
|
21
21
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
@@ -95,29 +95,17 @@ var table_th_default = /* @__PURE__ */ defineComponent({
|
|
|
95
95
|
var _columnFilterValue$va;
|
|
96
96
|
return createVNode("li", {
|
|
97
97
|
"class": `${prefixCls}-filters-item`,
|
|
98
|
-
"key":
|
|
98
|
+
"key": index
|
|
99
99
|
}, [isMultipleFilter.value ? createVNode(Checkbox, {
|
|
100
100
|
"value": item.value,
|
|
101
101
|
"modelValue": columnFilterValue.value,
|
|
102
102
|
"uninjectGroupContext": true,
|
|
103
|
-
"onChange":
|
|
104
|
-
if (Array.isArray(value)) {
|
|
105
|
-
handleCheckboxFilterChange(value.map(String));
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
throw new Error("Checkbox filter value should be an array");
|
|
109
|
-
}
|
|
103
|
+
"onChange": handleCheckboxFilterChange
|
|
110
104
|
}, { default: () => [item.text] }) : createVNode(Radio, {
|
|
111
105
|
"value": item.value,
|
|
112
106
|
"modelValue": (_columnFilterValue$va = columnFilterValue.value[0]) !== null && _columnFilterValue$va !== void 0 ? _columnFilterValue$va : "",
|
|
113
107
|
"uninjectGroupContext": true,
|
|
114
|
-
"onChange":
|
|
115
|
-
if (typeof value === "string") {
|
|
116
|
-
handleRadioFilterChange(value);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
throw new Error("Radio filter value should be a string");
|
|
120
|
-
}
|
|
108
|
+
"onChange": handleRadioFilterChange
|
|
121
109
|
}, { default: () => [item.text] })]);
|
|
122
110
|
})]), createVNode("div", { "class": `${prefixCls}-filters-bottom` }, [createVNode(Button, {
|
|
123
111
|
"size": "mini",
|
|
@@ -138,14 +126,15 @@ var table_th_default = /* @__PURE__ */ defineComponent({
|
|
|
138
126
|
"popupOffset": filterIconAlignLeft.value ? 4 : 0,
|
|
139
127
|
"onPopupVisibleChange": handleFilterPopupVisibleChange
|
|
140
128
|
}, filterable.triggerProps), {
|
|
141
|
-
default: () => [createVNode(icon_hover_default,
|
|
129
|
+
default: () => [createVNode(icon_hover_default, {
|
|
142
130
|
"class": [`${prefixCls}-filters`, {
|
|
143
131
|
[`${prefixCls}-filters-active`]: isFilterActive.value,
|
|
144
132
|
[`${prefixCls}-filters-open`]: filterPopupVisible.value,
|
|
145
133
|
[`${prefixCls}-filters-align-left`]: filterIconAlignLeft.value
|
|
146
134
|
}],
|
|
147
|
-
"disabled": !filterIconAlignLeft.value
|
|
148
|
-
|
|
135
|
+
"disabled": !filterIconAlignLeft.value,
|
|
136
|
+
"onClick": (ev) => ev.stopPropagation()
|
|
137
|
+
}, { default: () => {
|
|
149
138
|
var _ref, _props$column$slots$f, _props$column$slots3, _props$column$slots3$, _filterable$icon;
|
|
150
139
|
return [(_ref = (_props$column$slots$f = (_props$column$slots3 = props.column.slots) === null || _props$column$slots3 === void 0 || (_props$column$slots3$ = _props$column$slots3["filter-icon"]) === null || _props$column$slots3$ === void 0 ? void 0 : _props$column$slots3$.call(_props$column$slots3)) !== null && _props$column$slots$f !== void 0 ? _props$column$slots$f : (_filterable$icon = filterable.icon) === null || _filterable$icon === void 0 ? void 0 : _filterable$icon.call(filterable)) !== null && _ref !== void 0 ? _ref : createVNode(IconFilter, null, null)];
|
|
151
140
|
} })],
|
|
@@ -173,10 +162,13 @@ var table_th_default = /* @__PURE__ */ defineComponent({
|
|
|
173
162
|
if (isFunction(props.column.title)) return props.column.title();
|
|
174
163
|
return props.column.title;
|
|
175
164
|
};
|
|
176
|
-
const
|
|
165
|
+
const renderCell = () => {
|
|
177
166
|
var _props$column7, _props$column8, _props$column9;
|
|
178
167
|
let _slot3;
|
|
179
|
-
return createVNode(
|
|
168
|
+
return createVNode("span", {
|
|
169
|
+
"class": cellCls.value,
|
|
170
|
+
"onClick": hasSorter.value ? handleClickSorter : void 0
|
|
171
|
+
}, [
|
|
180
172
|
((_props$column7 = props.column) === null || _props$column7 === void 0 ? void 0 : _props$column7.ellipsis) && ((_props$column8 = props.column) === null || _props$column8 === void 0 ? void 0 : _props$column8.tooltip) ? createVNode(auto_tooltip_default, {
|
|
181
173
|
"class": `${prefixCls}-th-title`,
|
|
182
174
|
"tooltipProps": tooltipProps.value
|
|
@@ -185,22 +177,12 @@ var table_th_default = /* @__PURE__ */ defineComponent({
|
|
|
185
177
|
filterIconAlignLeft.value && renderFilter()
|
|
186
178
|
]);
|
|
187
179
|
};
|
|
188
|
-
const renderCell = () => {
|
|
189
|
-
if (hasSorter.value) return createVNode("button", {
|
|
190
|
-
"type": "button",
|
|
191
|
-
"class": cellCls.value,
|
|
192
|
-
"onClick": handleClickSorter
|
|
193
|
-
}, [renderCellContent()]);
|
|
194
|
-
return createVNode("span", { "class": cellCls.value }, [renderCellContent()]);
|
|
195
|
-
};
|
|
196
180
|
const style = computed(() => {
|
|
197
|
-
var _props$
|
|
198
|
-
|
|
199
|
-
const rowSpan = (_props$column$rowSpan = props.column.rowSpan) !== null && _props$column$rowSpan !== void 0 ? _props$column$rowSpan : 1;
|
|
200
|
-
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, getStyle(props.column, {
|
|
181
|
+
var _props$column10, _props$column11;
|
|
182
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, getStyle(props.column, {
|
|
201
183
|
dataColumns: props.dataColumns,
|
|
202
184
|
operations: props.operations
|
|
203
|
-
})),
|
|
185
|
+
})), getGridSpanStyle(props.column.rowSpan, props.column.colSpan)), (_props$column10 = props.column) === null || _props$column10 === void 0 ? void 0 : _props$column10.cellStyle), (_props$column11 = props.column) === null || _props$column11 === void 0 ? void 0 : _props$column11.headerCellStyle);
|
|
204
186
|
});
|
|
205
187
|
const cls = computed(() => {
|
|
206
188
|
var _props$column12, _props$column13;
|
|
@@ -215,10 +197,12 @@ var table_th_default = /* @__PURE__ */ defineComponent({
|
|
|
215
197
|
(_props$column13 = props.column) === null || _props$column13 === void 0 ? void 0 : _props$column13.headerCellClass
|
|
216
198
|
];
|
|
217
199
|
});
|
|
218
|
-
const
|
|
219
|
-
var _props$column14
|
|
220
|
-
if (
|
|
221
|
-
|
|
200
|
+
const handleMouseDown = (ev) => {
|
|
201
|
+
var _props$column14;
|
|
202
|
+
if ((_props$column14 = props.column) === null || _props$column14 === void 0 ? void 0 : _props$column14.dataIndex) {
|
|
203
|
+
var _tableCtx$onThMouseDo, _props$column15;
|
|
204
|
+
(_tableCtx$onThMouseDo = tableCtx.onThMouseDown) === null || _tableCtx$onThMouseDo === void 0 || _tableCtx$onThMouseDo.call(tableCtx, (_props$column15 = props.column) === null || _props$column15 === void 0 ? void 0 : _props$column15.dataIndex, ev);
|
|
205
|
+
}
|
|
222
206
|
};
|
|
223
207
|
return () => {
|
|
224
208
|
var _slots$th$, _slots$th;
|
|
@@ -230,7 +214,7 @@ var table_th_default = /* @__PURE__ */ defineComponent({
|
|
|
230
214
|
!filterIconAlignLeft.value && renderFilter(),
|
|
231
215
|
props.resizable && createVNode("span", {
|
|
232
216
|
"class": `${prefixCls}-column-handle`,
|
|
233
|
-
"
|
|
217
|
+
"onMousedown": handleMouseDown
|
|
234
218
|
}, null)
|
|
235
219
|
] });
|
|
236
220
|
};
|
package/es/table/table-thead.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { getPrefixCls } from "../_utils/global-config.js";
|
|
1
2
|
import { createVNode, defineComponent } from "vue";
|
|
2
3
|
//#region components/table/table-thead.tsx
|
|
3
4
|
var table_thead_default = /* @__PURE__ */ defineComponent({
|
|
4
5
|
name: "Thead",
|
|
5
6
|
setup(_, { slots }) {
|
|
7
|
+
const prefixCls = getPrefixCls("table");
|
|
6
8
|
return () => {
|
|
7
9
|
var _slots$thead$, _slots$thead;
|
|
8
|
-
return createVNode((_slots$thead$ = (_slots$thead = slots.thead) === null || _slots$thead === void 0 ? void 0 : _slots$thead.call(slots)[0]) !== null && _slots$thead$ !== void 0 ? _slots$thead$ : "div", { class:
|
|
10
|
+
return createVNode((_slots$thead$ = (_slots$thead = slots.thead) === null || _slots$thead === void 0 ? void 0 : _slots$thead.call(slots)[0]) !== null && _slots$thead$ !== void 0 ? _slots$thead$ : "div", { class: `${prefixCls}-thead` }, { default: slots.default });
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
13
|
});
|
package/es/table/table.d.ts
CHANGED
|
@@ -2,15 +2,9 @@ import type { PropType } from 'vue';
|
|
|
2
2
|
import type { Size } from '../_utils/constant';
|
|
3
3
|
import type { BaseType } from '../_utils/types';
|
|
4
4
|
import type { TableBorder, TableChangeExtra, TableColumnData, TableComponents, TableData, TableDraggable, TableExpandable, TableOperationColumn, TablePagePosition, TableRowSelection } from './interface';
|
|
5
|
-
import { VirtualListProps } from '../_components/virtual-list/interface';
|
|
5
|
+
import { VirtualListProps } from '../_components/virtual-list-v2/interface';
|
|
6
6
|
import { PaginationProps } from '../pagination';
|
|
7
7
|
import { ScrollbarProps } from '../scrollbar';
|
|
8
|
-
type TableVirtualListProps = VirtualListProps & {
|
|
9
|
-
threshold?: number;
|
|
10
|
-
fixedSize?: boolean;
|
|
11
|
-
estimatedSize?: number;
|
|
12
|
-
itemKey?: string | ((item: unknown, index: number) => string | number);
|
|
13
|
-
};
|
|
14
8
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
9
|
columns: {
|
|
16
10
|
type: PropType<TableColumnData[]>;
|
|
@@ -36,6 +30,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
36
30
|
type: PropType<Size>;
|
|
37
31
|
default: () => "small" | "mini" | "medium" | "large";
|
|
38
32
|
};
|
|
33
|
+
tableLayoutFixed: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
39
37
|
loading: {
|
|
40
38
|
type: (ObjectConstructor | BooleanConstructor)[];
|
|
41
39
|
default: boolean;
|
|
@@ -75,7 +73,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
75
73
|
default: boolean;
|
|
76
74
|
};
|
|
77
75
|
virtualListProps: {
|
|
78
|
-
type: PropType<
|
|
76
|
+
type: PropType<VirtualListProps>;
|
|
79
77
|
};
|
|
80
78
|
spanMethod: {
|
|
81
79
|
type: PropType<(data: {
|
|
@@ -163,10 +161,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
163
161
|
type: PropType<boolean | ScrollbarProps>;
|
|
164
162
|
default: boolean;
|
|
165
163
|
};
|
|
166
|
-
debug: {
|
|
167
|
-
type: BooleanConstructor;
|
|
168
|
-
default: boolean;
|
|
169
|
-
};
|
|
170
164
|
showEmptyTree: {
|
|
171
165
|
type: BooleanConstructor;
|
|
172
166
|
default: boolean;
|
|
@@ -238,6 +232,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
238
232
|
type: PropType<Size>;
|
|
239
233
|
default: () => "small" | "mini" | "medium" | "large";
|
|
240
234
|
};
|
|
235
|
+
tableLayoutFixed: {
|
|
236
|
+
type: BooleanConstructor;
|
|
237
|
+
default: boolean;
|
|
238
|
+
};
|
|
241
239
|
loading: {
|
|
242
240
|
type: (ObjectConstructor | BooleanConstructor)[];
|
|
243
241
|
default: boolean;
|
|
@@ -277,7 +275,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
277
275
|
default: boolean;
|
|
278
276
|
};
|
|
279
277
|
virtualListProps: {
|
|
280
|
-
type: PropType<
|
|
278
|
+
type: PropType<VirtualListProps>;
|
|
281
279
|
};
|
|
282
280
|
spanMethod: {
|
|
283
281
|
type: PropType<(data: {
|
|
@@ -365,10 +363,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
365
363
|
type: PropType<boolean | ScrollbarProps>;
|
|
366
364
|
default: boolean;
|
|
367
365
|
};
|
|
368
|
-
debug: {
|
|
369
|
-
type: BooleanConstructor;
|
|
370
|
-
default: boolean;
|
|
371
|
-
};
|
|
372
366
|
showEmptyTree: {
|
|
373
367
|
type: BooleanConstructor;
|
|
374
368
|
default: boolean;
|
|
@@ -404,11 +398,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
404
398
|
bordered: boolean | TableBorder;
|
|
405
399
|
columns: TableColumnData[];
|
|
406
400
|
hoverable: boolean;
|
|
401
|
+
pagination: boolean | PaginationProps;
|
|
407
402
|
defaultExpandAllRows: boolean;
|
|
408
403
|
indentSize: number;
|
|
409
404
|
filterIconAlignLeft: boolean;
|
|
410
405
|
stripe: boolean;
|
|
411
|
-
|
|
406
|
+
tableLayoutFixed: boolean;
|
|
412
407
|
pagePosition: "top" | "tl" | "tr" | "bottom" | "bl" | "br";
|
|
413
408
|
rowKey: string | ((record: TableData) => BaseType);
|
|
414
409
|
showHeader: boolean;
|
|
@@ -417,7 +412,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
417
412
|
columnResizable: boolean;
|
|
418
413
|
summaryText: string;
|
|
419
414
|
stickyHeader: number | boolean;
|
|
420
|
-
debug: boolean;
|
|
421
415
|
showEmptyTree: boolean;
|
|
422
416
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
423
417
|
export default _default;
|