@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/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,
@@ -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
- return customMerge(
100
- DEFAULT_OPTIONS,
101
- SHEET_COMPONENT_DEFAULT_OPTIONS,
102
- ...options
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 && (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)))) {
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, _b, _c;
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: (_b = adaptive == null ? void 0 : adaptive.width) != null ? _b : true,
1623
- 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
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 != null ? containerWidth : s2.options.width) : s2.options.width;
1645
- 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;
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, "\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),
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("\u9879")), 3),
1933
- createTextVNode(" " + toDisplayString(_ctx.i18n("\u5DF2\u9009\u62E9")), 1)
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("\u603B\u548C")) + ") ", 3),
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, _b;
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 = (_b = showOptions.content) != null ? _b : tooltip == null ? void 0 : tooltip.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, _e, _f;
2260
+ var _a, _b, _c, _d;
2254
2261
  const current = ref(
2255
- (_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
2256
2263
  );
2257
2264
  const pageSize = ref(
2258
- (_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
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
- var _a2;
2269
- return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
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, _e2, _f2, _g, _h, _i;
2290
- current.value = (_c2 = (_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) != null ? _c2 : DEFAULT_PAGE_NUMBER;
2291
- pageSize.value = (_f2 = (_e2 = (_d2 = props.options) == null ? void 0 : _d2.pagination) == null ? void 0 : _e2.pageSize) != null ? _f2 : DEFAULT_PAGE_SIZE;
2292
- 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;
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("\u5171\u8BA1")) + " " + toDisplayString(_ctx.total || " - ") + " " + toDisplayString(_ctx.i18n("\u6761")), 3)
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.ROW_CELL_COLLAPSE_TREE_ROWS,
2425
- "rowCellCollapseTreeRows"
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
- [s2Ref, () => props.adaptive],
2752
- ([s2, adaptive], _, onCleanup) => {
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
- sheetType: String,
2825
- dataCfg: Object,
2826
- themeCfg: Object,
2827
- showPagination: {
2828
- type: [Object, Boolean],
2829
- default: false
2830
- },
2831
- loading: Boolean,
2832
- partDrillDown: Object,
2833
- header: Object,
2834
- options: {
2835
- type: Object,
2836
- default: {}
2837
- },
2838
- adaptive: {
2839
- type: [Object, Boolean],
2840
- default: false
2841
- },
2842
- onSpreadsheet: Function,
2843
- onGetSpreadSheet: Function,
2844
- onMounted: Function
2845
- });
2846
- const initDrillDownProps = () => ({
2847
- className: String,
2848
- titleText: {
2849
- type: String,
2850
- default: i18n("\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6")
2851
- },
2852
- searchText: {
2853
- type: String,
2854
- default: i18n("\u641C\u7D22\u5B57\u6BB5")
2855
- },
2856
- clearButtonText: {
2857
- type: String,
2858
- default: i18n("\u6062\u590D\u9ED8\u8BA4")
2859
- },
2860
- extra: Node,
2861
- dataSet: {
2862
- type: Array,
2863
- default: []
2864
- },
2865
- drillFields: Array,
2866
- disabledFields: Array,
2867
- getDrillFields: Function,
2868
- setDrillFields: Function
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
- "getSpreadSheet",
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
- "rowCellCollapseTreeRows",
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
- return dataSet.map((val) => {
3117
- val.disabled = !!(disabledFields && disabledFields.includes(val.value));
3118
- return val;
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 index_vue_vue_type_style_index_0_scoped_1a60f775_lang = "";
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-1a60f775"]]);
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, _f;
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: (_d = (_c = dataCfg.value) == null ? void 0 : _c.fields.rows) != null ? _d : [],
3251
+ rows: ((_c = dataCfg.value) == null ? void 0 : _c.fields.rows) ?? [],
3253
3252
  drillFields: fields,
3254
- fetchData: (_e = partDrillDown.value) == null ? void 0 : _e.fetchData,
3255
- 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"],
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.drillConfig,
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.sheetType;
3328
+ const type = ctx.attrs["sheetType"];
3330
3329
  switch (type) {
3331
3330
  case "table":
3332
3331
  return TableSheet;