@antv/s2-vue 2.0.0-next.4 → 2.0.0-next.6
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 +231 -139
- 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/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,
|
|
@@ -94,13 +102,11 @@ const SHEET_COMPONENT_DEFAULT_OPTIONS = {
|
|
|
94
102
|
};
|
|
95
103
|
const RESIZE_RENDER_DELAY = 200;
|
|
96
104
|
const DRILL_DOWN_PRE_CLASS = `${S2_PREFIX_CLS}-drill-down`;
|
|
97
|
-
const getBaseSheetComponentOptions = (...options) =>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
);
|
|
103
|
-
};
|
|
105
|
+
const getBaseSheetComponentOptions = (...options) => customMerge(
|
|
106
|
+
DEFAULT_OPTIONS,
|
|
107
|
+
SHEET_COMPONENT_DEFAULT_OPTIONS,
|
|
108
|
+
...options
|
|
109
|
+
);
|
|
104
110
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
105
111
|
const freeGlobal$1 = freeGlobal;
|
|
106
112
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
@@ -440,7 +446,9 @@ var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
|
|
440
446
|
function arrayLikeKeys(value, inherited) {
|
|
441
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;
|
|
442
448
|
for (var key in value) {
|
|
443
|
-
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)))) {
|
|
444
452
|
result.push(key);
|
|
445
453
|
}
|
|
446
454
|
}
|
|
@@ -1608,7 +1616,7 @@ function size(collection) {
|
|
|
1608
1616
|
return baseKeys(collection).length;
|
|
1609
1617
|
}
|
|
1610
1618
|
const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
1611
|
-
var _a
|
|
1619
|
+
var _a;
|
|
1612
1620
|
if (isBoolean(adaptive)) {
|
|
1613
1621
|
return {
|
|
1614
1622
|
container: defaultContainer,
|
|
@@ -1618,8 +1626,8 @@ const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
|
1618
1626
|
}
|
|
1619
1627
|
return {
|
|
1620
1628
|
container: ((_a = adaptive == null ? void 0 : adaptive.getContainer) == null ? void 0 : _a.call(adaptive)) || defaultContainer,
|
|
1621
|
-
adaptiveWidth: (
|
|
1622
|
-
adaptiveHeight: (
|
|
1629
|
+
adaptiveWidth: (adaptive == null ? void 0 : adaptive.width) ?? true,
|
|
1630
|
+
adaptiveHeight: (adaptive == null ? void 0 : adaptive.height) ?? true
|
|
1623
1631
|
};
|
|
1624
1632
|
};
|
|
1625
1633
|
const createResizeObserver = (params) => {
|
|
@@ -1640,8 +1648,8 @@ const createResizeObserver = (params) => {
|
|
|
1640
1648
|
const debounceRender = debounce(render2, RESIZE_RENDER_DELAY);
|
|
1641
1649
|
const onResize = () => {
|
|
1642
1650
|
const { clientWidth: containerWidth, clientHeight: containerHeight } = container;
|
|
1643
|
-
const width = adaptiveWidth ? Math.floor(containerWidth
|
|
1644
|
-
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;
|
|
1645
1653
|
if (!adaptiveWidth && !adaptiveHeight) {
|
|
1646
1654
|
return;
|
|
1647
1655
|
}
|
|
@@ -1846,7 +1854,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1846
1854
|
key: col.value
|
|
1847
1855
|
}, toDisplayString(col.value) + "/", 1);
|
|
1848
1856
|
}), 128)),
|
|
1849
|
-
((_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),
|
|
1850
1858
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (row) => {
|
|
1851
1859
|
return openBlock(), createElementBlock("span", {
|
|
1852
1860
|
key: row.value
|
|
@@ -1928,8 +1936,8 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1928
1936
|
}, [
|
|
1929
1937
|
createElementVNode("span", {
|
|
1930
1938
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-selected`)
|
|
1931
|
-
}, toDisplayString(_ctx.summaryInfo.count) + " " + toDisplayString(_ctx.i18n("
|
|
1932
|
-
createTextVNode(" " + toDisplayString(_ctx.i18n("
|
|
1939
|
+
}, toDisplayString(_ctx.summaryInfo.count) + " " + toDisplayString(_ctx.i18n("项")), 3),
|
|
1940
|
+
createTextVNode(" " + toDisplayString(_ctx.i18n("已选择")), 1)
|
|
1933
1941
|
], 2),
|
|
1934
1942
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.summaryInfo.summaries, (summary) => {
|
|
1935
1943
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1938,7 +1946,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1938
1946
|
}, [
|
|
1939
1947
|
createElementVNode("span", {
|
|
1940
1948
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-key`)
|
|
1941
|
-
}, toDisplayString(summary.name) + " (" + toDisplayString(_ctx.i18n("
|
|
1949
|
+
}, toDisplayString(summary.name) + " (" + toDisplayString(_ctx.i18n("总和")) + ") ", 3),
|
|
1942
1950
|
createElementVNode("span", {
|
|
1943
1951
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-val ${_ctx.TOOLTIP_PREFIX_CLS}-bold`)
|
|
1944
1952
|
}, toDisplayString(summary.value), 3)
|
|
@@ -2217,13 +2225,13 @@ class CustomTooltip extends BaseTooltip {
|
|
|
2217
2225
|
super(spreadsheet);
|
|
2218
2226
|
}
|
|
2219
2227
|
renderContent() {
|
|
2220
|
-
var _a
|
|
2228
|
+
var _a;
|
|
2221
2229
|
const { tooltip } = this.spreadsheet.options;
|
|
2222
2230
|
const showOptions = this.options;
|
|
2223
2231
|
const cell = this.spreadsheet.getCell(
|
|
2224
2232
|
(_a = showOptions.event) == null ? void 0 : _a.target
|
|
2225
2233
|
);
|
|
2226
|
-
const content =
|
|
2234
|
+
const content = showOptions.content ?? (tooltip == null ? void 0 : tooltip.content);
|
|
2227
2235
|
const tooltipProps = {
|
|
2228
2236
|
...showOptions,
|
|
2229
2237
|
cell,
|
|
@@ -2249,12 +2257,12 @@ class CustomTooltip extends BaseTooltip {
|
|
|
2249
2257
|
const DEFAULT_PAGE_NUMBER = 1;
|
|
2250
2258
|
const DEFAULT_PAGE_SIZE = 10;
|
|
2251
2259
|
const usePagination = (s2Ref, props) => {
|
|
2252
|
-
var _a, _b, _c, _d
|
|
2260
|
+
var _a, _b, _c, _d;
|
|
2253
2261
|
const current = ref(
|
|
2254
|
-
(
|
|
2262
|
+
((_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) ?? DEFAULT_PAGE_NUMBER
|
|
2255
2263
|
);
|
|
2256
2264
|
const pageSize = ref(
|
|
2257
|
-
(
|
|
2265
|
+
((_d = (_c = props.options) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageSize) ?? DEFAULT_PAGE_SIZE
|
|
2258
2266
|
);
|
|
2259
2267
|
const total = ref(0);
|
|
2260
2268
|
const change = (nextCurrent) => {
|
|
@@ -2263,10 +2271,12 @@ const usePagination = (s2Ref, props) => {
|
|
|
2263
2271
|
const showSizeChange = (nextPageSize) => {
|
|
2264
2272
|
pageSize.value = nextPageSize;
|
|
2265
2273
|
};
|
|
2266
|
-
const visible = computed(
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2274
|
+
const visible = computed(
|
|
2275
|
+
() => {
|
|
2276
|
+
var _a2;
|
|
2277
|
+
return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
|
|
2278
|
+
}
|
|
2279
|
+
);
|
|
2270
2280
|
watch([current, pageSize], () => {
|
|
2271
2281
|
var _a2;
|
|
2272
2282
|
if (!s2Ref.value) {
|
|
@@ -2285,10 +2295,10 @@ const usePagination = (s2Ref, props) => {
|
|
|
2285
2295
|
return (_a2 = props.options) == null ? void 0 : _a2.pagination;
|
|
2286
2296
|
}, s2Ref],
|
|
2287
2297
|
() => {
|
|
2288
|
-
var _a2, _b2, _c2, _d2,
|
|
2289
|
-
current.value = (
|
|
2290
|
-
pageSize.value = (
|
|
2291
|
-
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;
|
|
2292
2302
|
},
|
|
2293
2303
|
{
|
|
2294
2304
|
immediate: true
|
|
@@ -2339,9 +2349,7 @@ const _sfc_main$5 = defineComponent({
|
|
|
2339
2349
|
},
|
|
2340
2350
|
emits: ["change", "showSizeChange"],
|
|
2341
2351
|
setup: (props) => {
|
|
2342
|
-
const showQuickJumper = computed(() =>
|
|
2343
|
-
return props.total / props.pageSize > 5;
|
|
2344
|
-
});
|
|
2352
|
+
const showQuickJumper = computed(() => props.total / props.pageSize > 5);
|
|
2345
2353
|
return {
|
|
2346
2354
|
showQuickJumper,
|
|
2347
2355
|
PRE_CLASS,
|
|
@@ -2370,7 +2378,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2370
2378
|
}, null, 8, ["current", "total", "pageSize", "showQuickJumper"]),
|
|
2371
2379
|
createElementVNode("span", {
|
|
2372
2380
|
class: normalizeClass(`${_ctx.PRE_CLASS}-count`)
|
|
2373
|
-
}, toDisplayString(_ctx.i18n("
|
|
2381
|
+
}, toDisplayString(_ctx.i18n("共计")) + " " + toDisplayString(_ctx.total || " - ") + " " + toDisplayString(_ctx.i18n("条")), 3)
|
|
2374
2382
|
], 2);
|
|
2375
2383
|
}
|
|
2376
2384
|
const S2Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
|
|
@@ -2558,7 +2566,6 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2558
2566
|
"layoutAfterHeaderLayout"
|
|
2559
2567
|
);
|
|
2560
2568
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_PAGINATION, "layoutPagination");
|
|
2561
|
-
useS2Event(s2Ref, emit, S2Event.LAYOUT_CELL_SCROLL, "layoutCellScroll");
|
|
2562
2569
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_BEFORE_RENDER, "beforeRender");
|
|
2563
2570
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_AFTER_RENDER, "afterRender");
|
|
2564
2571
|
useS2Event(s2Ref, emit, S2Event.LAYOUT_DESTROY, "destroy");
|
|
@@ -2759,8 +2766,7 @@ function useSpreadSheet(props, emit) {
|
|
|
2759
2766
|
loading: loadingProps,
|
|
2760
2767
|
sheetType,
|
|
2761
2768
|
onSpreadsheet,
|
|
2762
|
-
onMounted: onS2Mounted
|
|
2763
|
-
onGetSpreadSheet
|
|
2769
|
+
onMounted: onS2Mounted
|
|
2764
2770
|
} = props;
|
|
2765
2771
|
const wrapperRef = ref();
|
|
2766
2772
|
const containerRef = ref();
|
|
@@ -2785,7 +2791,6 @@ function useSpreadSheet(props, emit) {
|
|
|
2785
2791
|
s2Ref.value.setThemeCfg(toRaw(themeCfg));
|
|
2786
2792
|
s2Ref.value.render();
|
|
2787
2793
|
setLoading(false);
|
|
2788
|
-
onGetSpreadSheet == null ? void 0 : onGetSpreadSheet(s2Ref.value);
|
|
2789
2794
|
onS2Mounted == null ? void 0 : onS2Mounted(s2Ref.value);
|
|
2790
2795
|
};
|
|
2791
2796
|
onMounted(buildSpreadSheet);
|
|
@@ -2805,53 +2810,57 @@ function useSpreadSheet(props, emit) {
|
|
|
2805
2810
|
pagination
|
|
2806
2811
|
};
|
|
2807
2812
|
}
|
|
2808
|
-
const initBaseSheetProps = () =>
|
|
2809
|
-
|
|
2810
|
-
|
|
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
|
-
|
|
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
|
+
};
|
|
2855
2864
|
const initDrillDownEmits = () => {
|
|
2856
2865
|
const keys2 = ["getDrillFields", "setDrillFields"];
|
|
2857
2866
|
return keys2;
|
|
@@ -2859,7 +2868,7 @@ const initDrillDownEmits = () => {
|
|
|
2859
2868
|
const initBaseSheetEmits = () => {
|
|
2860
2869
|
const keys2 = [
|
|
2861
2870
|
"spreadsheet",
|
|
2862
|
-
|
|
2871
|
+
// ============== Row Cell ====================
|
|
2863
2872
|
"rowCellHover",
|
|
2864
2873
|
"rowCellClick",
|
|
2865
2874
|
"rowCellDoubleClick",
|
|
@@ -2870,6 +2879,7 @@ const initBaseSheetEmits = () => {
|
|
|
2870
2879
|
"rowCellCollapsed",
|
|
2871
2880
|
"rowCellAllCollapsed",
|
|
2872
2881
|
"rowCellScroll",
|
|
2882
|
+
// ============== Col Cell ====================
|
|
2873
2883
|
"colCellHover",
|
|
2874
2884
|
"colCellClick",
|
|
2875
2885
|
"colCellDoubleClick",
|
|
@@ -2879,6 +2889,7 @@ const initBaseSheetEmits = () => {
|
|
|
2879
2889
|
"colCellMouseMove",
|
|
2880
2890
|
"colCellExpanded",
|
|
2881
2891
|
"colCellHidden",
|
|
2892
|
+
// ============== Data Cell ====================
|
|
2882
2893
|
"dataCellHover",
|
|
2883
2894
|
"dataCellClick",
|
|
2884
2895
|
"dataCellDoubleClick",
|
|
@@ -2888,6 +2899,7 @@ const initBaseSheetEmits = () => {
|
|
|
2888
2899
|
"dataCellMouseMove",
|
|
2889
2900
|
"dataCellBrushSelection",
|
|
2890
2901
|
"dataCellSelectMove",
|
|
2902
|
+
// ============== Corner Cell ====================
|
|
2891
2903
|
"cornerCellHover",
|
|
2892
2904
|
"cornerCellClick",
|
|
2893
2905
|
"cornerCellDoubleClick",
|
|
@@ -2895,6 +2907,7 @@ const initBaseSheetEmits = () => {
|
|
|
2895
2907
|
"cornerCellMouseDown",
|
|
2896
2908
|
"cornerCellMouseUp",
|
|
2897
2909
|
"cornerCellMouseMove",
|
|
2910
|
+
// ============== Merged Cells ====================
|
|
2898
2911
|
"mergedCellsHover",
|
|
2899
2912
|
"mergedCellsClick",
|
|
2900
2913
|
"mergedCellsDoubleClick",
|
|
@@ -2902,17 +2915,20 @@ const initBaseSheetEmits = () => {
|
|
|
2902
2915
|
"mergedCellsMouseDown",
|
|
2903
2916
|
"mergedCellsMouseUp",
|
|
2904
2917
|
"mergedCellsMouseMove",
|
|
2918
|
+
// ============== Sort ====================
|
|
2905
2919
|
"rangeSort",
|
|
2906
2920
|
"rangeSorted",
|
|
2921
|
+
// ============== Filter ====================
|
|
2907
2922
|
"rangeFilter",
|
|
2908
2923
|
"rangeFiltered",
|
|
2924
|
+
// ============== Layout ====================
|
|
2909
2925
|
"layoutAfterHeaderLayout",
|
|
2910
2926
|
"layoutPagination",
|
|
2911
|
-
"layoutCellScroll",
|
|
2912
2927
|
"beforeRender",
|
|
2913
2928
|
"afterRender",
|
|
2914
2929
|
"mounted",
|
|
2915
2930
|
"destroy",
|
|
2931
|
+
// ============== Resize ====================
|
|
2916
2932
|
"layoutResize",
|
|
2917
2933
|
"layoutResizeSeriesWidth",
|
|
2918
2934
|
"layoutResizeRowWidth",
|
|
@@ -2923,6 +2939,7 @@ const initBaseSheetEmits = () => {
|
|
|
2923
2939
|
"layoutResizeMouseDown",
|
|
2924
2940
|
"layoutResizeMouseUp",
|
|
2925
2941
|
"layoutResizeMouseMove",
|
|
2942
|
+
// ============== Global ====================
|
|
2926
2943
|
"keyBoardDown",
|
|
2927
2944
|
"keyBoardUp",
|
|
2928
2945
|
"copied",
|
|
@@ -2940,6 +2957,7 @@ const initBaseSheetEmits = () => {
|
|
|
2940
2957
|
"doubleClick",
|
|
2941
2958
|
"scroll",
|
|
2942
2959
|
"hover",
|
|
2960
|
+
// ============== Auto 自动生成的 ================
|
|
2943
2961
|
"layoutAfterRealDataCellRender",
|
|
2944
2962
|
"rowCellBrushSelection",
|
|
2945
2963
|
"colCellBrushSelection"
|
|
@@ -3095,12 +3113,10 @@ const _sfc_main$3 = defineComponent({
|
|
|
3095
3113
|
setDrillFields,
|
|
3096
3114
|
className
|
|
3097
3115
|
} = props;
|
|
3098
|
-
const getOptions = () => {
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
});
|
|
3103
|
-
};
|
|
3116
|
+
const getOptions = () => dataSet.map((val) => {
|
|
3117
|
+
val.disabled = !!(disabledFields && disabledFields.includes(val.value));
|
|
3118
|
+
return val;
|
|
3119
|
+
});
|
|
3104
3120
|
const options = ref(getOptions());
|
|
3105
3121
|
const selected = ref([]);
|
|
3106
3122
|
const handleSearch = (e) => {
|
|
@@ -3145,7 +3161,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
3145
3161
|
};
|
|
3146
3162
|
}
|
|
3147
3163
|
});
|
|
3148
|
-
const
|
|
3164
|
+
const index_vue_vue_type_style_index_0_scoped_8dd920ec_lang = "";
|
|
3149
3165
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3150
3166
|
const _component_Button = resolveComponent("Button");
|
|
3151
3167
|
const _component_Input = resolveComponent("Input");
|
|
@@ -3213,7 +3229,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3213
3229
|
}, 8, ["selectedKeys", "onSelect"])
|
|
3214
3230
|
], 2);
|
|
3215
3231
|
}
|
|
3216
|
-
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"]]);
|
|
3217
3233
|
const _sfc_main$2 = defineComponent({
|
|
3218
3234
|
name: "PivotSheet",
|
|
3219
3235
|
props: initBaseSheetProps(),
|
|
@@ -3224,7 +3240,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
3224
3240
|
const { dataCfg, partDrillDown } = toRefs(props);
|
|
3225
3241
|
const drillFields = ref([]);
|
|
3226
3242
|
const setDrillFields = (fields) => {
|
|
3227
|
-
var _a, _b, _c, _d, _e
|
|
3243
|
+
var _a, _b, _c, _d, _e;
|
|
3228
3244
|
const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
|
|
3229
3245
|
drillFields.value = fields;
|
|
3230
3246
|
instance == null ? void 0 : instance.hideTooltip();
|
|
@@ -3232,10 +3248,10 @@ const _sfc_main$2 = defineComponent({
|
|
|
3232
3248
|
instance == null ? void 0 : instance.clearDrillDownData((_b = instance == null ? void 0 : instance.store.get("drillDownNode")) == null ? void 0 : _b.id);
|
|
3233
3249
|
} else {
|
|
3234
3250
|
handleDrillDown({
|
|
3235
|
-
rows: (
|
|
3251
|
+
rows: ((_c = dataCfg.value) == null ? void 0 : _c.fields.rows) ?? [],
|
|
3236
3252
|
drillFields: fields,
|
|
3237
|
-
fetchData: (
|
|
3238
|
-
drillItemsNum: (
|
|
3253
|
+
fetchData: (_d = partDrillDown.value) == null ? void 0 : _d["fetchData"],
|
|
3254
|
+
drillItemsNum: (_e = partDrillDown.value) == null ? void 0 : _e["drillItemsNum"],
|
|
3239
3255
|
spreadsheet: instance
|
|
3240
3256
|
});
|
|
3241
3257
|
}
|
|
@@ -3246,7 +3262,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
3246
3262
|
if (event) {
|
|
3247
3263
|
const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
|
|
3248
3264
|
const drillDownNode = createVNode(DrillDown, {
|
|
3249
|
-
...(_b = partDrillDown.value) == null ? void 0 : _b
|
|
3265
|
+
...(_b = partDrillDown.value) == null ? void 0 : _b["drillConfig"],
|
|
3250
3266
|
setDrillFields,
|
|
3251
3267
|
drillFields: drillFields.value,
|
|
3252
3268
|
disabledFields
|
|
@@ -3309,7 +3325,7 @@ const _sfc_main = defineComponent({
|
|
|
3309
3325
|
setup(props, ctx) {
|
|
3310
3326
|
const s2Ref = useExpose(ctx.expose);
|
|
3311
3327
|
const sheetType = computed(() => {
|
|
3312
|
-
const type = ctx.attrs
|
|
3328
|
+
const type = ctx.attrs["sheetType"];
|
|
3313
3329
|
switch (type) {
|
|
3314
3330
|
case "table":
|
|
3315
3331
|
return TableSheet;
|