@antv/s2-vue 2.0.0-next.4 → 2.0.0-next.5
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/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 +136 -121
- package/esm/index.js +189 -173
- package/esm/index.js.map +1 -1
- package/esm/style.css +11 -11
- package/lib/index.js +190 -174
- package/lib/index.js.map +1 -1
- package/lib/style.css +11 -11
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,83 +1,91 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const s2 = require("@antv/s2");
|
|
4
4
|
const vue = require("vue");
|
|
5
5
|
const antDesignVue = require("ant-design-vue");
|
|
6
6
|
const EN_US = {
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
7
|
+
选择分析信息: "Select Analysis Information",
|
|
8
|
+
切换指标: "Switch indicator",
|
|
9
|
+
确定: "Ok",
|
|
10
|
+
取消: "Cancel",
|
|
11
|
+
重置: "Reset",
|
|
12
|
+
请输入关键字搜索: "Please enter a keyword search",
|
|
13
|
+
搜索: "Search",
|
|
14
|
+
恢复: "Recover",
|
|
15
|
+
"已选 {} 项": "selected {} item",
|
|
16
|
+
所选项: "selected items",
|
|
17
|
+
选择下钻维度: "Select drill down dimension",
|
|
18
|
+
恢复默认: "Restore default",
|
|
19
|
+
搜索字段: "Search field",
|
|
20
|
+
// switcher
|
|
21
|
+
行列切换: "Switch Dimensions",
|
|
22
|
+
行头: "Rows",
|
|
23
|
+
列头: "Cols",
|
|
24
|
+
值: "Values",
|
|
25
|
+
展开子项: "Expand Children",
|
|
26
|
+
// sort
|
|
27
|
+
首字母: "Alphabetical order",
|
|
28
|
+
手动排序: "Custom order",
|
|
29
|
+
其他字段: "Other field",
|
|
30
|
+
高级排序: "Advanced order",
|
|
31
|
+
设置顺序: "SetManual",
|
|
32
|
+
可选字段: "Fields",
|
|
33
|
+
"按以下规则进行排序(优先级由低到高)": "Order according to the following rules (from low to high priority)",
|
|
34
|
+
按: "By",
|
|
35
|
+
说明: "Description",
|
|
36
|
+
// export
|
|
37
|
+
复制原始数据: "Copy raw data",
|
|
38
|
+
复制格式化数据: "Copy formatted data",
|
|
39
|
+
下载原始数据: "Download raw data",
|
|
40
|
+
下载格式化数据: "Download formatted data",
|
|
41
|
+
操作成功: "Operation successful",
|
|
42
|
+
操作失败: "Operation failed",
|
|
43
|
+
// strategy
|
|
44
|
+
时间: "Date",
|
|
45
|
+
指标: "Measure",
|
|
46
|
+
目标值: "Target Value"
|
|
43
47
|
};
|
|
44
48
|
const ZH_CN = {
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
49
|
+
选择分析信息: "选择分析信息",
|
|
50
|
+
切换指标: "切换指标",
|
|
51
|
+
确定: "确定",
|
|
52
|
+
取消: "取消",
|
|
53
|
+
重置: "重置",
|
|
54
|
+
请输入关键字搜索: "请输入关键字搜索",
|
|
55
|
+
搜索: "搜索",
|
|
56
|
+
恢复: "恢复",
|
|
57
|
+
"已选 {} 项": "已选 {} 项",
|
|
58
|
+
所选项: "所选项",
|
|
59
|
+
选择下钻维度: "选择下钻维度",
|
|
60
|
+
恢复默认: "恢复默认",
|
|
61
|
+
搜索字段: "搜索字段",
|
|
62
|
+
// switcher
|
|
63
|
+
行列切换: "行列切换",
|
|
64
|
+
行头: "行头",
|
|
65
|
+
列头: "列头",
|
|
66
|
+
值: "值",
|
|
67
|
+
展开子项: "展开子项",
|
|
68
|
+
// sort
|
|
69
|
+
首字母: "首字母",
|
|
70
|
+
手动排序: "手动排序",
|
|
71
|
+
其他字段: "其他字段",
|
|
72
|
+
高级排序: "高级排序",
|
|
73
|
+
设置顺序: "设置顺序",
|
|
74
|
+
可选字段: "可选字段",
|
|
75
|
+
"按以下规则进行排序(优先级由低到高)": "按以下规则进行排序(优先级由低到高)",
|
|
76
|
+
按: "按",
|
|
77
|
+
说明: "说明",
|
|
78
|
+
// export
|
|
79
|
+
复制原始数据: "复制原始数据",
|
|
80
|
+
复制格式化数据: "复制格式化数据",
|
|
81
|
+
下载原始数据: "下载原始数据",
|
|
82
|
+
下载格式化数据: "下载格式化数据",
|
|
83
|
+
操作成功: "操作成功",
|
|
84
|
+
操作失败: "操作失败",
|
|
85
|
+
// strategy
|
|
86
|
+
时间: "时间",
|
|
87
|
+
指标: "指标",
|
|
88
|
+
目标值: "目标值"
|
|
81
89
|
};
|
|
82
90
|
const Locale = {
|
|
83
91
|
zh_CN: ZH_CN,
|
|
@@ -96,13 +104,11 @@ const SHEET_COMPONENT_DEFAULT_OPTIONS = {
|
|
|
96
104
|
};
|
|
97
105
|
const RESIZE_RENDER_DELAY = 200;
|
|
98
106
|
const DRILL_DOWN_PRE_CLASS = `${s2.S2_PREFIX_CLS}-drill-down`;
|
|
99
|
-
const getBaseSheetComponentOptions = (...options) =>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
);
|
|
105
|
-
};
|
|
107
|
+
const getBaseSheetComponentOptions = (...options) => s2.customMerge(
|
|
108
|
+
s2.DEFAULT_OPTIONS,
|
|
109
|
+
SHEET_COMPONENT_DEFAULT_OPTIONS,
|
|
110
|
+
...options
|
|
111
|
+
);
|
|
106
112
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
107
113
|
const freeGlobal$1 = freeGlobal;
|
|
108
114
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
@@ -442,7 +448,9 @@ var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
|
|
442
448
|
function arrayLikeKeys(value, inherited) {
|
|
443
449
|
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;
|
|
444
450
|
for (var key in value) {
|
|
445
|
-
if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes &&
|
|
451
|
+
if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
452
|
+
(key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
453
|
+
isIndex(key, length)))) {
|
|
446
454
|
result.push(key);
|
|
447
455
|
}
|
|
448
456
|
}
|
|
@@ -1610,7 +1618,7 @@ function size(collection) {
|
|
|
1610
1618
|
return baseKeys(collection).length;
|
|
1611
1619
|
}
|
|
1612
1620
|
const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
1613
|
-
var _a
|
|
1621
|
+
var _a;
|
|
1614
1622
|
if (isBoolean(adaptive)) {
|
|
1615
1623
|
return {
|
|
1616
1624
|
container: defaultContainer,
|
|
@@ -1620,8 +1628,8 @@ const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
|
1620
1628
|
}
|
|
1621
1629
|
return {
|
|
1622
1630
|
container: ((_a = adaptive == null ? void 0 : adaptive.getContainer) == null ? void 0 : _a.call(adaptive)) || defaultContainer,
|
|
1623
|
-
adaptiveWidth: (
|
|
1624
|
-
adaptiveHeight: (
|
|
1631
|
+
adaptiveWidth: (adaptive == null ? void 0 : adaptive.width) ?? true,
|
|
1632
|
+
adaptiveHeight: (adaptive == null ? void 0 : adaptive.height) ?? true
|
|
1625
1633
|
};
|
|
1626
1634
|
};
|
|
1627
1635
|
const createResizeObserver = (params) => {
|
|
@@ -1642,8 +1650,8 @@ const createResizeObserver = (params) => {
|
|
|
1642
1650
|
const debounceRender = debounce(render2, RESIZE_RENDER_DELAY);
|
|
1643
1651
|
const onResize = () => {
|
|
1644
1652
|
const { clientWidth: containerWidth, clientHeight: containerHeight } = container;
|
|
1645
|
-
const width = adaptiveWidth ? Math.floor(containerWidth
|
|
1646
|
-
const height = adaptiveHeight ? Math.floor(containerHeight
|
|
1653
|
+
const width = adaptiveWidth ? Math.floor(containerWidth ?? s22.options.width) : s22.options.width;
|
|
1654
|
+
const height = adaptiveHeight ? Math.floor(containerHeight ?? s22.options.height) : s22.options.height;
|
|
1647
1655
|
if (!adaptiveWidth && !adaptiveHeight) {
|
|
1648
1656
|
return;
|
|
1649
1657
|
}
|
|
@@ -1848,7 +1856,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1848
1856
|
key: col.value
|
|
1849
1857
|
}, vue.toDisplayString(col.value) + "/", 1);
|
|
1850
1858
|
}), 128)),
|
|
1851
|
-
((_c = _ctx.cols) == null ? void 0 : _c.length) > 0 && ((_d = _ctx.rows) == null ? void 0 : _d.length) > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$4, "
|
|
1859
|
+
((_c = _ctx.cols) == null ? void 0 : _c.length) > 0 && ((_d = _ctx.rows) == null ? void 0 : _d.length) > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$4, ",")) : vue.createCommentVNode("", true),
|
|
1852
1860
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.rows, (row) => {
|
|
1853
1861
|
return vue.openBlock(), vue.createElementBlock("span", {
|
|
1854
1862
|
key: row.value
|
|
@@ -1930,8 +1938,8 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1930
1938
|
}, [
|
|
1931
1939
|
vue.createElementVNode("span", {
|
|
1932
1940
|
class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-selected`)
|
|
1933
|
-
}, vue.toDisplayString(_ctx.summaryInfo.count) + " " + vue.toDisplayString(_ctx.i18n("
|
|
1934
|
-
vue.createTextVNode(" " + vue.toDisplayString(_ctx.i18n("
|
|
1941
|
+
}, vue.toDisplayString(_ctx.summaryInfo.count) + " " + vue.toDisplayString(_ctx.i18n("项")), 3),
|
|
1942
|
+
vue.createTextVNode(" " + vue.toDisplayString(_ctx.i18n("已选择")), 1)
|
|
1935
1943
|
], 2),
|
|
1936
1944
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.summaryInfo.summaries, (summary) => {
|
|
1937
1945
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -1940,7 +1948,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1940
1948
|
}, [
|
|
1941
1949
|
vue.createElementVNode("span", {
|
|
1942
1950
|
class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-key`)
|
|
1943
|
-
}, vue.toDisplayString(summary.name) + " (" + vue.toDisplayString(_ctx.i18n("
|
|
1951
|
+
}, vue.toDisplayString(summary.name) + " (" + vue.toDisplayString(_ctx.i18n("总和")) + ") ", 3),
|
|
1944
1952
|
vue.createElementVNode("span", {
|
|
1945
1953
|
class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-val ${_ctx.TOOLTIP_PREFIX_CLS}-bold`)
|
|
1946
1954
|
}, vue.toDisplayString(summary.value), 3)
|
|
@@ -2219,13 +2227,13 @@ class CustomTooltip extends s2.BaseTooltip {
|
|
|
2219
2227
|
super(spreadsheet);
|
|
2220
2228
|
}
|
|
2221
2229
|
renderContent() {
|
|
2222
|
-
var _a
|
|
2230
|
+
var _a;
|
|
2223
2231
|
const { tooltip } = this.spreadsheet.options;
|
|
2224
2232
|
const showOptions = this.options;
|
|
2225
2233
|
const cell = this.spreadsheet.getCell(
|
|
2226
2234
|
(_a = showOptions.event) == null ? void 0 : _a.target
|
|
2227
2235
|
);
|
|
2228
|
-
const content =
|
|
2236
|
+
const content = showOptions.content ?? (tooltip == null ? void 0 : tooltip.content);
|
|
2229
2237
|
const tooltipProps = {
|
|
2230
2238
|
...showOptions,
|
|
2231
2239
|
cell,
|
|
@@ -2251,12 +2259,12 @@ class CustomTooltip extends s2.BaseTooltip {
|
|
|
2251
2259
|
const DEFAULT_PAGE_NUMBER = 1;
|
|
2252
2260
|
const DEFAULT_PAGE_SIZE = 10;
|
|
2253
2261
|
const usePagination = (s2Ref, props) => {
|
|
2254
|
-
var _a, _b, _c, _d
|
|
2262
|
+
var _a, _b, _c, _d;
|
|
2255
2263
|
const current = vue.ref(
|
|
2256
|
-
(
|
|
2264
|
+
((_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) ?? DEFAULT_PAGE_NUMBER
|
|
2257
2265
|
);
|
|
2258
2266
|
const pageSize = vue.ref(
|
|
2259
|
-
(
|
|
2267
|
+
((_d = (_c = props.options) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageSize) ?? DEFAULT_PAGE_SIZE
|
|
2260
2268
|
);
|
|
2261
2269
|
const total = vue.ref(0);
|
|
2262
2270
|
const change = (nextCurrent) => {
|
|
@@ -2265,10 +2273,12 @@ const usePagination = (s2Ref, props) => {
|
|
|
2265
2273
|
const showSizeChange = (nextPageSize) => {
|
|
2266
2274
|
pageSize.value = nextPageSize;
|
|
2267
2275
|
};
|
|
2268
|
-
const visible = vue.computed(
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2276
|
+
const visible = vue.computed(
|
|
2277
|
+
() => {
|
|
2278
|
+
var _a2;
|
|
2279
|
+
return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
|
|
2280
|
+
}
|
|
2281
|
+
);
|
|
2272
2282
|
vue.watch([current, pageSize], () => {
|
|
2273
2283
|
var _a2;
|
|
2274
2284
|
if (!s2Ref.value) {
|
|
@@ -2287,10 +2297,10 @@ const usePagination = (s2Ref, props) => {
|
|
|
2287
2297
|
return (_a2 = props.options) == null ? void 0 : _a2.pagination;
|
|
2288
2298
|
}, s2Ref],
|
|
2289
2299
|
() => {
|
|
2290
|
-
var _a2, _b2, _c2, _d2,
|
|
2291
|
-
current.value = (
|
|
2292
|
-
pageSize.value = (
|
|
2293
|
-
total.value = (
|
|
2300
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
|
2301
|
+
current.value = ((_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) ?? DEFAULT_PAGE_NUMBER;
|
|
2302
|
+
pageSize.value = ((_d2 = (_c2 = props.options) == null ? void 0 : _c2.pagination) == null ? void 0 : _d2.pageSize) ?? DEFAULT_PAGE_SIZE;
|
|
2303
|
+
total.value = ((_f = (_e = s2Ref.value) == null ? void 0 : _e.facet) == null ? void 0 : _f.viewCellHeights.getTotalLength()) ?? 0;
|
|
2294
2304
|
},
|
|
2295
2305
|
{
|
|
2296
2306
|
immediate: true
|
|
@@ -2341,9 +2351,7 @@ const _sfc_main$5 = vue.defineComponent({
|
|
|
2341
2351
|
},
|
|
2342
2352
|
emits: ["change", "showSizeChange"],
|
|
2343
2353
|
setup: (props) => {
|
|
2344
|
-
const showQuickJumper = vue.computed(() =>
|
|
2345
|
-
return props.total / props.pageSize > 5;
|
|
2346
|
-
});
|
|
2354
|
+
const showQuickJumper = vue.computed(() => props.total / props.pageSize > 5);
|
|
2347
2355
|
return {
|
|
2348
2356
|
showQuickJumper,
|
|
2349
2357
|
PRE_CLASS,
|
|
@@ -2372,7 +2380,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2372
2380
|
}, null, 8, ["current", "total", "pageSize", "showQuickJumper"]),
|
|
2373
2381
|
vue.createElementVNode("span", {
|
|
2374
2382
|
class: vue.normalizeClass(`${_ctx.PRE_CLASS}-count`)
|
|
2375
|
-
}, vue.toDisplayString(_ctx.i18n("
|
|
2383
|
+
}, vue.toDisplayString(_ctx.i18n("共计")) + " " + vue.toDisplayString(_ctx.total || " - ") + " " + vue.toDisplayString(_ctx.i18n("条")), 3)
|
|
2376
2384
|
], 2);
|
|
2377
2385
|
}
|
|
2378
2386
|
const S2Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
|
|
@@ -2560,7 +2568,6 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2560
2568
|
"layoutAfterHeaderLayout"
|
|
2561
2569
|
);
|
|
2562
2570
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_PAGINATION, "layoutPagination");
|
|
2563
|
-
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_CELL_SCROLL, "layoutCellScroll");
|
|
2564
2571
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_BEFORE_RENDER, "beforeRender");
|
|
2565
2572
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_AFTER_RENDER, "afterRender");
|
|
2566
2573
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_DESTROY, "destroy");
|
|
@@ -2761,8 +2768,7 @@ function useSpreadSheet(props, emit) {
|
|
|
2761
2768
|
loading: loadingProps,
|
|
2762
2769
|
sheetType,
|
|
2763
2770
|
onSpreadsheet,
|
|
2764
|
-
onMounted: onS2Mounted
|
|
2765
|
-
onGetSpreadSheet
|
|
2771
|
+
onMounted: onS2Mounted
|
|
2766
2772
|
} = props;
|
|
2767
2773
|
const wrapperRef = vue.ref();
|
|
2768
2774
|
const containerRef = vue.ref();
|
|
@@ -2787,7 +2793,6 @@ function useSpreadSheet(props, emit) {
|
|
|
2787
2793
|
s2Ref.value.setThemeCfg(vue.toRaw(themeCfg));
|
|
2788
2794
|
s2Ref.value.render();
|
|
2789
2795
|
setLoading(false);
|
|
2790
|
-
onGetSpreadSheet == null ? void 0 : onGetSpreadSheet(s2Ref.value);
|
|
2791
2796
|
onS2Mounted == null ? void 0 : onS2Mounted(s2Ref.value);
|
|
2792
2797
|
};
|
|
2793
2798
|
vue.onMounted(buildSpreadSheet);
|
|
@@ -2807,53 +2812,57 @@ function useSpreadSheet(props, emit) {
|
|
|
2807
2812
|
pagination
|
|
2808
2813
|
};
|
|
2809
2814
|
}
|
|
2810
|
-
const initBaseSheetProps = () =>
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
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
|
-
|
|
2815
|
+
const initBaseSheetProps = () => {
|
|
2816
|
+
return {
|
|
2817
|
+
sheetType: String,
|
|
2818
|
+
dataCfg: Object,
|
|
2819
|
+
themeCfg: Object,
|
|
2820
|
+
showPagination: {
|
|
2821
|
+
type: [Object, Boolean],
|
|
2822
|
+
default: false
|
|
2823
|
+
},
|
|
2824
|
+
loading: Boolean,
|
|
2825
|
+
// TODO: 待后续完善
|
|
2826
|
+
partDrillDown: Object,
|
|
2827
|
+
header: Object,
|
|
2828
|
+
options: {
|
|
2829
|
+
type: Object,
|
|
2830
|
+
default: {}
|
|
2831
|
+
},
|
|
2832
|
+
adaptive: {
|
|
2833
|
+
type: [Object, Boolean],
|
|
2834
|
+
default: false
|
|
2835
|
+
},
|
|
2836
|
+
onSpreadsheet: Function,
|
|
2837
|
+
onMounted: Function
|
|
2838
|
+
};
|
|
2839
|
+
};
|
|
2840
|
+
const initDrillDownProps = () => {
|
|
2841
|
+
return {
|
|
2842
|
+
className: String,
|
|
2843
|
+
titleText: {
|
|
2844
|
+
type: String,
|
|
2845
|
+
default: s2.i18n("选择下钻维度")
|
|
2846
|
+
},
|
|
2847
|
+
searchText: {
|
|
2848
|
+
type: String,
|
|
2849
|
+
default: s2.i18n("搜索字段")
|
|
2850
|
+
},
|
|
2851
|
+
clearButtonText: {
|
|
2852
|
+
type: String,
|
|
2853
|
+
default: s2.i18n("恢复默认")
|
|
2854
|
+
},
|
|
2855
|
+
extra: Node,
|
|
2856
|
+
dataSet: {
|
|
2857
|
+
type: Array,
|
|
2858
|
+
default: []
|
|
2859
|
+
},
|
|
2860
|
+
drillFields: Array,
|
|
2861
|
+
disabledFields: Array,
|
|
2862
|
+
getDrillFields: Function,
|
|
2863
|
+
setDrillFields: Function
|
|
2864
|
+
};
|
|
2865
|
+
};
|
|
2857
2866
|
const initDrillDownEmits = () => {
|
|
2858
2867
|
const keys2 = ["getDrillFields", "setDrillFields"];
|
|
2859
2868
|
return keys2;
|
|
@@ -2861,7 +2870,7 @@ const initDrillDownEmits = () => {
|
|
|
2861
2870
|
const initBaseSheetEmits = () => {
|
|
2862
2871
|
const keys2 = [
|
|
2863
2872
|
"spreadsheet",
|
|
2864
|
-
|
|
2873
|
+
// ============== Row Cell ====================
|
|
2865
2874
|
"rowCellHover",
|
|
2866
2875
|
"rowCellClick",
|
|
2867
2876
|
"rowCellDoubleClick",
|
|
@@ -2872,6 +2881,7 @@ const initBaseSheetEmits = () => {
|
|
|
2872
2881
|
"rowCellCollapsed",
|
|
2873
2882
|
"rowCellAllCollapsed",
|
|
2874
2883
|
"rowCellScroll",
|
|
2884
|
+
// ============== Col Cell ====================
|
|
2875
2885
|
"colCellHover",
|
|
2876
2886
|
"colCellClick",
|
|
2877
2887
|
"colCellDoubleClick",
|
|
@@ -2881,6 +2891,7 @@ const initBaseSheetEmits = () => {
|
|
|
2881
2891
|
"colCellMouseMove",
|
|
2882
2892
|
"colCellExpanded",
|
|
2883
2893
|
"colCellHidden",
|
|
2894
|
+
// ============== Data Cell ====================
|
|
2884
2895
|
"dataCellHover",
|
|
2885
2896
|
"dataCellClick",
|
|
2886
2897
|
"dataCellDoubleClick",
|
|
@@ -2890,6 +2901,7 @@ const initBaseSheetEmits = () => {
|
|
|
2890
2901
|
"dataCellMouseMove",
|
|
2891
2902
|
"dataCellBrushSelection",
|
|
2892
2903
|
"dataCellSelectMove",
|
|
2904
|
+
// ============== Corner Cell ====================
|
|
2893
2905
|
"cornerCellHover",
|
|
2894
2906
|
"cornerCellClick",
|
|
2895
2907
|
"cornerCellDoubleClick",
|
|
@@ -2897,6 +2909,7 @@ const initBaseSheetEmits = () => {
|
|
|
2897
2909
|
"cornerCellMouseDown",
|
|
2898
2910
|
"cornerCellMouseUp",
|
|
2899
2911
|
"cornerCellMouseMove",
|
|
2912
|
+
// ============== Merged Cells ====================
|
|
2900
2913
|
"mergedCellsHover",
|
|
2901
2914
|
"mergedCellsClick",
|
|
2902
2915
|
"mergedCellsDoubleClick",
|
|
@@ -2904,17 +2917,20 @@ const initBaseSheetEmits = () => {
|
|
|
2904
2917
|
"mergedCellsMouseDown",
|
|
2905
2918
|
"mergedCellsMouseUp",
|
|
2906
2919
|
"mergedCellsMouseMove",
|
|
2920
|
+
// ============== Sort ====================
|
|
2907
2921
|
"rangeSort",
|
|
2908
2922
|
"rangeSorted",
|
|
2923
|
+
// ============== Filter ====================
|
|
2909
2924
|
"rangeFilter",
|
|
2910
2925
|
"rangeFiltered",
|
|
2926
|
+
// ============== Layout ====================
|
|
2911
2927
|
"layoutAfterHeaderLayout",
|
|
2912
2928
|
"layoutPagination",
|
|
2913
|
-
"layoutCellScroll",
|
|
2914
2929
|
"beforeRender",
|
|
2915
2930
|
"afterRender",
|
|
2916
2931
|
"mounted",
|
|
2917
2932
|
"destroy",
|
|
2933
|
+
// ============== Resize ====================
|
|
2918
2934
|
"layoutResize",
|
|
2919
2935
|
"layoutResizeSeriesWidth",
|
|
2920
2936
|
"layoutResizeRowWidth",
|
|
@@ -2925,6 +2941,7 @@ const initBaseSheetEmits = () => {
|
|
|
2925
2941
|
"layoutResizeMouseDown",
|
|
2926
2942
|
"layoutResizeMouseUp",
|
|
2927
2943
|
"layoutResizeMouseMove",
|
|
2944
|
+
// ============== Global ====================
|
|
2928
2945
|
"keyBoardDown",
|
|
2929
2946
|
"keyBoardUp",
|
|
2930
2947
|
"copied",
|
|
@@ -2942,6 +2959,7 @@ const initBaseSheetEmits = () => {
|
|
|
2942
2959
|
"doubleClick",
|
|
2943
2960
|
"scroll",
|
|
2944
2961
|
"hover",
|
|
2962
|
+
// ============== Auto 自动生成的 ================
|
|
2945
2963
|
"layoutAfterRealDataCellRender",
|
|
2946
2964
|
"rowCellBrushSelection",
|
|
2947
2965
|
"colCellBrushSelection"
|
|
@@ -3097,12 +3115,10 @@ const _sfc_main$3 = vue.defineComponent({
|
|
|
3097
3115
|
setDrillFields,
|
|
3098
3116
|
className
|
|
3099
3117
|
} = props;
|
|
3100
|
-
const getOptions = () => {
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
});
|
|
3105
|
-
};
|
|
3118
|
+
const getOptions = () => dataSet.map((val) => {
|
|
3119
|
+
val.disabled = !!(disabledFields && disabledFields.includes(val.value));
|
|
3120
|
+
return val;
|
|
3121
|
+
});
|
|
3106
3122
|
const options = vue.ref(getOptions());
|
|
3107
3123
|
const selected = vue.ref([]);
|
|
3108
3124
|
const handleSearch = (e) => {
|
|
@@ -3147,7 +3163,7 @@ const _sfc_main$3 = vue.defineComponent({
|
|
|
3147
3163
|
};
|
|
3148
3164
|
}
|
|
3149
3165
|
});
|
|
3150
|
-
const
|
|
3166
|
+
const index_vue_vue_type_style_index_0_scoped_8dd920ec_lang = "";
|
|
3151
3167
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3152
3168
|
const _component_Button = vue.resolveComponent("Button");
|
|
3153
3169
|
const _component_Input = vue.resolveComponent("Input");
|
|
@@ -3215,7 +3231,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3215
3231
|
}, 8, ["selectedKeys", "onSelect"])
|
|
3216
3232
|
], 2);
|
|
3217
3233
|
}
|
|
3218
|
-
const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-
|
|
3234
|
+
const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-8dd920ec"]]);
|
|
3219
3235
|
const _sfc_main$2 = vue.defineComponent({
|
|
3220
3236
|
name: "PivotSheet",
|
|
3221
3237
|
props: initBaseSheetProps(),
|
|
@@ -3226,7 +3242,7 @@ const _sfc_main$2 = vue.defineComponent({
|
|
|
3226
3242
|
const { dataCfg, partDrillDown } = vue.toRefs(props);
|
|
3227
3243
|
const drillFields = vue.ref([]);
|
|
3228
3244
|
const setDrillFields = (fields) => {
|
|
3229
|
-
var _a, _b, _c, _d, _e
|
|
3245
|
+
var _a, _b, _c, _d, _e;
|
|
3230
3246
|
const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
|
|
3231
3247
|
drillFields.value = fields;
|
|
3232
3248
|
instance == null ? void 0 : instance.hideTooltip();
|
|
@@ -3234,10 +3250,10 @@ const _sfc_main$2 = vue.defineComponent({
|
|
|
3234
3250
|
instance == null ? void 0 : instance.clearDrillDownData((_b = instance == null ? void 0 : instance.store.get("drillDownNode")) == null ? void 0 : _b.id);
|
|
3235
3251
|
} else {
|
|
3236
3252
|
handleDrillDown({
|
|
3237
|
-
rows: (
|
|
3253
|
+
rows: ((_c = dataCfg.value) == null ? void 0 : _c.fields.rows) ?? [],
|
|
3238
3254
|
drillFields: fields,
|
|
3239
|
-
fetchData: (
|
|
3240
|
-
drillItemsNum: (
|
|
3255
|
+
fetchData: (_d = partDrillDown.value) == null ? void 0 : _d["fetchData"],
|
|
3256
|
+
drillItemsNum: (_e = partDrillDown.value) == null ? void 0 : _e["drillItemsNum"],
|
|
3241
3257
|
spreadsheet: instance
|
|
3242
3258
|
});
|
|
3243
3259
|
}
|
|
@@ -3248,7 +3264,7 @@ const _sfc_main$2 = vue.defineComponent({
|
|
|
3248
3264
|
if (event) {
|
|
3249
3265
|
const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
|
|
3250
3266
|
const drillDownNode = vue.createVNode(DrillDown, {
|
|
3251
|
-
...(_b = partDrillDown.value) == null ? void 0 : _b
|
|
3267
|
+
...(_b = partDrillDown.value) == null ? void 0 : _b["drillConfig"],
|
|
3252
3268
|
setDrillFields,
|
|
3253
3269
|
drillFields: drillFields.value,
|
|
3254
3270
|
disabledFields
|
|
@@ -3311,7 +3327,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
3311
3327
|
setup(props, ctx) {
|
|
3312
3328
|
const s2Ref = useExpose(ctx.expose);
|
|
3313
3329
|
const sheetType = vue.computed(() => {
|
|
3314
|
-
const type = ctx.attrs
|
|
3330
|
+
const type = ctx.attrs["sheetType"];
|
|
3315
3331
|
switch (type) {
|
|
3316
3332
|
case "table":
|
|
3317
3333
|
return TableSheet;
|