@antv/s2-vue 2.0.0-next.1 → 2.0.0-next.11
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 +5 -4
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/style.min.css +1 -1
- package/esm/index.d.ts +2724 -1116
- package/esm/index.js +291 -283
- package/esm/index.js.map +1 -1
- package/esm/style.css +67 -53
- package/lib/index.js +294 -286
- package/lib/index.js.map +1 -1
- package/lib/style.css +67 -53
- package/package.json +24 -19
package/esm/index.js
CHANGED
|
@@ -1,81 +1,89 @@
|
|
|
1
|
-
import { S2_PREFIX_CLS, customMerge, DEFAULT_OPTIONS, S2Event, extendLocale, TOOLTIP_PREFIX_CLS, i18n, getIcon, getTooltipDefaultOptions, BaseTooltip, getBaseCellData, TableSheet as TableSheet$1, PivotSheet as PivotSheet$1 } from "@antv/s2";
|
|
1
|
+
import { S2_PREFIX_CLS, customMerge, DEFAULT_OPTIONS, floor, S2Event, extendLocale, TOOLTIP_PREFIX_CLS, i18n, getIcon, getTooltipDefaultOptions, BaseTooltip, getBaseCellData, TableSheet as TableSheet$1, PivotSheet as PivotSheet$1 } from "@antv/s2";
|
|
2
2
|
import { shallowRef, defineComponent, openBlock, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, computed, createTextVNode, resolveComponent, createBlock, withCtx, createVNode, renderSlot, render as render$3, ref, watch, onMounted, reactive, isProxy, onBeforeUnmount, toRaw, toRefs, mergeProps, resolveDynamicComponent } from "vue";
|
|
3
3
|
import { Menu, Dropdown, Pagination, Spin, Button, Input, Empty, MenuItem } from "ant-design-vue";
|
|
4
4
|
const EN_US = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
5
|
+
选择分析信息: "Select Analysis Information",
|
|
6
|
+
切换指标: "Switch indicator",
|
|
7
|
+
确定: "Ok",
|
|
8
|
+
取消: "Cancel",
|
|
9
|
+
重置: "Reset",
|
|
10
|
+
请输入关键字搜索: "Please enter a keyword search",
|
|
11
|
+
搜索: "Search",
|
|
12
|
+
恢复: "Recover",
|
|
13
|
+
"已选 {} 项": "selected {} item",
|
|
14
|
+
所选项: "selected items",
|
|
15
|
+
选择下钻维度: "Select drill down dimension",
|
|
16
|
+
恢复默认: "Restore default",
|
|
17
|
+
搜索字段: "Search field",
|
|
18
|
+
// switcher
|
|
19
|
+
行列切换: "Switch Dimensions",
|
|
20
|
+
行头: "Rows",
|
|
21
|
+
列头: "Cols",
|
|
22
|
+
值: "Values",
|
|
23
|
+
展开子项: "Expand Children",
|
|
24
|
+
// sort
|
|
25
|
+
首字母: "Alphabetical order",
|
|
26
|
+
手动排序: "Custom order",
|
|
27
|
+
其他字段: "Other field",
|
|
28
|
+
高级排序: "Advanced order",
|
|
29
|
+
设置顺序: "SetManual",
|
|
30
|
+
可选字段: "Fields",
|
|
31
|
+
"按以下规则进行排序(优先级由低到高)": "Order according to the following rules (from low to high priority)",
|
|
32
|
+
按: "By",
|
|
33
|
+
说明: "Description: ",
|
|
34
|
+
// export
|
|
35
|
+
复制原始数据: "Copy raw data",
|
|
36
|
+
复制格式化数据: "Copy formatted data",
|
|
37
|
+
下载原始数据: "Download raw data",
|
|
38
|
+
下载格式化数据: "Download formatted data",
|
|
39
|
+
操作成功: "Operation successful",
|
|
40
|
+
操作失败: "Operation failed",
|
|
41
|
+
// strategy
|
|
42
|
+
时间: "Date",
|
|
43
|
+
指标: "Measure",
|
|
44
|
+
目标值: "Target Value"
|
|
41
45
|
};
|
|
42
46
|
const ZH_CN = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
47
|
+
选择分析信息: "选择分析信息",
|
|
48
|
+
切换指标: "切换指标",
|
|
49
|
+
确定: "确定",
|
|
50
|
+
取消: "取消",
|
|
51
|
+
重置: "重置",
|
|
52
|
+
请输入关键字搜索: "请输入关键字搜索",
|
|
53
|
+
搜索: "搜索",
|
|
54
|
+
恢复: "恢复",
|
|
55
|
+
"已选 {} 项": "已选 {} 项",
|
|
56
|
+
所选项: "所选项",
|
|
57
|
+
选择下钻维度: "选择下钻维度",
|
|
58
|
+
恢复默认: "恢复默认",
|
|
59
|
+
搜索字段: "搜索字段",
|
|
60
|
+
// switcher
|
|
61
|
+
行列切换: "行列切换",
|
|
62
|
+
行头: "行头",
|
|
63
|
+
列头: "列头",
|
|
64
|
+
值: "值",
|
|
65
|
+
展开子项: "展开子项",
|
|
66
|
+
// sort
|
|
67
|
+
首字母: "首字母",
|
|
68
|
+
手动排序: "手动排序",
|
|
69
|
+
其他字段: "其他字段",
|
|
70
|
+
高级排序: "高级排序",
|
|
71
|
+
设置顺序: "设置顺序",
|
|
72
|
+
可选字段: "可选字段",
|
|
73
|
+
"按以下规则进行排序(优先级由低到高)": "按以下规则进行排序(优先级由低到高)",
|
|
74
|
+
按: "按",
|
|
75
|
+
说明: "说明:",
|
|
76
|
+
// export
|
|
77
|
+
复制原始数据: "复制原始数据",
|
|
78
|
+
复制格式化数据: "复制格式化数据",
|
|
79
|
+
下载原始数据: "下载原始数据",
|
|
80
|
+
下载格式化数据: "下载格式化数据",
|
|
81
|
+
操作成功: "操作成功",
|
|
82
|
+
操作失败: "操作失败",
|
|
83
|
+
// strategy
|
|
84
|
+
时间: "时间",
|
|
85
|
+
指标: "指标",
|
|
86
|
+
目标值: "目标值"
|
|
79
87
|
};
|
|
80
88
|
const Locale = {
|
|
81
89
|
zh_CN: ZH_CN,
|
|
@@ -83,11 +91,10 @@ const Locale = {
|
|
|
83
91
|
};
|
|
84
92
|
const SHEET_COMPONENT_DEFAULT_OPTIONS = {
|
|
85
93
|
tooltip: {
|
|
86
|
-
|
|
94
|
+
enable: true,
|
|
87
95
|
autoAdjustBoundary: "body",
|
|
88
96
|
operation: {
|
|
89
97
|
hiddenColumns: true,
|
|
90
|
-
trend: false,
|
|
91
98
|
sort: true
|
|
92
99
|
}
|
|
93
100
|
},
|
|
@@ -95,13 +102,11 @@ const SHEET_COMPONENT_DEFAULT_OPTIONS = {
|
|
|
95
102
|
};
|
|
96
103
|
const RESIZE_RENDER_DELAY = 200;
|
|
97
104
|
const DRILL_DOWN_PRE_CLASS = `${S2_PREFIX_CLS}-drill-down`;
|
|
98
|
-
const getBaseSheetComponentOptions = (...options) =>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
+
const getBaseSheetComponentOptions = (...options) => customMerge(
|
|
106
|
+
DEFAULT_OPTIONS,
|
|
107
|
+
SHEET_COMPONENT_DEFAULT_OPTIONS,
|
|
108
|
+
...options
|
|
109
|
+
);
|
|
105
110
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
106
111
|
const freeGlobal$1 = freeGlobal;
|
|
107
112
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
@@ -441,7 +446,11 @@ var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
|
|
441
446
|
function arrayLikeKeys(value, inherited) {
|
|
442
447
|
var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
443
448
|
for (var key in value) {
|
|
444
|
-
if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes &&
|
|
449
|
+
if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
450
|
+
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
451
|
+
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
452
|
+
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
453
|
+
isIndex(key, length)))) {
|
|
445
454
|
result.push(key);
|
|
446
455
|
}
|
|
447
456
|
}
|
|
@@ -1609,7 +1618,7 @@ function size(collection) {
|
|
|
1609
1618
|
return baseKeys(collection).length;
|
|
1610
1619
|
}
|
|
1611
1620
|
const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
1612
|
-
var _a
|
|
1621
|
+
var _a;
|
|
1613
1622
|
if (isBoolean(adaptive)) {
|
|
1614
1623
|
return {
|
|
1615
1624
|
container: defaultContainer,
|
|
@@ -1619,8 +1628,8 @@ const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
|
1619
1628
|
}
|
|
1620
1629
|
return {
|
|
1621
1630
|
container: ((_a = adaptive == null ? void 0 : adaptive.getContainer) == null ? void 0 : _a.call(adaptive)) || defaultContainer,
|
|
1622
|
-
adaptiveWidth: (
|
|
1623
|
-
adaptiveHeight: (
|
|
1631
|
+
adaptiveWidth: (adaptive == null ? void 0 : adaptive.width) ?? true,
|
|
1632
|
+
adaptiveHeight: (adaptive == null ? void 0 : adaptive.height) ?? true
|
|
1624
1633
|
};
|
|
1625
1634
|
};
|
|
1626
1635
|
const createResizeObserver = (params) => {
|
|
@@ -1641,8 +1650,8 @@ const createResizeObserver = (params) => {
|
|
|
1641
1650
|
const debounceRender = debounce(render2, RESIZE_RENDER_DELAY);
|
|
1642
1651
|
const onResize = () => {
|
|
1643
1652
|
const { clientWidth: containerWidth, clientHeight: containerHeight } = container;
|
|
1644
|
-
const width = adaptiveWidth ?
|
|
1645
|
-
const height = adaptiveHeight ?
|
|
1653
|
+
const width = adaptiveWidth ? floor(containerWidth ?? s2.options.width) : s2.options.width;
|
|
1654
|
+
const height = adaptiveHeight ? floor(containerHeight ?? s2.options.height) : s2.options.height;
|
|
1646
1655
|
if (!adaptiveWidth && !adaptiveHeight) {
|
|
1647
1656
|
return;
|
|
1648
1657
|
}
|
|
@@ -1715,21 +1724,23 @@ const buildDrillDownOptions = (options, partDrillDown, callback) => {
|
|
|
1715
1724
|
const nextHeaderIcons = ((_a = options == null ? void 0 : options.headerActionIcons) == null ? void 0 : _a.length) ? [...options.headerActionIcons] : [];
|
|
1716
1725
|
if (!isEmpty(partDrillDown)) {
|
|
1717
1726
|
const drillDownActionIcon = {
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
});
|
|
1727
|
+
icons: [
|
|
1728
|
+
{
|
|
1729
|
+
name: "DrillDownIcon",
|
|
1730
|
+
position: "right",
|
|
1731
|
+
onClick: ({ meta, event }) => {
|
|
1732
|
+
meta.spreadsheet.store.set("drillDownNode", meta);
|
|
1733
|
+
handleActionIconClick({
|
|
1734
|
+
meta,
|
|
1735
|
+
event,
|
|
1736
|
+
callback
|
|
1737
|
+
});
|
|
1738
|
+
}
|
|
1731
1739
|
}
|
|
1732
|
-
|
|
1740
|
+
],
|
|
1741
|
+
belongsCell: "rowCell",
|
|
1742
|
+
defaultHide: false,
|
|
1743
|
+
displayCondition: (partDrillDown == null ? void 0 : partDrillDown.displayCondition) || defaultPartDrillDownDisplayCondition
|
|
1733
1744
|
};
|
|
1734
1745
|
nextHeaderIcons.push(drillDownActionIcon);
|
|
1735
1746
|
}
|
|
@@ -1847,7 +1858,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1847
1858
|
key: col.value
|
|
1848
1859
|
}, toDisplayString(col.value) + "/", 1);
|
|
1849
1860
|
}), 128)),
|
|
1850
|
-
((_c = _ctx.cols) == null ? void 0 : _c.length) > 0 && ((_d = _ctx.rows) == null ? void 0 : _d.length) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$4, "
|
|
1861
|
+
((_c = _ctx.cols) == null ? void 0 : _c.length) > 0 && ((_d = _ctx.rows) == null ? void 0 : _d.length) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$4, ",")) : createCommentVNode("", true),
|
|
1851
1862
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (row) => {
|
|
1852
1863
|
return openBlock(), createElementBlock("span", {
|
|
1853
1864
|
key: row.value
|
|
@@ -1929,8 +1940,8 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1929
1940
|
}, [
|
|
1930
1941
|
createElementVNode("span", {
|
|
1931
1942
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-selected`)
|
|
1932
|
-
}, toDisplayString(_ctx.summaryInfo.count) + " " + toDisplayString(_ctx.i18n("
|
|
1933
|
-
createTextVNode(" " + toDisplayString(_ctx.i18n("
|
|
1943
|
+
}, toDisplayString(_ctx.summaryInfo.count) + " " + toDisplayString(_ctx.i18n("项")), 3),
|
|
1944
|
+
createTextVNode(" " + toDisplayString(_ctx.i18n("已选择")), 1)
|
|
1934
1945
|
], 2),
|
|
1935
1946
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.summaryInfo.summaries, (summary) => {
|
|
1936
1947
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1939,7 +1950,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1939
1950
|
}, [
|
|
1940
1951
|
createElementVNode("span", {
|
|
1941
1952
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-key`)
|
|
1942
|
-
}, toDisplayString(summary.name) + " (" + toDisplayString(_ctx.i18n("
|
|
1953
|
+
}, toDisplayString(summary.name) + " (" + toDisplayString(_ctx.i18n("总和")) + ") ", 3),
|
|
1943
1954
|
createElementVNode("span", {
|
|
1944
1955
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-val ${_ctx.TOOLTIP_PREFIX_CLS}-bold`)
|
|
1945
1956
|
}, toDisplayString(summary.value), 3)
|
|
@@ -1969,7 +1980,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1969
1980
|
}, null, 10, _hoisted_1$3)) : createCommentVNode("", true),
|
|
1970
1981
|
createElementVNode("span", {
|
|
1971
1982
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-text`)
|
|
1972
|
-
}, toDisplayString(_ctx.menu.
|
|
1983
|
+
}, toDisplayString(_ctx.menu.label), 3)
|
|
1973
1984
|
]);
|
|
1974
1985
|
}
|
|
1975
1986
|
const TooltipOperatorTitle = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9]]);
|
|
@@ -1977,9 +1988,10 @@ const _sfc_main$8 = defineComponent({
|
|
|
1977
1988
|
name: "TooltipOperatorMenu",
|
|
1978
1989
|
props: ["menu", "cell"],
|
|
1979
1990
|
setup(props) {
|
|
1991
|
+
const { menu, cell } = props;
|
|
1980
1992
|
const onMenuTitleClick = () => {
|
|
1981
1993
|
var _a, _b;
|
|
1982
|
-
(_b = (_a = props.menu).onClick) == null ? void 0 : _b.call(_a,
|
|
1994
|
+
(_b = (_a = props.menu).onClick) == null ? void 0 : _b.call(_a, menu, cell);
|
|
1983
1995
|
};
|
|
1984
1996
|
return {
|
|
1985
1997
|
onMenuTitleClick,
|
|
@@ -2021,7 +2033,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2021
2033
|
menu: subMenu,
|
|
2022
2034
|
cell: _ctx.cell
|
|
2023
2035
|
}, null, 8, ["menu", "cell"])) : (openBlock(), createBlock(_component_MenuItem, {
|
|
2024
|
-
title: subMenu.
|
|
2036
|
+
title: subMenu.label,
|
|
2025
2037
|
key: subMenu.key
|
|
2026
2038
|
}, {
|
|
2027
2039
|
default: withCtx(() => [
|
|
@@ -2038,7 +2050,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2038
2050
|
_: 1
|
|
2039
2051
|
}, 8, ["popupClassName", "onTitleClick"])) : createCommentVNode("", true),
|
|
2040
2052
|
_ctx.isEmpty(_ctx.menu.children) ? (openBlock(), createBlock(_component_MenuItem, {
|
|
2041
|
-
title: _ctx.menu.
|
|
2053
|
+
title: _ctx.menu.label,
|
|
2042
2054
|
key: _ctx.menu.key
|
|
2043
2055
|
}, {
|
|
2044
2056
|
default: withCtx(() => [
|
|
@@ -2055,18 +2067,24 @@ const TooltipOperatorMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render",
|
|
|
2055
2067
|
const _sfc_main$7 = defineComponent({
|
|
2056
2068
|
name: "TooltipOperator",
|
|
2057
2069
|
props: [
|
|
2058
|
-
"
|
|
2059
|
-
"
|
|
2060
|
-
"onClick",
|
|
2070
|
+
"menu",
|
|
2071
|
+
"onlyShowOperator",
|
|
2061
2072
|
"cell"
|
|
2062
2073
|
],
|
|
2063
|
-
setup(
|
|
2074
|
+
setup(props) {
|
|
2075
|
+
const { menu, cell } = props;
|
|
2064
2076
|
const onMenuClick = (menuInfo) => {
|
|
2065
|
-
|
|
2077
|
+
var _a;
|
|
2078
|
+
(_a = menu == null ? void 0 : menu.onClick) == null ? void 0 : _a.call(menu, menuInfo, cell);
|
|
2079
|
+
};
|
|
2080
|
+
const onMenuTitleClick = (subMenu) => () => {
|
|
2081
|
+
subMenu == null ? void 0 : subMenu.onClick(subMenu, cell);
|
|
2066
2082
|
};
|
|
2067
2083
|
return {
|
|
2068
2084
|
TOOLTIP_PREFIX_CLS,
|
|
2069
|
-
onMenuClick
|
|
2085
|
+
onMenuClick,
|
|
2086
|
+
onMenuTitleClick,
|
|
2087
|
+
menus: menu == null ? void 0 : menu.items
|
|
2070
2088
|
};
|
|
2071
2089
|
},
|
|
2072
2090
|
components: {
|
|
@@ -2085,7 +2103,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2085
2103
|
return openBlock(), createElementBlock("div", {
|
|
2086
2104
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator`)
|
|
2087
2105
|
}, [
|
|
2088
|
-
_ctx.
|
|
2106
|
+
_ctx.onlyShowOperator ? (openBlock(), createBlock(_component_Menu, {
|
|
2089
2107
|
key: 0,
|
|
2090
2108
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-menus`),
|
|
2091
2109
|
onClick: _ctx.onMenuClick
|
|
@@ -2129,10 +2147,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2129
2147
|
default: withCtx(() => [
|
|
2130
2148
|
createVNode(_component_TooltipOperatorTitle, {
|
|
2131
2149
|
menu,
|
|
2132
|
-
onClick: ($event) =>
|
|
2133
|
-
var _a;
|
|
2134
|
-
return (_a = menu.onClick) == null ? void 0 : _a.call(menu, _ctx.cell);
|
|
2135
|
-
}
|
|
2150
|
+
onClick: ($event) => _ctx.onMenuTitleClick(menu)
|
|
2136
2151
|
}, null, 8, ["menu", "onClick"])
|
|
2137
2152
|
]),
|
|
2138
2153
|
_: 2
|
|
@@ -2152,10 +2167,12 @@ const _sfc_main$6 = defineComponent({
|
|
|
2152
2167
|
"content"
|
|
2153
2168
|
],
|
|
2154
2169
|
setup(props) {
|
|
2155
|
-
const { operator,
|
|
2170
|
+
const { operator, onlyShowOperator } = getTooltipDefaultOptions(
|
|
2171
|
+
props.options
|
|
2172
|
+
);
|
|
2156
2173
|
return {
|
|
2157
2174
|
operator,
|
|
2158
|
-
|
|
2175
|
+
onlyShowOperator
|
|
2159
2176
|
};
|
|
2160
2177
|
},
|
|
2161
2178
|
components: {
|
|
@@ -2169,45 +2186,43 @@ const _sfc_main$6 = defineComponent({
|
|
|
2169
2186
|
});
|
|
2170
2187
|
const index_vue_vue_type_style_index_0_lang = "";
|
|
2171
2188
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2172
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n
|
|
2189
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
2173
2190
|
const _component_TooltipOperator = resolveComponent("TooltipOperator");
|
|
2174
2191
|
const _component_TooltipSimpleTips = resolveComponent("TooltipSimpleTips");
|
|
2175
2192
|
const _component_TooltipSummary = resolveComponent("TooltipSummary");
|
|
2176
2193
|
const _component_TooltipHeadInfo = resolveComponent("TooltipHeadInfo");
|
|
2177
2194
|
const _component_TooltipDetail = resolveComponent("TooltipDetail");
|
|
2178
2195
|
const _component_TooltipInfos = resolveComponent("TooltipInfos");
|
|
2179
|
-
return _ctx.
|
|
2196
|
+
return _ctx.onlyShowOperator ? (openBlock(), createBlock(_component_TooltipOperator, {
|
|
2180
2197
|
key: 0,
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
cell: _ctx.cell
|
|
2184
|
-
|
|
2185
|
-
}, null, 8, ["menus", "cell", "onClick"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2198
|
+
menu: (_a = _ctx.operator) == null ? void 0 : _a.menu,
|
|
2199
|
+
onlyShowOperator: true,
|
|
2200
|
+
cell: _ctx.cell
|
|
2201
|
+
}, null, 8, ["menu", "cell"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2186
2202
|
createVNode(_component_TooltipOperator, {
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
cell: _ctx.cell
|
|
2190
|
-
|
|
2191
|
-
}, null, 8, ["menus", "cell", "onClick"]),
|
|
2203
|
+
menu: (_b = _ctx.operator) == null ? void 0 : _b.menu,
|
|
2204
|
+
onlyShowOperator: false,
|
|
2205
|
+
cell: _ctx.cell
|
|
2206
|
+
}, null, 8, ["menu", "cell"]),
|
|
2192
2207
|
_ctx.content ? renderSlot(_ctx.$slots, "content", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2193
2208
|
createVNode(_component_TooltipSimpleTips, {
|
|
2194
|
-
name: (
|
|
2195
|
-
tips: (
|
|
2209
|
+
name: (_c = _ctx.data) == null ? void 0 : _c.name,
|
|
2210
|
+
tips: (_d = _ctx.data) == null ? void 0 : _d.tips
|
|
2196
2211
|
}, null, 8, ["name", "tips"]),
|
|
2197
|
-
((
|
|
2212
|
+
((_f = (_e = _ctx.data) == null ? void 0 : _e.summaries) == null ? void 0 : _f.length) ? (openBlock(), createBlock(_component_TooltipSummary, {
|
|
2198
2213
|
key: 0,
|
|
2199
|
-
summaries: (
|
|
2214
|
+
summaries: (_g = _ctx.data) == null ? void 0 : _g.summaries
|
|
2200
2215
|
}, null, 8, ["summaries"])) : createCommentVNode("", true),
|
|
2201
2216
|
createVNode(_component_TooltipHeadInfo, {
|
|
2202
|
-
rows: ((
|
|
2203
|
-
cols: ((
|
|
2217
|
+
rows: ((_i = (_h = _ctx.data) == null ? void 0 : _h.headInfo) == null ? void 0 : _i.rows) || [],
|
|
2218
|
+
cols: ((_k = (_j = _ctx.data) == null ? void 0 : _j.headInfo) == null ? void 0 : _k.cols) || []
|
|
2204
2219
|
}, null, 8, ["rows", "cols"]),
|
|
2205
2220
|
createVNode(_component_TooltipDetail, {
|
|
2206
|
-
list: ((
|
|
2221
|
+
list: ((_l = _ctx.data) == null ? void 0 : _l.details) || []
|
|
2207
2222
|
}, null, 8, ["list"]),
|
|
2208
|
-
((
|
|
2223
|
+
((_m = _ctx.data) == null ? void 0 : _m.infos) ? (openBlock(), createBlock(_component_TooltipInfos, {
|
|
2209
2224
|
key: 1,
|
|
2210
|
-
infos: (
|
|
2225
|
+
infos: (_n = _ctx.data) == null ? void 0 : _n.infos
|
|
2211
2226
|
}, null, 8, ["infos"])) : createCommentVNode("", true)
|
|
2212
2227
|
], 64))
|
|
2213
2228
|
], 64));
|
|
@@ -2218,13 +2233,13 @@ class CustomTooltip extends BaseTooltip {
|
|
|
2218
2233
|
super(spreadsheet);
|
|
2219
2234
|
}
|
|
2220
2235
|
renderContent() {
|
|
2221
|
-
var _a
|
|
2236
|
+
var _a;
|
|
2222
2237
|
const { tooltip } = this.spreadsheet.options;
|
|
2223
2238
|
const showOptions = this.options;
|
|
2224
2239
|
const cell = this.spreadsheet.getCell(
|
|
2225
2240
|
(_a = showOptions.event) == null ? void 0 : _a.target
|
|
2226
2241
|
);
|
|
2227
|
-
const content =
|
|
2242
|
+
const content = showOptions.content ?? (tooltip == null ? void 0 : tooltip.content);
|
|
2228
2243
|
const tooltipProps = {
|
|
2229
2244
|
...showOptions,
|
|
2230
2245
|
cell,
|
|
@@ -2250,12 +2265,12 @@ class CustomTooltip extends BaseTooltip {
|
|
|
2250
2265
|
const DEFAULT_PAGE_NUMBER = 1;
|
|
2251
2266
|
const DEFAULT_PAGE_SIZE = 10;
|
|
2252
2267
|
const usePagination = (s2Ref, props) => {
|
|
2253
|
-
var _a, _b, _c, _d
|
|
2268
|
+
var _a, _b, _c, _d;
|
|
2254
2269
|
const current = ref(
|
|
2255
|
-
(
|
|
2270
|
+
((_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) ?? DEFAULT_PAGE_NUMBER
|
|
2256
2271
|
);
|
|
2257
2272
|
const pageSize = ref(
|
|
2258
|
-
(
|
|
2273
|
+
((_d = (_c = props.options) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageSize) ?? DEFAULT_PAGE_SIZE
|
|
2259
2274
|
);
|
|
2260
2275
|
const total = ref(0);
|
|
2261
2276
|
const change = (nextCurrent) => {
|
|
@@ -2264,10 +2279,12 @@ const usePagination = (s2Ref, props) => {
|
|
|
2264
2279
|
const showSizeChange = (nextPageSize) => {
|
|
2265
2280
|
pageSize.value = nextPageSize;
|
|
2266
2281
|
};
|
|
2267
|
-
const visible = computed(
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2282
|
+
const visible = computed(
|
|
2283
|
+
() => {
|
|
2284
|
+
var _a2;
|
|
2285
|
+
return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
|
|
2286
|
+
}
|
|
2287
|
+
);
|
|
2271
2288
|
watch([current, pageSize], () => {
|
|
2272
2289
|
var _a2;
|
|
2273
2290
|
if (!s2Ref.value) {
|
|
@@ -2286,10 +2303,10 @@ const usePagination = (s2Ref, props) => {
|
|
|
2286
2303
|
return (_a2 = props.options) == null ? void 0 : _a2.pagination;
|
|
2287
2304
|
}, s2Ref],
|
|
2288
2305
|
() => {
|
|
2289
|
-
var _a2, _b2, _c2, _d2,
|
|
2290
|
-
current.value = (
|
|
2291
|
-
pageSize.value = (
|
|
2292
|
-
total.value = (
|
|
2306
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
|
2307
|
+
current.value = ((_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) ?? DEFAULT_PAGE_NUMBER;
|
|
2308
|
+
pageSize.value = ((_d2 = (_c2 = props.options) == null ? void 0 : _c2.pagination) == null ? void 0 : _d2.pageSize) ?? DEFAULT_PAGE_SIZE;
|
|
2309
|
+
total.value = ((_f = (_e = s2Ref.value) == null ? void 0 : _e.facet) == null ? void 0 : _f.viewCellHeights.getTotalLength()) ?? 0;
|
|
2293
2310
|
},
|
|
2294
2311
|
{
|
|
2295
2312
|
immediate: true
|
|
@@ -2340,9 +2357,7 @@ const _sfc_main$5 = defineComponent({
|
|
|
2340
2357
|
},
|
|
2341
2358
|
emits: ["change", "showSizeChange"],
|
|
2342
2359
|
setup: (props) => {
|
|
2343
|
-
const showQuickJumper = computed(() =>
|
|
2344
|
-
return props.total / props.pageSize > 5;
|
|
2345
|
-
});
|
|
2360
|
+
const showQuickJumper = computed(() => props.total / props.pageSize > 5);
|
|
2346
2361
|
return {
|
|
2347
2362
|
showQuickJumper,
|
|
2348
2363
|
PRE_CLASS,
|
|
@@ -2371,13 +2386,13 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2371
2386
|
}, null, 8, ["current", "total", "pageSize", "showQuickJumper"]),
|
|
2372
2387
|
createElementVNode("span", {
|
|
2373
2388
|
class: normalizeClass(`${_ctx.PRE_CLASS}-count`)
|
|
2374
|
-
}, toDisplayString(_ctx.i18n("
|
|
2389
|
+
}, toDisplayString(_ctx.i18n("共计")) + " " + toDisplayString(_ctx.total || " - ") + " " + toDisplayString(_ctx.i18n("条")), 3)
|
|
2375
2390
|
], 2);
|
|
2376
2391
|
}
|
|
2377
2392
|
const S2Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
|
|
2378
2393
|
const RENDER_TOOLTIP_OPTION = {
|
|
2379
2394
|
tooltip: {
|
|
2380
|
-
|
|
2395
|
+
render: (spreadsheet) => new CustomTooltip(spreadsheet)
|
|
2381
2396
|
}
|
|
2382
2397
|
};
|
|
2383
2398
|
const getSheetComponentOptions = (...options) => getBaseSheetComponentOptions(RENDER_TOOLTIP_OPTION, ...options);
|
|
@@ -2418,11 +2433,12 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2418
2433
|
useCellEvent(s2Ref, emit, S2Event.ROW_CELL_MOUSE_DOWN, "rowCellMouseDown");
|
|
2419
2434
|
useCellEvent(s2Ref, emit, S2Event.ROW_CELL_MOUSE_UP, "rowCellMouseUp");
|
|
2420
2435
|
useCellEvent(s2Ref, emit, S2Event.ROW_CELL_MOUSE_MOVE, "rowCellMouseMove");
|
|
2436
|
+
useS2Event(s2Ref, emit, S2Event.ROW_CELL_COLLAPSED, "rowCellCollapsed");
|
|
2421
2437
|
useS2Event(
|
|
2422
2438
|
s2Ref,
|
|
2423
2439
|
emit,
|
|
2424
|
-
S2Event.
|
|
2425
|
-
"
|
|
2440
|
+
S2Event.ROW_CELL_ALL_COLLAPSED,
|
|
2441
|
+
"rowCellAllCollapsed"
|
|
2426
2442
|
);
|
|
2427
2443
|
useS2Event(s2Ref, emit, S2Event.ROW_CELL_SCROLL, "rowCellScroll");
|
|
2428
2444
|
useCellEvent(s2Ref, emit, S2Event.COL_CELL_HOVER, "colCellHover");
|
|
@@ -2442,6 +2458,8 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2442
2458
|
useCellEvent(s2Ref, emit, S2Event.COL_CELL_MOUSE_DOWN, "colCellMouseDown");
|
|
2443
2459
|
useCellEvent(s2Ref, emit, S2Event.COL_CELL_MOUSE_UP, "colCellMouseUp");
|
|
2444
2460
|
useCellEvent(s2Ref, emit, S2Event.COL_CELL_MOUSE_MOVE, "colCellMouseMove");
|
|
2461
|
+
useS2Event(s2Ref, emit, S2Event.COL_CELL_EXPANDED, "colCellExpanded");
|
|
2462
|
+
useS2Event(s2Ref, emit, S2Event.COL_CELL_HIDDEN, "colCellHidden");
|
|
2445
2463
|
useCellEvent(s2Ref, emit, S2Event.DATA_CELL_HOVER, "dataCellHover");
|
|
2446
2464
|
useCellEvent(s2Ref, emit, S2Event.DATA_CELL_CLICK, "dataCellClick");
|
|
2447
2465
|
useCellEvent(
|
|
@@ -2469,12 +2487,6 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2469
2487
|
S2Event.DATA_CELL_MOUSE_MOVE,
|
|
2470
2488
|
"dataCellMouseMove"
|
|
2471
2489
|
);
|
|
2472
|
-
useS2Event(
|
|
2473
|
-
s2Ref,
|
|
2474
|
-
emit,
|
|
2475
|
-
S2Event.DATA_CELL_TREND_ICON_CLICK,
|
|
2476
|
-
"dataCellTrendIconClick"
|
|
2477
|
-
);
|
|
2478
2490
|
useS2Event(
|
|
2479
2491
|
s2Ref,
|
|
2480
2492
|
emit,
|
|
@@ -2562,21 +2574,6 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2562
2574
|
"layoutAfterHeaderLayout"
|
|
2563
2575
|
);
|
|
2564
2576
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_PAGINATION, "layoutPagination");
|
|
2565
|
-
useS2Event(s2Ref, emit, S2Event.LAYOUT_CELL_SCROLL, "layoutCellScroll");
|
|
2566
|
-
useS2Event(
|
|
2567
|
-
s2Ref,
|
|
2568
|
-
emit,
|
|
2569
|
-
S2Event.LAYOUT_AFTER_COLLAPSE_ROWS,
|
|
2570
|
-
"layoutAfterCollapseRows"
|
|
2571
|
-
);
|
|
2572
|
-
useS2Event(
|
|
2573
|
-
s2Ref,
|
|
2574
|
-
emit,
|
|
2575
|
-
S2Event.LAYOUT_TREE_ROWS_COLLAPSE_ALL,
|
|
2576
|
-
"collapseRowsAll"
|
|
2577
|
-
);
|
|
2578
|
-
useS2Event(s2Ref, emit, S2Event.LAYOUT_COLS_EXPANDED, "layoutColsExpanded");
|
|
2579
|
-
useS2Event(s2Ref, emit, S2Event.LAYOUT_COLS_HIDDEN, "layoutColsHidden");
|
|
2580
2577
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_BEFORE_RENDER, "beforeRender");
|
|
2581
2578
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_AFTER_RENDER, "afterRender");
|
|
2582
2579
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_DESTROY, "destroy");
|
|
@@ -2659,6 +2656,12 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2659
2656
|
useS2Event(s2Ref, emit, S2Event.GLOBAL_RESET, "reset");
|
|
2660
2657
|
useS2Event(s2Ref, emit, S2Event.GLOBAL_LINK_FIELD_JUMP, "linkFieldJump");
|
|
2661
2658
|
useS2Event(s2Ref, emit, S2Event.GLOBAL_SCROLL, "scroll");
|
|
2659
|
+
useS2Event(
|
|
2660
|
+
s2Ref,
|
|
2661
|
+
emit,
|
|
2662
|
+
S2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDER,
|
|
2663
|
+
"layoutAfterRealDataCellRender"
|
|
2664
|
+
);
|
|
2662
2665
|
useS2Event(
|
|
2663
2666
|
s2Ref,
|
|
2664
2667
|
emit,
|
|
@@ -2713,7 +2716,7 @@ const useSheetUpdate = (s2Ref, props) => {
|
|
|
2713
2716
|
(dataCfg, prevDataCfg) => {
|
|
2714
2717
|
var _a, _b, _c, _d, _e, _f;
|
|
2715
2718
|
if (((_b = (_a = prevDataCfg == null ? void 0 : prevDataCfg.fields) == null ? void 0 : _a.columns) == null ? void 0 : _b.length) !== ((_d = (_c = dataCfg == null ? void 0 : dataCfg.fields) == null ? void 0 : _c.columns) == null ? void 0 : _d.length)) {
|
|
2716
|
-
(_e = s2Ref.value) == null ? void 0 : _e.
|
|
2719
|
+
(_e = s2Ref.value) == null ? void 0 : _e.facet.clearInitColLeafNodes();
|
|
2717
2720
|
}
|
|
2718
2721
|
updateFlag.rerender = true;
|
|
2719
2722
|
updateFlag.reloadData = true;
|
|
@@ -2737,7 +2740,8 @@ const useSheetUpdate = (s2Ref, props) => {
|
|
|
2737
2740
|
if (!flag.rerender) {
|
|
2738
2741
|
return;
|
|
2739
2742
|
}
|
|
2740
|
-
(_a = s2Ref.value) == null ? void 0 : _a.render(
|
|
2743
|
+
(_a = s2Ref.value) == null ? void 0 : _a.render({
|
|
2744
|
+
reloadData: flag.reloadData,
|
|
2741
2745
|
reBuildDataSet: flag.rebuildDataset
|
|
2742
2746
|
});
|
|
2743
2747
|
flag.rerender = false;
|
|
@@ -2747,25 +2751,21 @@ const useSheetUpdate = (s2Ref, props) => {
|
|
|
2747
2751
|
};
|
|
2748
2752
|
const useResize = (s2Ref, props, dom) => {
|
|
2749
2753
|
const unobserve = ref();
|
|
2750
|
-
watch(
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
});
|
|
2766
|
-
},
|
|
2767
|
-
{ deep: true }
|
|
2768
|
-
);
|
|
2754
|
+
watch([s2Ref, () => props.adaptive], ([s2, adaptive], _, onCleanup) => {
|
|
2755
|
+
if (!s2) {
|
|
2756
|
+
return;
|
|
2757
|
+
}
|
|
2758
|
+
unobserve.value = createResizeObserver({
|
|
2759
|
+
s2,
|
|
2760
|
+
adaptive,
|
|
2761
|
+
wrapper: dom.wrapperRef.value,
|
|
2762
|
+
container: dom.containerRef.value
|
|
2763
|
+
});
|
|
2764
|
+
onCleanup(() => {
|
|
2765
|
+
var _a;
|
|
2766
|
+
(_a = unobserve.value) == null ? void 0 : _a.call(unobserve);
|
|
2767
|
+
});
|
|
2768
|
+
});
|
|
2769
2769
|
};
|
|
2770
2770
|
function useSpreadSheet(props, emit) {
|
|
2771
2771
|
const {
|
|
@@ -2774,9 +2774,8 @@ function useSpreadSheet(props, emit) {
|
|
|
2774
2774
|
themeCfg,
|
|
2775
2775
|
loading: loadingProps,
|
|
2776
2776
|
sheetType,
|
|
2777
|
-
|
|
2778
|
-
onMounted: onS2Mounted
|
|
2779
|
-
onGetSpreadSheet
|
|
2777
|
+
spreadsheet: customSpreadSheet,
|
|
2778
|
+
onMounted: onS2Mounted
|
|
2780
2779
|
} = props;
|
|
2781
2780
|
const wrapperRef = ref();
|
|
2782
2781
|
const containerRef = ref();
|
|
@@ -2787,8 +2786,8 @@ function useSpreadSheet(props, emit) {
|
|
|
2787
2786
|
const rawDataCfg = toRaw(dataCfg);
|
|
2788
2787
|
const rawOptions = toRaw(options);
|
|
2789
2788
|
const s2Options = getSheetComponentOptions(rawOptions);
|
|
2790
|
-
if (
|
|
2791
|
-
return
|
|
2789
|
+
if (customSpreadSheet) {
|
|
2790
|
+
return customSpreadSheet(container, rawDataCfg, s2Options);
|
|
2792
2791
|
}
|
|
2793
2792
|
if (sheetType === "table") {
|
|
2794
2793
|
return new TableSheet$1(container, rawDataCfg, s2Options);
|
|
@@ -2801,7 +2800,6 @@ function useSpreadSheet(props, emit) {
|
|
|
2801
2800
|
s2Ref.value.setThemeCfg(toRaw(themeCfg));
|
|
2802
2801
|
s2Ref.value.render();
|
|
2803
2802
|
setLoading(false);
|
|
2804
|
-
onGetSpreadSheet == null ? void 0 : onGetSpreadSheet(s2Ref.value);
|
|
2805
2803
|
onS2Mounted == null ? void 0 : onS2Mounted(s2Ref.value);
|
|
2806
2804
|
};
|
|
2807
2805
|
onMounted(buildSpreadSheet);
|
|
@@ -2821,53 +2819,56 @@ function useSpreadSheet(props, emit) {
|
|
|
2821
2819
|
pagination
|
|
2822
2820
|
};
|
|
2823
2821
|
}
|
|
2824
|
-
const initBaseSheetProps = () =>
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
}
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2822
|
+
const initBaseSheetProps = () => {
|
|
2823
|
+
return {
|
|
2824
|
+
sheetType: String,
|
|
2825
|
+
dataCfg: Object,
|
|
2826
|
+
themeCfg: Object,
|
|
2827
|
+
showPagination: {
|
|
2828
|
+
type: [Object, Boolean],
|
|
2829
|
+
default: false
|
|
2830
|
+
},
|
|
2831
|
+
loading: Boolean,
|
|
2832
|
+
partDrillDown: Object,
|
|
2833
|
+
header: Object,
|
|
2834
|
+
options: {
|
|
2835
|
+
type: Object,
|
|
2836
|
+
default: {}
|
|
2837
|
+
},
|
|
2838
|
+
adaptive: {
|
|
2839
|
+
type: [Object, Boolean],
|
|
2840
|
+
default: false
|
|
2841
|
+
},
|
|
2842
|
+
spreadsheet: Function,
|
|
2843
|
+
onMounted: Function
|
|
2844
|
+
};
|
|
2845
|
+
};
|
|
2846
|
+
const initDrillDownProps = () => {
|
|
2847
|
+
return {
|
|
2848
|
+
className: String,
|
|
2849
|
+
titleText: {
|
|
2850
|
+
type: String,
|
|
2851
|
+
default: i18n("选择下钻维度")
|
|
2852
|
+
},
|
|
2853
|
+
searchText: {
|
|
2854
|
+
type: String,
|
|
2855
|
+
default: i18n("搜索字段")
|
|
2856
|
+
},
|
|
2857
|
+
clearButtonText: {
|
|
2858
|
+
type: String,
|
|
2859
|
+
default: i18n("恢复默认")
|
|
2860
|
+
},
|
|
2861
|
+
extra: Node,
|
|
2862
|
+
dataSet: {
|
|
2863
|
+
type: Array,
|
|
2864
|
+
default: []
|
|
2865
|
+
},
|
|
2866
|
+
drillFields: Array,
|
|
2867
|
+
disabledFields: Array,
|
|
2868
|
+
getDrillFields: Function,
|
|
2869
|
+
setDrillFields: Function
|
|
2870
|
+
};
|
|
2871
|
+
};
|
|
2871
2872
|
const initDrillDownEmits = () => {
|
|
2872
2873
|
const keys2 = ["getDrillFields", "setDrillFields"];
|
|
2873
2874
|
return keys2;
|
|
@@ -2875,7 +2876,7 @@ const initDrillDownEmits = () => {
|
|
|
2875
2876
|
const initBaseSheetEmits = () => {
|
|
2876
2877
|
const keys2 = [
|
|
2877
2878
|
"spreadsheet",
|
|
2878
|
-
|
|
2879
|
+
// ============== Row Cell ====================
|
|
2879
2880
|
"rowCellHover",
|
|
2880
2881
|
"rowCellClick",
|
|
2881
2882
|
"rowCellDoubleClick",
|
|
@@ -2883,8 +2884,10 @@ const initBaseSheetEmits = () => {
|
|
|
2883
2884
|
"rowCellMouseDown",
|
|
2884
2885
|
"rowCellMouseUp",
|
|
2885
2886
|
"rowCellMouseMove",
|
|
2886
|
-
"
|
|
2887
|
+
"rowCellCollapsed",
|
|
2888
|
+
"rowCellAllCollapsed",
|
|
2887
2889
|
"rowCellScroll",
|
|
2890
|
+
// ============== Col Cell ====================
|
|
2888
2891
|
"colCellHover",
|
|
2889
2892
|
"colCellClick",
|
|
2890
2893
|
"colCellDoubleClick",
|
|
@@ -2892,6 +2895,9 @@ const initBaseSheetEmits = () => {
|
|
|
2892
2895
|
"colCellMouseDown",
|
|
2893
2896
|
"colCellMouseUp",
|
|
2894
2897
|
"colCellMouseMove",
|
|
2898
|
+
"colCellExpanded",
|
|
2899
|
+
"colCellHidden",
|
|
2900
|
+
// ============== Data Cell ====================
|
|
2895
2901
|
"dataCellHover",
|
|
2896
2902
|
"dataCellClick",
|
|
2897
2903
|
"dataCellDoubleClick",
|
|
@@ -2899,9 +2905,9 @@ const initBaseSheetEmits = () => {
|
|
|
2899
2905
|
"dataCellMouseDown",
|
|
2900
2906
|
"dataCellMouseUp",
|
|
2901
2907
|
"dataCellMouseMove",
|
|
2902
|
-
"dataCellTrendIconClick",
|
|
2903
2908
|
"dataCellBrushSelection",
|
|
2904
2909
|
"dataCellSelectMove",
|
|
2910
|
+
// ============== Corner Cell ====================
|
|
2905
2911
|
"cornerCellHover",
|
|
2906
2912
|
"cornerCellClick",
|
|
2907
2913
|
"cornerCellDoubleClick",
|
|
@@ -2909,6 +2915,7 @@ const initBaseSheetEmits = () => {
|
|
|
2909
2915
|
"cornerCellMouseDown",
|
|
2910
2916
|
"cornerCellMouseUp",
|
|
2911
2917
|
"cornerCellMouseMove",
|
|
2918
|
+
// ============== Merged Cells ====================
|
|
2912
2919
|
"mergedCellsHover",
|
|
2913
2920
|
"mergedCellsClick",
|
|
2914
2921
|
"mergedCellsDoubleClick",
|
|
@@ -2916,22 +2923,20 @@ const initBaseSheetEmits = () => {
|
|
|
2916
2923
|
"mergedCellsMouseDown",
|
|
2917
2924
|
"mergedCellsMouseUp",
|
|
2918
2925
|
"mergedCellsMouseMove",
|
|
2926
|
+
// ============== Sort ====================
|
|
2919
2927
|
"rangeSort",
|
|
2920
2928
|
"rangeSorted",
|
|
2929
|
+
// ============== Filter ====================
|
|
2921
2930
|
"rangeFilter",
|
|
2922
2931
|
"rangeFiltered",
|
|
2932
|
+
// ============== Layout ====================
|
|
2923
2933
|
"layoutAfterHeaderLayout",
|
|
2924
2934
|
"layoutPagination",
|
|
2925
|
-
"layoutCellScroll",
|
|
2926
|
-
"layoutCollapseRows",
|
|
2927
|
-
"layoutAfterCollapseRows",
|
|
2928
|
-
"collapseRowsAll",
|
|
2929
|
-
"layoutColsExpanded",
|
|
2930
|
-
"layoutColsHidden",
|
|
2931
2935
|
"beforeRender",
|
|
2932
2936
|
"afterRender",
|
|
2933
2937
|
"mounted",
|
|
2934
2938
|
"destroy",
|
|
2939
|
+
// ============== Resize ====================
|
|
2935
2940
|
"layoutResize",
|
|
2936
2941
|
"layoutResizeSeriesWidth",
|
|
2937
2942
|
"layoutResizeRowWidth",
|
|
@@ -2942,6 +2947,7 @@ const initBaseSheetEmits = () => {
|
|
|
2942
2947
|
"layoutResizeMouseDown",
|
|
2943
2948
|
"layoutResizeMouseUp",
|
|
2944
2949
|
"layoutResizeMouseMove",
|
|
2950
|
+
// ============== Global ====================
|
|
2945
2951
|
"keyBoardDown",
|
|
2946
2952
|
"keyBoardUp",
|
|
2947
2953
|
"copied",
|
|
@@ -2959,6 +2965,8 @@ const initBaseSheetEmits = () => {
|
|
|
2959
2965
|
"doubleClick",
|
|
2960
2966
|
"scroll",
|
|
2961
2967
|
"hover",
|
|
2968
|
+
// ============== Auto 自动生成的 ================
|
|
2969
|
+
"layoutAfterRealDataCellRender",
|
|
2962
2970
|
"rowCellBrushSelection",
|
|
2963
2971
|
"colCellBrushSelection"
|
|
2964
2972
|
];
|
|
@@ -3113,12 +3121,10 @@ const _sfc_main$3 = defineComponent({
|
|
|
3113
3121
|
setDrillFields,
|
|
3114
3122
|
className
|
|
3115
3123
|
} = props;
|
|
3116
|
-
const getOptions = () => {
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
});
|
|
3121
|
-
};
|
|
3124
|
+
const getOptions = () => dataSet.map((val) => {
|
|
3125
|
+
val.disabled = !!(disabledFields && disabledFields.includes(val.value));
|
|
3126
|
+
return val;
|
|
3127
|
+
});
|
|
3122
3128
|
const options = ref(getOptions());
|
|
3123
3129
|
const selected = ref([]);
|
|
3124
3130
|
const handleSearch = (e) => {
|
|
@@ -3163,7 +3169,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
3163
3169
|
};
|
|
3164
3170
|
}
|
|
3165
3171
|
});
|
|
3166
|
-
const
|
|
3172
|
+
const index_vue_vue_type_style_index_0_scoped_8dd920ec_lang = "";
|
|
3167
3173
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3168
3174
|
const _component_Button = resolveComponent("Button");
|
|
3169
3175
|
const _component_Input = resolveComponent("Input");
|
|
@@ -3231,7 +3237,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3231
3237
|
}, 8, ["selectedKeys", "onSelect"])
|
|
3232
3238
|
], 2);
|
|
3233
3239
|
}
|
|
3234
|
-
const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-
|
|
3240
|
+
const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-8dd920ec"]]);
|
|
3235
3241
|
const _sfc_main$2 = defineComponent({
|
|
3236
3242
|
name: "PivotSheet",
|
|
3237
3243
|
props: initBaseSheetProps(),
|
|
@@ -3242,7 +3248,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
3242
3248
|
const { dataCfg, partDrillDown } = toRefs(props);
|
|
3243
3249
|
const drillFields = ref([]);
|
|
3244
3250
|
const setDrillFields = (fields) => {
|
|
3245
|
-
var _a, _b, _c, _d, _e
|
|
3251
|
+
var _a, _b, _c, _d, _e;
|
|
3246
3252
|
const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
|
|
3247
3253
|
drillFields.value = fields;
|
|
3248
3254
|
instance == null ? void 0 : instance.hideTooltip();
|
|
@@ -3250,10 +3256,10 @@ const _sfc_main$2 = defineComponent({
|
|
|
3250
3256
|
instance == null ? void 0 : instance.clearDrillDownData((_b = instance == null ? void 0 : instance.store.get("drillDownNode")) == null ? void 0 : _b.id);
|
|
3251
3257
|
} else {
|
|
3252
3258
|
handleDrillDown({
|
|
3253
|
-
rows: (
|
|
3259
|
+
rows: ((_c = dataCfg.value) == null ? void 0 : _c.fields.rows) ?? [],
|
|
3254
3260
|
drillFields: fields,
|
|
3255
|
-
fetchData: (
|
|
3256
|
-
drillItemsNum: (
|
|
3261
|
+
fetchData: (_d = partDrillDown.value) == null ? void 0 : _d["fetchData"],
|
|
3262
|
+
drillItemsNum: (_e = partDrillDown.value) == null ? void 0 : _e["drillItemsNum"],
|
|
3257
3263
|
spreadsheet: instance
|
|
3258
3264
|
});
|
|
3259
3265
|
}
|
|
@@ -3264,7 +3270,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
3264
3270
|
if (event) {
|
|
3265
3271
|
const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
|
|
3266
3272
|
const drillDownNode = createVNode(DrillDown, {
|
|
3267
|
-
...(_b = partDrillDown.value) == null ? void 0 : _b
|
|
3273
|
+
...(_b = partDrillDown.value) == null ? void 0 : _b["drillConfig"],
|
|
3268
3274
|
setDrillFields,
|
|
3269
3275
|
drillFields: drillFields.value,
|
|
3270
3276
|
disabledFields
|
|
@@ -3327,7 +3333,7 @@ const _sfc_main = defineComponent({
|
|
|
3327
3333
|
setup(props, ctx) {
|
|
3328
3334
|
const s2Ref = useExpose(ctx.expose);
|
|
3329
3335
|
const sheetType = computed(() => {
|
|
3330
|
-
const type = ctx.attrs
|
|
3336
|
+
const type = ctx.attrs["sheetType"];
|
|
3331
3337
|
switch (type) {
|
|
3332
3338
|
case "table":
|
|
3333
3339
|
return TableSheet;
|
|
@@ -3346,12 +3352,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3346
3352
|
return openBlock(), createBlock(resolveDynamicComponent(_ctx.sheetType), { ref: "s2Ref" }, null, 512);
|
|
3347
3353
|
}
|
|
3348
3354
|
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
3355
|
+
const version = "@antv/s2-vue-v2.0.0-next.11";
|
|
3349
3356
|
export {
|
|
3350
3357
|
BaseSheet,
|
|
3351
3358
|
CustomTooltip,
|
|
3352
3359
|
PivotSheet,
|
|
3353
3360
|
index as SheetComponent,
|
|
3354
3361
|
TableSheet,
|
|
3355
|
-
useExpose
|
|
3362
|
+
useExpose,
|
|
3363
|
+
version
|
|
3356
3364
|
};
|
|
3357
3365
|
//# sourceMappingURL=index.js.map
|