@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/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
- \u9009\u62E9\u5206\u6790\u4FE1\u606F: "Select Analysis Information",
6
- \u5207\u6362\u6307\u6807: "Switch indicator",
7
- \u786E\u5B9A: "Ok",
8
- \u53D6\u6D88: "Cancel",
9
- \u91CD\u7F6E: "Reset",
10
- \u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22: "Please enter a keyword search",
11
- \u641C\u7D22: "Search",
12
- \u6062\u590D: "Recover",
13
- "\u5DF2\u9009 {} \u9879": "selected {} item",
14
- \u6240\u9009\u9879: "selected items",
15
- \u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6: "Select drill down dimension",
16
- \u6062\u590D\u9ED8\u8BA4: "Restore default",
17
- \u641C\u7D22\u5B57\u6BB5: "Search field",
18
- \u884C\u5217\u5207\u6362: "Switch Dimensions",
19
- \u884C\u5934: "Rows",
20
- \u5217\u5934: "Cols",
21
- \u503C: "Values",
22
- \u5C55\u5F00\u5B50\u9879: "Expand Children",
23
- \u9996\u5B57\u6BCD: "Alphabetical order",
24
- \u624B\u52A8\u6392\u5E8F: "Custom order",
25
- \u5176\u4ED6\u5B57\u6BB5: "Other field",
26
- \u9AD8\u7EA7\u6392\u5E8F: "Advanced order",
27
- \u8BBE\u7F6E\u987A\u5E8F: "SetManual",
28
- \u53EF\u9009\u5B57\u6BB5: "Fields",
29
- "\u6309\u4EE5\u4E0B\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\uFF08\u4F18\u5148\u7EA7\u7531\u4F4E\u5230\u9AD8\uFF09": "Order according to the following rules (from low to high priority)",
30
- \u6309: "By",
31
- \u8BF4\u660E: "Description",
32
- \u590D\u5236\u539F\u59CB\u6570\u636E: "Copy raw data",
33
- \u590D\u5236\u683C\u5F0F\u5316\u6570\u636E: "Copy formatted data",
34
- \u4E0B\u8F7D\u539F\u59CB\u6570\u636E: "Download raw data",
35
- \u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E: "Download formatted data",
36
- \u64CD\u4F5C\u6210\u529F: "Operation successful",
37
- \u64CD\u4F5C\u5931\u8D25: "Operation failed",
38
- \u65F6\u95F4: "Date",
39
- \u6307\u6807: "Measure",
40
- \u76EE\u6807\u503C: "Target Value"
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
- \u9009\u62E9\u5206\u6790\u4FE1\u606F: "\u9009\u62E9\u5206\u6790\u4FE1\u606F",
44
- \u5207\u6362\u6307\u6807: "\u5207\u6362\u6307\u6807",
45
- \u786E\u5B9A: "\u786E\u5B9A",
46
- \u53D6\u6D88: "\u53D6\u6D88",
47
- \u91CD\u7F6E: "\u91CD\u7F6E",
48
- \u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22",
49
- \u641C\u7D22: "\u641C\u7D22",
50
- \u6062\u590D: "\u6062\u590D",
51
- "\u5DF2\u9009 {} \u9879": "\u5DF2\u9009 {} \u9879",
52
- \u6240\u9009\u9879: "\u6240\u9009\u9879",
53
- \u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6: "\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6",
54
- \u6062\u590D\u9ED8\u8BA4: "\u6062\u590D\u9ED8\u8BA4",
55
- \u641C\u7D22\u5B57\u6BB5: "\u641C\u7D22\u5B57\u6BB5",
56
- \u884C\u5217\u5207\u6362: "\u884C\u5217\u5207\u6362",
57
- \u884C\u5934: "\u884C\u5934",
58
- \u5217\u5934: "\u5217\u5934",
59
- \u503C: "\u503C",
60
- \u5C55\u5F00\u5B50\u9879: "\u5C55\u5F00\u5B50\u9879",
61
- \u9996\u5B57\u6BCD: "\u9996\u5B57\u6BCD",
62
- \u624B\u52A8\u6392\u5E8F: "\u624B\u52A8\u6392\u5E8F",
63
- \u5176\u4ED6\u5B57\u6BB5: "\u5176\u4ED6\u5B57\u6BB5",
64
- \u9AD8\u7EA7\u6392\u5E8F: "\u9AD8\u7EA7\u6392\u5E8F",
65
- \u8BBE\u7F6E\u987A\u5E8F: "\u8BBE\u7F6E\u987A\u5E8F",
66
- \u53EF\u9009\u5B57\u6BB5: "\u53EF\u9009\u5B57\u6BB5",
67
- "\u6309\u4EE5\u4E0B\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\uFF08\u4F18\u5148\u7EA7\u7531\u4F4E\u5230\u9AD8\uFF09": "\u6309\u4EE5\u4E0B\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\uFF08\u4F18\u5148\u7EA7\u7531\u4F4E\u5230\u9AD8\uFF09",
68
- \u6309: "\u6309",
69
- \u8BF4\u660E: "\u8BF4\u660E",
70
- \u590D\u5236\u539F\u59CB\u6570\u636E: "\u590D\u5236\u539F\u59CB\u6570\u636E",
71
- \u590D\u5236\u683C\u5F0F\u5316\u6570\u636E: "\u590D\u5236\u683C\u5F0F\u5316\u6570\u636E",
72
- \u4E0B\u8F7D\u539F\u59CB\u6570\u636E: "\u4E0B\u8F7D\u539F\u59CB\u6570\u636E",
73
- \u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E: "\u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E",
74
- \u64CD\u4F5C\u6210\u529F: "\u64CD\u4F5C\u6210\u529F",
75
- \u64CD\u4F5C\u5931\u8D25: "\u64CD\u4F5C\u5931\u8D25",
76
- \u65F6\u95F4: "\u65F6\u95F4",
77
- \u6307\u6807: "\u6307\u6807",
78
- \u76EE\u6807\u503C: "\u76EE\u6807\u503C"
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
- return customMerge(
99
- DEFAULT_OPTIONS,
100
- SHEET_COMPONENT_DEFAULT_OPTIONS,
101
- ...options
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 && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
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, _b, _c;
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: (_b = adaptive == null ? void 0 : adaptive.width) != null ? _b : true,
1622
- adaptiveHeight: (_c = adaptive == null ? void 0 : adaptive.height) != null ? _c : true
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 != null ? containerWidth : s2.options.width) : s2.options.width;
1644
- const height = adaptiveHeight ? Math.floor(containerHeight != null ? containerHeight : s2.options.height) : s2.options.height;
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, "\uFF0C")) : createCommentVNode("", true),
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("\u9879")), 3),
1932
- createTextVNode(" " + toDisplayString(_ctx.i18n("\u5DF2\u9009\u62E9")), 1)
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("\u603B\u548C")) + ") ", 3),
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, _b;
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 = (_b = showOptions.content) != null ? _b : tooltip == null ? void 0 : tooltip.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, _e, _f;
2260
+ var _a, _b, _c, _d;
2253
2261
  const current = ref(
2254
- (_c = (_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) != null ? _c : DEFAULT_PAGE_NUMBER
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
- (_f = (_e = (_d = props.options) == null ? void 0 : _d.pagination) == null ? void 0 : _e.pageSize) != null ? _f : DEFAULT_PAGE_SIZE
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
- var _a2;
2268
- return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
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, _e2, _f2, _g, _h, _i;
2289
- current.value = (_c2 = (_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) != null ? _c2 : DEFAULT_PAGE_NUMBER;
2290
- pageSize.value = (_f2 = (_e2 = (_d2 = props.options) == null ? void 0 : _d2.pagination) == null ? void 0 : _e2.pageSize) != null ? _f2 : DEFAULT_PAGE_SIZE;
2291
- total.value = (_i = (_h = (_g = s2Ref.value) == null ? void 0 : _g.facet) == null ? void 0 : _h.viewCellHeights.getTotalLength()) != null ? _i : 0;
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("\u5171\u8BA1")) + " " + toDisplayString(_ctx.total || " - ") + " " + toDisplayString(_ctx.i18n("\u6761")), 3)
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
- sheetType: String,
2810
- dataCfg: Object,
2811
- themeCfg: Object,
2812
- showPagination: {
2813
- type: [Object, Boolean],
2814
- default: false
2815
- },
2816
- loading: Boolean,
2817
- partDrillDown: Object,
2818
- header: Object,
2819
- options: {
2820
- type: Object,
2821
- default: {}
2822
- },
2823
- adaptive: {
2824
- type: [Object, Boolean],
2825
- default: false
2826
- },
2827
- onSpreadsheet: Function,
2828
- onGetSpreadSheet: Function,
2829
- onMounted: Function
2830
- });
2831
- const initDrillDownProps = () => ({
2832
- className: String,
2833
- titleText: {
2834
- type: String,
2835
- default: i18n("\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6")
2836
- },
2837
- searchText: {
2838
- type: String,
2839
- default: i18n("\u641C\u7D22\u5B57\u6BB5")
2840
- },
2841
- clearButtonText: {
2842
- type: String,
2843
- default: i18n("\u6062\u590D\u9ED8\u8BA4")
2844
- },
2845
- extra: Node,
2846
- dataSet: {
2847
- type: Array,
2848
- default: []
2849
- },
2850
- drillFields: Array,
2851
- disabledFields: Array,
2852
- getDrillFields: Function,
2853
- setDrillFields: Function
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
- "getSpreadSheet",
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
- return dataSet.map((val) => {
3100
- val.disabled = !!(disabledFields && disabledFields.includes(val.value));
3101
- return val;
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 index_vue_vue_type_style_index_0_scoped_1a60f775_lang = "";
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-1a60f775"]]);
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, _f;
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: (_d = (_c = dataCfg.value) == null ? void 0 : _c.fields.rows) != null ? _d : [],
3251
+ rows: ((_c = dataCfg.value) == null ? void 0 : _c.fields.rows) ?? [],
3236
3252
  drillFields: fields,
3237
- fetchData: (_e = partDrillDown.value) == null ? void 0 : _e.fetchData,
3238
- drillItemsNum: (_f = partDrillDown.value) == null ? void 0 : _f.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.drillConfig,
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.sheetType;
3328
+ const type = ctx.attrs["sheetType"];
3313
3329
  switch (type) {
3314
3330
  case "table":
3315
3331
  return TableSheet;