@antv/s2-vue 2.0.0-next.3 → 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 +770 -558
- package/esm/index.js +219 -220
- package/esm/index.js.map +1 -1
- package/esm/style.css +11 -11
- package/lib/index.js +220 -221
- package/lib/index.js.map +1 -1
- package/lib/style.css +11 -11
- package/package.json +11 -11
package/esm/index.js
CHANGED
|
@@ -2,80 +2,88 @@ import { S2_PREFIX_CLS, customMerge, DEFAULT_OPTIONS, S2Event, extendLocale, TOO
|
|
|
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,
|
|
@@ -87,7 +95,6 @@ const SHEET_COMPONENT_DEFAULT_OPTIONS = {
|
|
|
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,9 @@ 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" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
451
|
+
isIndex(key, length)))) {
|
|
445
452
|
result.push(key);
|
|
446
453
|
}
|
|
447
454
|
}
|
|
@@ -1609,7 +1616,7 @@ function size(collection) {
|
|
|
1609
1616
|
return baseKeys(collection).length;
|
|
1610
1617
|
}
|
|
1611
1618
|
const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
1612
|
-
var _a
|
|
1619
|
+
var _a;
|
|
1613
1620
|
if (isBoolean(adaptive)) {
|
|
1614
1621
|
return {
|
|
1615
1622
|
container: defaultContainer,
|
|
@@ -1619,8 +1626,8 @@ const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
|
1619
1626
|
}
|
|
1620
1627
|
return {
|
|
1621
1628
|
container: ((_a = adaptive == null ? void 0 : adaptive.getContainer) == null ? void 0 : _a.call(adaptive)) || defaultContainer,
|
|
1622
|
-
adaptiveWidth: (
|
|
1623
|
-
adaptiveHeight: (
|
|
1629
|
+
adaptiveWidth: (adaptive == null ? void 0 : adaptive.width) ?? true,
|
|
1630
|
+
adaptiveHeight: (adaptive == null ? void 0 : adaptive.height) ?? true
|
|
1624
1631
|
};
|
|
1625
1632
|
};
|
|
1626
1633
|
const createResizeObserver = (params) => {
|
|
@@ -1641,8 +1648,8 @@ const createResizeObserver = (params) => {
|
|
|
1641
1648
|
const debounceRender = debounce(render2, RESIZE_RENDER_DELAY);
|
|
1642
1649
|
const onResize = () => {
|
|
1643
1650
|
const { clientWidth: containerWidth, clientHeight: containerHeight } = container;
|
|
1644
|
-
const width = adaptiveWidth ? Math.floor(containerWidth
|
|
1645
|
-
const height = adaptiveHeight ? Math.floor(containerHeight
|
|
1651
|
+
const width = adaptiveWidth ? Math.floor(containerWidth ?? s2.options.width) : s2.options.width;
|
|
1652
|
+
const height = adaptiveHeight ? Math.floor(containerHeight ?? s2.options.height) : s2.options.height;
|
|
1646
1653
|
if (!adaptiveWidth && !adaptiveHeight) {
|
|
1647
1654
|
return;
|
|
1648
1655
|
}
|
|
@@ -1847,7 +1854,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1847
1854
|
key: col.value
|
|
1848
1855
|
}, toDisplayString(col.value) + "/", 1);
|
|
1849
1856
|
}), 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, "
|
|
1857
|
+
((_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
1858
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (row) => {
|
|
1852
1859
|
return openBlock(), createElementBlock("span", {
|
|
1853
1860
|
key: row.value
|
|
@@ -1929,8 +1936,8 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1929
1936
|
}, [
|
|
1930
1937
|
createElementVNode("span", {
|
|
1931
1938
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-selected`)
|
|
1932
|
-
}, toDisplayString(_ctx.summaryInfo.count) + " " + toDisplayString(_ctx.i18n("
|
|
1933
|
-
createTextVNode(" " + toDisplayString(_ctx.i18n("
|
|
1939
|
+
}, toDisplayString(_ctx.summaryInfo.count) + " " + toDisplayString(_ctx.i18n("项")), 3),
|
|
1940
|
+
createTextVNode(" " + toDisplayString(_ctx.i18n("已选择")), 1)
|
|
1934
1941
|
], 2),
|
|
1935
1942
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.summaryInfo.summaries, (summary) => {
|
|
1936
1943
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1939,7 +1946,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1939
1946
|
}, [
|
|
1940
1947
|
createElementVNode("span", {
|
|
1941
1948
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-key`)
|
|
1942
|
-
}, toDisplayString(summary.name) + " (" + toDisplayString(_ctx.i18n("
|
|
1949
|
+
}, toDisplayString(summary.name) + " (" + toDisplayString(_ctx.i18n("总和")) + ") ", 3),
|
|
1943
1950
|
createElementVNode("span", {
|
|
1944
1951
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-val ${_ctx.TOOLTIP_PREFIX_CLS}-bold`)
|
|
1945
1952
|
}, toDisplayString(summary.value), 3)
|
|
@@ -2218,13 +2225,13 @@ class CustomTooltip extends BaseTooltip {
|
|
|
2218
2225
|
super(spreadsheet);
|
|
2219
2226
|
}
|
|
2220
2227
|
renderContent() {
|
|
2221
|
-
var _a
|
|
2228
|
+
var _a;
|
|
2222
2229
|
const { tooltip } = this.spreadsheet.options;
|
|
2223
2230
|
const showOptions = this.options;
|
|
2224
2231
|
const cell = this.spreadsheet.getCell(
|
|
2225
2232
|
(_a = showOptions.event) == null ? void 0 : _a.target
|
|
2226
2233
|
);
|
|
2227
|
-
const content =
|
|
2234
|
+
const content = showOptions.content ?? (tooltip == null ? void 0 : tooltip.content);
|
|
2228
2235
|
const tooltipProps = {
|
|
2229
2236
|
...showOptions,
|
|
2230
2237
|
cell,
|
|
@@ -2250,12 +2257,12 @@ class CustomTooltip extends BaseTooltip {
|
|
|
2250
2257
|
const DEFAULT_PAGE_NUMBER = 1;
|
|
2251
2258
|
const DEFAULT_PAGE_SIZE = 10;
|
|
2252
2259
|
const usePagination = (s2Ref, props) => {
|
|
2253
|
-
var _a, _b, _c, _d
|
|
2260
|
+
var _a, _b, _c, _d;
|
|
2254
2261
|
const current = ref(
|
|
2255
|
-
(
|
|
2262
|
+
((_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) ?? DEFAULT_PAGE_NUMBER
|
|
2256
2263
|
);
|
|
2257
2264
|
const pageSize = ref(
|
|
2258
|
-
(
|
|
2265
|
+
((_d = (_c = props.options) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageSize) ?? DEFAULT_PAGE_SIZE
|
|
2259
2266
|
);
|
|
2260
2267
|
const total = ref(0);
|
|
2261
2268
|
const change = (nextCurrent) => {
|
|
@@ -2264,10 +2271,12 @@ const usePagination = (s2Ref, props) => {
|
|
|
2264
2271
|
const showSizeChange = (nextPageSize) => {
|
|
2265
2272
|
pageSize.value = nextPageSize;
|
|
2266
2273
|
};
|
|
2267
|
-
const visible = computed(
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2274
|
+
const visible = computed(
|
|
2275
|
+
() => {
|
|
2276
|
+
var _a2;
|
|
2277
|
+
return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
|
|
2278
|
+
}
|
|
2279
|
+
);
|
|
2271
2280
|
watch([current, pageSize], () => {
|
|
2272
2281
|
var _a2;
|
|
2273
2282
|
if (!s2Ref.value) {
|
|
@@ -2286,10 +2295,10 @@ const usePagination = (s2Ref, props) => {
|
|
|
2286
2295
|
return (_a2 = props.options) == null ? void 0 : _a2.pagination;
|
|
2287
2296
|
}, s2Ref],
|
|
2288
2297
|
() => {
|
|
2289
|
-
var _a2, _b2, _c2, _d2,
|
|
2290
|
-
current.value = (
|
|
2291
|
-
pageSize.value = (
|
|
2292
|
-
total.value = (
|
|
2298
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
|
2299
|
+
current.value = ((_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) ?? DEFAULT_PAGE_NUMBER;
|
|
2300
|
+
pageSize.value = ((_d2 = (_c2 = props.options) == null ? void 0 : _c2.pagination) == null ? void 0 : _d2.pageSize) ?? DEFAULT_PAGE_SIZE;
|
|
2301
|
+
total.value = ((_f = (_e = s2Ref.value) == null ? void 0 : _e.facet) == null ? void 0 : _f.viewCellHeights.getTotalLength()) ?? 0;
|
|
2293
2302
|
},
|
|
2294
2303
|
{
|
|
2295
2304
|
immediate: true
|
|
@@ -2340,9 +2349,7 @@ const _sfc_main$5 = defineComponent({
|
|
|
2340
2349
|
},
|
|
2341
2350
|
emits: ["change", "showSizeChange"],
|
|
2342
2351
|
setup: (props) => {
|
|
2343
|
-
const showQuickJumper = computed(() =>
|
|
2344
|
-
return props.total / props.pageSize > 5;
|
|
2345
|
-
});
|
|
2352
|
+
const showQuickJumper = computed(() => props.total / props.pageSize > 5);
|
|
2346
2353
|
return {
|
|
2347
2354
|
showQuickJumper,
|
|
2348
2355
|
PRE_CLASS,
|
|
@@ -2371,7 +2378,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2371
2378
|
}, null, 8, ["current", "total", "pageSize", "showQuickJumper"]),
|
|
2372
2379
|
createElementVNode("span", {
|
|
2373
2380
|
class: normalizeClass(`${_ctx.PRE_CLASS}-count`)
|
|
2374
|
-
}, toDisplayString(_ctx.i18n("
|
|
2381
|
+
}, toDisplayString(_ctx.i18n("共计")) + " " + toDisplayString(_ctx.total || " - ") + " " + toDisplayString(_ctx.i18n("条")), 3)
|
|
2375
2382
|
], 2);
|
|
2376
2383
|
}
|
|
2377
2384
|
const S2Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
|
|
@@ -2418,11 +2425,12 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2418
2425
|
useCellEvent(s2Ref, emit, S2Event.ROW_CELL_MOUSE_DOWN, "rowCellMouseDown");
|
|
2419
2426
|
useCellEvent(s2Ref, emit, S2Event.ROW_CELL_MOUSE_UP, "rowCellMouseUp");
|
|
2420
2427
|
useCellEvent(s2Ref, emit, S2Event.ROW_CELL_MOUSE_MOVE, "rowCellMouseMove");
|
|
2428
|
+
useS2Event(s2Ref, emit, S2Event.ROW_CELL_COLLAPSED, "rowCellCollapsed");
|
|
2421
2429
|
useS2Event(
|
|
2422
2430
|
s2Ref,
|
|
2423
2431
|
emit,
|
|
2424
|
-
S2Event.
|
|
2425
|
-
"
|
|
2432
|
+
S2Event.ROW_CELL_ALL_COLLAPSED,
|
|
2433
|
+
"rowCellAllCollapsed"
|
|
2426
2434
|
);
|
|
2427
2435
|
useS2Event(s2Ref, emit, S2Event.ROW_CELL_SCROLL, "rowCellScroll");
|
|
2428
2436
|
useCellEvent(s2Ref, emit, S2Event.COL_CELL_HOVER, "colCellHover");
|
|
@@ -2442,6 +2450,8 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2442
2450
|
useCellEvent(s2Ref, emit, S2Event.COL_CELL_MOUSE_DOWN, "colCellMouseDown");
|
|
2443
2451
|
useCellEvent(s2Ref, emit, S2Event.COL_CELL_MOUSE_UP, "colCellMouseUp");
|
|
2444
2452
|
useCellEvent(s2Ref, emit, S2Event.COL_CELL_MOUSE_MOVE, "colCellMouseMove");
|
|
2453
|
+
useS2Event(s2Ref, emit, S2Event.COL_CELL_EXPANDED, "colCellExpanded");
|
|
2454
|
+
useS2Event(s2Ref, emit, S2Event.COL_CELL_HIDDEN, "colCellHidden");
|
|
2445
2455
|
useCellEvent(s2Ref, emit, S2Event.DATA_CELL_HOVER, "dataCellHover");
|
|
2446
2456
|
useCellEvent(s2Ref, emit, S2Event.DATA_CELL_CLICK, "dataCellClick");
|
|
2447
2457
|
useCellEvent(
|
|
@@ -2469,12 +2479,6 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2469
2479
|
S2Event.DATA_CELL_MOUSE_MOVE,
|
|
2470
2480
|
"dataCellMouseMove"
|
|
2471
2481
|
);
|
|
2472
|
-
useS2Event(
|
|
2473
|
-
s2Ref,
|
|
2474
|
-
emit,
|
|
2475
|
-
S2Event.DATA_CELL_TREND_ICON_CLICK,
|
|
2476
|
-
"dataCellTrendIconClick"
|
|
2477
|
-
);
|
|
2478
2482
|
useS2Event(
|
|
2479
2483
|
s2Ref,
|
|
2480
2484
|
emit,
|
|
@@ -2562,21 +2566,6 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2562
2566
|
"layoutAfterHeaderLayout"
|
|
2563
2567
|
);
|
|
2564
2568
|
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
2569
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_BEFORE_RENDER, "beforeRender");
|
|
2581
2570
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_AFTER_RENDER, "afterRender");
|
|
2582
2571
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_DESTROY, "destroy");
|
|
@@ -2659,6 +2648,12 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2659
2648
|
useS2Event(s2Ref, emit, S2Event.GLOBAL_RESET, "reset");
|
|
2660
2649
|
useS2Event(s2Ref, emit, S2Event.GLOBAL_LINK_FIELD_JUMP, "linkFieldJump");
|
|
2661
2650
|
useS2Event(s2Ref, emit, S2Event.GLOBAL_SCROLL, "scroll");
|
|
2651
|
+
useS2Event(
|
|
2652
|
+
s2Ref,
|
|
2653
|
+
emit,
|
|
2654
|
+
S2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDER,
|
|
2655
|
+
"layoutAfterRealDataCellRender"
|
|
2656
|
+
);
|
|
2662
2657
|
useS2Event(
|
|
2663
2658
|
s2Ref,
|
|
2664
2659
|
emit,
|
|
@@ -2747,24 +2742,21 @@ const useSheetUpdate = (s2Ref, props) => {
|
|
|
2747
2742
|
};
|
|
2748
2743
|
const useResize = (s2Ref, props, dom) => {
|
|
2749
2744
|
const unobserve = ref();
|
|
2750
|
-
watch(
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
if (!s2) {
|
|
2754
|
-
return;
|
|
2755
|
-
}
|
|
2756
|
-
unobserve.value = createResizeObserver({
|
|
2757
|
-
s2,
|
|
2758
|
-
adaptive,
|
|
2759
|
-
wrapper: dom.wrapperRef.value,
|
|
2760
|
-
container: dom.containerRef.value
|
|
2761
|
-
});
|
|
2762
|
-
onCleanup(() => {
|
|
2763
|
-
var _a;
|
|
2764
|
-
(_a = unobserve.value) == null ? void 0 : _a.call(unobserve);
|
|
2765
|
-
});
|
|
2745
|
+
watch([s2Ref, () => props.adaptive], ([s2, adaptive], _, onCleanup) => {
|
|
2746
|
+
if (!s2) {
|
|
2747
|
+
return;
|
|
2766
2748
|
}
|
|
2767
|
-
|
|
2749
|
+
unobserve.value = createResizeObserver({
|
|
2750
|
+
s2,
|
|
2751
|
+
adaptive,
|
|
2752
|
+
wrapper: dom.wrapperRef.value,
|
|
2753
|
+
container: dom.containerRef.value
|
|
2754
|
+
});
|
|
2755
|
+
onCleanup(() => {
|
|
2756
|
+
var _a;
|
|
2757
|
+
(_a = unobserve.value) == null ? void 0 : _a.call(unobserve);
|
|
2758
|
+
});
|
|
2759
|
+
});
|
|
2768
2760
|
};
|
|
2769
2761
|
function useSpreadSheet(props, emit) {
|
|
2770
2762
|
const {
|
|
@@ -2774,8 +2766,7 @@ function useSpreadSheet(props, emit) {
|
|
|
2774
2766
|
loading: loadingProps,
|
|
2775
2767
|
sheetType,
|
|
2776
2768
|
onSpreadsheet,
|
|
2777
|
-
onMounted: onS2Mounted
|
|
2778
|
-
onGetSpreadSheet
|
|
2769
|
+
onMounted: onS2Mounted
|
|
2779
2770
|
} = props;
|
|
2780
2771
|
const wrapperRef = ref();
|
|
2781
2772
|
const containerRef = ref();
|
|
@@ -2800,7 +2791,6 @@ function useSpreadSheet(props, emit) {
|
|
|
2800
2791
|
s2Ref.value.setThemeCfg(toRaw(themeCfg));
|
|
2801
2792
|
s2Ref.value.render();
|
|
2802
2793
|
setLoading(false);
|
|
2803
|
-
onGetSpreadSheet == null ? void 0 : onGetSpreadSheet(s2Ref.value);
|
|
2804
2794
|
onS2Mounted == null ? void 0 : onS2Mounted(s2Ref.value);
|
|
2805
2795
|
};
|
|
2806
2796
|
onMounted(buildSpreadSheet);
|
|
@@ -2820,53 +2810,57 @@ function useSpreadSheet(props, emit) {
|
|
|
2820
2810
|
pagination
|
|
2821
2811
|
};
|
|
2822
2812
|
}
|
|
2823
|
-
const initBaseSheetProps = () =>
|
|
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
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2813
|
+
const initBaseSheetProps = () => {
|
|
2814
|
+
return {
|
|
2815
|
+
sheetType: String,
|
|
2816
|
+
dataCfg: Object,
|
|
2817
|
+
themeCfg: Object,
|
|
2818
|
+
showPagination: {
|
|
2819
|
+
type: [Object, Boolean],
|
|
2820
|
+
default: false
|
|
2821
|
+
},
|
|
2822
|
+
loading: Boolean,
|
|
2823
|
+
// TODO: 待后续完善
|
|
2824
|
+
partDrillDown: Object,
|
|
2825
|
+
header: Object,
|
|
2826
|
+
options: {
|
|
2827
|
+
type: Object,
|
|
2828
|
+
default: {}
|
|
2829
|
+
},
|
|
2830
|
+
adaptive: {
|
|
2831
|
+
type: [Object, Boolean],
|
|
2832
|
+
default: false
|
|
2833
|
+
},
|
|
2834
|
+
onSpreadsheet: Function,
|
|
2835
|
+
onMounted: Function
|
|
2836
|
+
};
|
|
2837
|
+
};
|
|
2838
|
+
const initDrillDownProps = () => {
|
|
2839
|
+
return {
|
|
2840
|
+
className: String,
|
|
2841
|
+
titleText: {
|
|
2842
|
+
type: String,
|
|
2843
|
+
default: i18n("选择下钻维度")
|
|
2844
|
+
},
|
|
2845
|
+
searchText: {
|
|
2846
|
+
type: String,
|
|
2847
|
+
default: i18n("搜索字段")
|
|
2848
|
+
},
|
|
2849
|
+
clearButtonText: {
|
|
2850
|
+
type: String,
|
|
2851
|
+
default: i18n("恢复默认")
|
|
2852
|
+
},
|
|
2853
|
+
extra: Node,
|
|
2854
|
+
dataSet: {
|
|
2855
|
+
type: Array,
|
|
2856
|
+
default: []
|
|
2857
|
+
},
|
|
2858
|
+
drillFields: Array,
|
|
2859
|
+
disabledFields: Array,
|
|
2860
|
+
getDrillFields: Function,
|
|
2861
|
+
setDrillFields: Function
|
|
2862
|
+
};
|
|
2863
|
+
};
|
|
2870
2864
|
const initDrillDownEmits = () => {
|
|
2871
2865
|
const keys2 = ["getDrillFields", "setDrillFields"];
|
|
2872
2866
|
return keys2;
|
|
@@ -2874,7 +2868,7 @@ const initDrillDownEmits = () => {
|
|
|
2874
2868
|
const initBaseSheetEmits = () => {
|
|
2875
2869
|
const keys2 = [
|
|
2876
2870
|
"spreadsheet",
|
|
2877
|
-
|
|
2871
|
+
// ============== Row Cell ====================
|
|
2878
2872
|
"rowCellHover",
|
|
2879
2873
|
"rowCellClick",
|
|
2880
2874
|
"rowCellDoubleClick",
|
|
@@ -2882,8 +2876,10 @@ const initBaseSheetEmits = () => {
|
|
|
2882
2876
|
"rowCellMouseDown",
|
|
2883
2877
|
"rowCellMouseUp",
|
|
2884
2878
|
"rowCellMouseMove",
|
|
2885
|
-
"
|
|
2879
|
+
"rowCellCollapsed",
|
|
2880
|
+
"rowCellAllCollapsed",
|
|
2886
2881
|
"rowCellScroll",
|
|
2882
|
+
// ============== Col Cell ====================
|
|
2887
2883
|
"colCellHover",
|
|
2888
2884
|
"colCellClick",
|
|
2889
2885
|
"colCellDoubleClick",
|
|
@@ -2891,6 +2887,9 @@ const initBaseSheetEmits = () => {
|
|
|
2891
2887
|
"colCellMouseDown",
|
|
2892
2888
|
"colCellMouseUp",
|
|
2893
2889
|
"colCellMouseMove",
|
|
2890
|
+
"colCellExpanded",
|
|
2891
|
+
"colCellHidden",
|
|
2892
|
+
// ============== Data Cell ====================
|
|
2894
2893
|
"dataCellHover",
|
|
2895
2894
|
"dataCellClick",
|
|
2896
2895
|
"dataCellDoubleClick",
|
|
@@ -2898,9 +2897,9 @@ const initBaseSheetEmits = () => {
|
|
|
2898
2897
|
"dataCellMouseDown",
|
|
2899
2898
|
"dataCellMouseUp",
|
|
2900
2899
|
"dataCellMouseMove",
|
|
2901
|
-
"dataCellTrendIconClick",
|
|
2902
2900
|
"dataCellBrushSelection",
|
|
2903
2901
|
"dataCellSelectMove",
|
|
2902
|
+
// ============== Corner Cell ====================
|
|
2904
2903
|
"cornerCellHover",
|
|
2905
2904
|
"cornerCellClick",
|
|
2906
2905
|
"cornerCellDoubleClick",
|
|
@@ -2908,6 +2907,7 @@ const initBaseSheetEmits = () => {
|
|
|
2908
2907
|
"cornerCellMouseDown",
|
|
2909
2908
|
"cornerCellMouseUp",
|
|
2910
2909
|
"cornerCellMouseMove",
|
|
2910
|
+
// ============== Merged Cells ====================
|
|
2911
2911
|
"mergedCellsHover",
|
|
2912
2912
|
"mergedCellsClick",
|
|
2913
2913
|
"mergedCellsDoubleClick",
|
|
@@ -2915,22 +2915,20 @@ const initBaseSheetEmits = () => {
|
|
|
2915
2915
|
"mergedCellsMouseDown",
|
|
2916
2916
|
"mergedCellsMouseUp",
|
|
2917
2917
|
"mergedCellsMouseMove",
|
|
2918
|
+
// ============== Sort ====================
|
|
2918
2919
|
"rangeSort",
|
|
2919
2920
|
"rangeSorted",
|
|
2921
|
+
// ============== Filter ====================
|
|
2920
2922
|
"rangeFilter",
|
|
2921
2923
|
"rangeFiltered",
|
|
2924
|
+
// ============== Layout ====================
|
|
2922
2925
|
"layoutAfterHeaderLayout",
|
|
2923
2926
|
"layoutPagination",
|
|
2924
|
-
"layoutCellScroll",
|
|
2925
|
-
"layoutCollapseRows",
|
|
2926
|
-
"layoutAfterCollapseRows",
|
|
2927
|
-
"collapseRowsAll",
|
|
2928
|
-
"layoutColsExpanded",
|
|
2929
|
-
"layoutColsHidden",
|
|
2930
2927
|
"beforeRender",
|
|
2931
2928
|
"afterRender",
|
|
2932
2929
|
"mounted",
|
|
2933
2930
|
"destroy",
|
|
2931
|
+
// ============== Resize ====================
|
|
2934
2932
|
"layoutResize",
|
|
2935
2933
|
"layoutResizeSeriesWidth",
|
|
2936
2934
|
"layoutResizeRowWidth",
|
|
@@ -2941,6 +2939,7 @@ const initBaseSheetEmits = () => {
|
|
|
2941
2939
|
"layoutResizeMouseDown",
|
|
2942
2940
|
"layoutResizeMouseUp",
|
|
2943
2941
|
"layoutResizeMouseMove",
|
|
2942
|
+
// ============== Global ====================
|
|
2944
2943
|
"keyBoardDown",
|
|
2945
2944
|
"keyBoardUp",
|
|
2946
2945
|
"copied",
|
|
@@ -2958,6 +2957,8 @@ const initBaseSheetEmits = () => {
|
|
|
2958
2957
|
"doubleClick",
|
|
2959
2958
|
"scroll",
|
|
2960
2959
|
"hover",
|
|
2960
|
+
// ============== Auto 自动生成的 ================
|
|
2961
|
+
"layoutAfterRealDataCellRender",
|
|
2961
2962
|
"rowCellBrushSelection",
|
|
2962
2963
|
"colCellBrushSelection"
|
|
2963
2964
|
];
|
|
@@ -3112,12 +3113,10 @@ const _sfc_main$3 = defineComponent({
|
|
|
3112
3113
|
setDrillFields,
|
|
3113
3114
|
className
|
|
3114
3115
|
} = props;
|
|
3115
|
-
const getOptions = () => {
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
});
|
|
3120
|
-
};
|
|
3116
|
+
const getOptions = () => dataSet.map((val) => {
|
|
3117
|
+
val.disabled = !!(disabledFields && disabledFields.includes(val.value));
|
|
3118
|
+
return val;
|
|
3119
|
+
});
|
|
3121
3120
|
const options = ref(getOptions());
|
|
3122
3121
|
const selected = ref([]);
|
|
3123
3122
|
const handleSearch = (e) => {
|
|
@@ -3162,7 +3161,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
3162
3161
|
};
|
|
3163
3162
|
}
|
|
3164
3163
|
});
|
|
3165
|
-
const
|
|
3164
|
+
const index_vue_vue_type_style_index_0_scoped_8dd920ec_lang = "";
|
|
3166
3165
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3167
3166
|
const _component_Button = resolveComponent("Button");
|
|
3168
3167
|
const _component_Input = resolveComponent("Input");
|
|
@@ -3230,7 +3229,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3230
3229
|
}, 8, ["selectedKeys", "onSelect"])
|
|
3231
3230
|
], 2);
|
|
3232
3231
|
}
|
|
3233
|
-
const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-
|
|
3232
|
+
const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-8dd920ec"]]);
|
|
3234
3233
|
const _sfc_main$2 = defineComponent({
|
|
3235
3234
|
name: "PivotSheet",
|
|
3236
3235
|
props: initBaseSheetProps(),
|
|
@@ -3241,7 +3240,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
3241
3240
|
const { dataCfg, partDrillDown } = toRefs(props);
|
|
3242
3241
|
const drillFields = ref([]);
|
|
3243
3242
|
const setDrillFields = (fields) => {
|
|
3244
|
-
var _a, _b, _c, _d, _e
|
|
3243
|
+
var _a, _b, _c, _d, _e;
|
|
3245
3244
|
const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
|
|
3246
3245
|
drillFields.value = fields;
|
|
3247
3246
|
instance == null ? void 0 : instance.hideTooltip();
|
|
@@ -3249,10 +3248,10 @@ const _sfc_main$2 = defineComponent({
|
|
|
3249
3248
|
instance == null ? void 0 : instance.clearDrillDownData((_b = instance == null ? void 0 : instance.store.get("drillDownNode")) == null ? void 0 : _b.id);
|
|
3250
3249
|
} else {
|
|
3251
3250
|
handleDrillDown({
|
|
3252
|
-
rows: (
|
|
3251
|
+
rows: ((_c = dataCfg.value) == null ? void 0 : _c.fields.rows) ?? [],
|
|
3253
3252
|
drillFields: fields,
|
|
3254
|
-
fetchData: (
|
|
3255
|
-
drillItemsNum: (
|
|
3253
|
+
fetchData: (_d = partDrillDown.value) == null ? void 0 : _d["fetchData"],
|
|
3254
|
+
drillItemsNum: (_e = partDrillDown.value) == null ? void 0 : _e["drillItemsNum"],
|
|
3256
3255
|
spreadsheet: instance
|
|
3257
3256
|
});
|
|
3258
3257
|
}
|
|
@@ -3263,7 +3262,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
3263
3262
|
if (event) {
|
|
3264
3263
|
const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
|
|
3265
3264
|
const drillDownNode = createVNode(DrillDown, {
|
|
3266
|
-
...(_b = partDrillDown.value) == null ? void 0 : _b
|
|
3265
|
+
...(_b = partDrillDown.value) == null ? void 0 : _b["drillConfig"],
|
|
3267
3266
|
setDrillFields,
|
|
3268
3267
|
drillFields: drillFields.value,
|
|
3269
3268
|
disabledFields
|
|
@@ -3326,7 +3325,7 @@ const _sfc_main = defineComponent({
|
|
|
3326
3325
|
setup(props, ctx) {
|
|
3327
3326
|
const s2Ref = useExpose(ctx.expose);
|
|
3328
3327
|
const sheetType = computed(() => {
|
|
3329
|
-
const type = ctx.attrs
|
|
3328
|
+
const type = ctx.attrs["sheetType"];
|
|
3330
3329
|
switch (type) {
|
|
3331
3330
|
case "table":
|
|
3332
3331
|
return TableSheet;
|