@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/lib/index.js CHANGED
@@ -1,83 +1,91 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const s2 = require("@antv/s2");
4
4
  const vue = require("vue");
5
5
  const antDesignVue = require("ant-design-vue");
6
6
  const EN_US = {
7
- \u9009\u62E9\u5206\u6790\u4FE1\u606F: "Select Analysis Information",
8
- \u5207\u6362\u6307\u6807: "Switch indicator",
9
- \u786E\u5B9A: "Ok",
10
- \u53D6\u6D88: "Cancel",
11
- \u91CD\u7F6E: "Reset",
12
- \u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22: "Please enter a keyword search",
13
- \u641C\u7D22: "Search",
14
- \u6062\u590D: "Recover",
15
- "\u5DF2\u9009 {} \u9879": "selected {} item",
16
- \u6240\u9009\u9879: "selected items",
17
- \u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6: "Select drill down dimension",
18
- \u6062\u590D\u9ED8\u8BA4: "Restore default",
19
- \u641C\u7D22\u5B57\u6BB5: "Search field",
20
- \u884C\u5217\u5207\u6362: "Switch Dimensions",
21
- \u884C\u5934: "Rows",
22
- \u5217\u5934: "Cols",
23
- \u503C: "Values",
24
- \u5C55\u5F00\u5B50\u9879: "Expand Children",
25
- \u9996\u5B57\u6BCD: "Alphabetical order",
26
- \u624B\u52A8\u6392\u5E8F: "Custom order",
27
- \u5176\u4ED6\u5B57\u6BB5: "Other field",
28
- \u9AD8\u7EA7\u6392\u5E8F: "Advanced order",
29
- \u8BBE\u7F6E\u987A\u5E8F: "SetManual",
30
- \u53EF\u9009\u5B57\u6BB5: "Fields",
31
- "\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)",
32
- \u6309: "By",
33
- \u8BF4\u660E: "Description",
34
- \u590D\u5236\u539F\u59CB\u6570\u636E: "Copy raw data",
35
- \u590D\u5236\u683C\u5F0F\u5316\u6570\u636E: "Copy formatted data",
36
- \u4E0B\u8F7D\u539F\u59CB\u6570\u636E: "Download raw data",
37
- \u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E: "Download formatted data",
38
- \u64CD\u4F5C\u6210\u529F: "Operation successful",
39
- \u64CD\u4F5C\u5931\u8D25: "Operation failed",
40
- \u65F6\u95F4: "Date",
41
- \u6307\u6807: "Measure",
42
- \u76EE\u6807\u503C: "Target Value"
7
+ 选择分析信息: "Select Analysis Information",
8
+ 切换指标: "Switch indicator",
9
+ 确定: "Ok",
10
+ 取消: "Cancel",
11
+ 重置: "Reset",
12
+ 请输入关键字搜索: "Please enter a keyword search",
13
+ 搜索: "Search",
14
+ 恢复: "Recover",
15
+ "已选 {} ": "selected {} item",
16
+ 所选项: "selected items",
17
+ 选择下钻维度: "Select drill down dimension",
18
+ 恢复默认: "Restore default",
19
+ 搜索字段: "Search field",
20
+ // switcher
21
+ 行列切换: "Switch Dimensions",
22
+ 行头: "Rows",
23
+ 列头: "Cols",
24
+ 值: "Values",
25
+ 展开子项: "Expand Children",
26
+ // sort
27
+ 首字母: "Alphabetical order",
28
+ 手动排序: "Custom order",
29
+ 其他字段: "Other field",
30
+ 高级排序: "Advanced order",
31
+ 设置顺序: "SetManual",
32
+ 可选字段: "Fields",
33
+ "按以下规则进行排序(优先级由低到高)": "Order according to the following rules (from low to high priority)",
34
+ 按: "By",
35
+ 说明: "Description",
36
+ // export
37
+ 复制原始数据: "Copy raw data",
38
+ 复制格式化数据: "Copy formatted data",
39
+ 下载原始数据: "Download raw data",
40
+ 下载格式化数据: "Download formatted data",
41
+ 操作成功: "Operation successful",
42
+ 操作失败: "Operation failed",
43
+ // strategy
44
+ 时间: "Date",
45
+ 指标: "Measure",
46
+ 目标值: "Target Value"
43
47
  };
44
48
  const ZH_CN = {
45
- \u9009\u62E9\u5206\u6790\u4FE1\u606F: "\u9009\u62E9\u5206\u6790\u4FE1\u606F",
46
- \u5207\u6362\u6307\u6807: "\u5207\u6362\u6307\u6807",
47
- \u786E\u5B9A: "\u786E\u5B9A",
48
- \u53D6\u6D88: "\u53D6\u6D88",
49
- \u91CD\u7F6E: "\u91CD\u7F6E",
50
- \u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22",
51
- \u641C\u7D22: "\u641C\u7D22",
52
- \u6062\u590D: "\u6062\u590D",
53
- "\u5DF2\u9009 {} \u9879": "\u5DF2\u9009 {} \u9879",
54
- \u6240\u9009\u9879: "\u6240\u9009\u9879",
55
- \u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6: "\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6",
56
- \u6062\u590D\u9ED8\u8BA4: "\u6062\u590D\u9ED8\u8BA4",
57
- \u641C\u7D22\u5B57\u6BB5: "\u641C\u7D22\u5B57\u6BB5",
58
- \u884C\u5217\u5207\u6362: "\u884C\u5217\u5207\u6362",
59
- \u884C\u5934: "\u884C\u5934",
60
- \u5217\u5934: "\u5217\u5934",
61
- \u503C: "\u503C",
62
- \u5C55\u5F00\u5B50\u9879: "\u5C55\u5F00\u5B50\u9879",
63
- \u9996\u5B57\u6BCD: "\u9996\u5B57\u6BCD",
64
- \u624B\u52A8\u6392\u5E8F: "\u624B\u52A8\u6392\u5E8F",
65
- \u5176\u4ED6\u5B57\u6BB5: "\u5176\u4ED6\u5B57\u6BB5",
66
- \u9AD8\u7EA7\u6392\u5E8F: "\u9AD8\u7EA7\u6392\u5E8F",
67
- \u8BBE\u7F6E\u987A\u5E8F: "\u8BBE\u7F6E\u987A\u5E8F",
68
- \u53EF\u9009\u5B57\u6BB5: "\u53EF\u9009\u5B57\u6BB5",
69
- "\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",
70
- \u6309: "\u6309",
71
- \u8BF4\u660E: "\u8BF4\u660E",
72
- \u590D\u5236\u539F\u59CB\u6570\u636E: "\u590D\u5236\u539F\u59CB\u6570\u636E",
73
- \u590D\u5236\u683C\u5F0F\u5316\u6570\u636E: "\u590D\u5236\u683C\u5F0F\u5316\u6570\u636E",
74
- \u4E0B\u8F7D\u539F\u59CB\u6570\u636E: "\u4E0B\u8F7D\u539F\u59CB\u6570\u636E",
75
- \u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E: "\u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E",
76
- \u64CD\u4F5C\u6210\u529F: "\u64CD\u4F5C\u6210\u529F",
77
- \u64CD\u4F5C\u5931\u8D25: "\u64CD\u4F5C\u5931\u8D25",
78
- \u65F6\u95F4: "\u65F6\u95F4",
79
- \u6307\u6807: "\u6307\u6807",
80
- \u76EE\u6807\u503C: "\u76EE\u6807\u503C"
49
+ 选择分析信息: "选择分析信息",
50
+ 切换指标: "切换指标",
51
+ 确定: "确定",
52
+ 取消: "取消",
53
+ 重置: "重置",
54
+ 请输入关键字搜索: "请输入关键字搜索",
55
+ 搜索: "搜索",
56
+ 恢复: "恢复",
57
+ "已选 {} ": "已选 {} ",
58
+ 所选项: "所选项",
59
+ 选择下钻维度: "选择下钻维度",
60
+ 恢复默认: "恢复默认",
61
+ 搜索字段: "搜索字段",
62
+ // switcher
63
+ 行列切换: "行列切换",
64
+ 行头: "行头",
65
+ 列头: "列头",
66
+ 值: "",
67
+ 展开子项: "展开子项",
68
+ // sort
69
+ 首字母: "首字母",
70
+ 手动排序: "手动排序",
71
+ 其他字段: "其他字段",
72
+ 高级排序: "高级排序",
73
+ 设置顺序: "设置顺序",
74
+ 可选字段: "可选字段",
75
+ "按以下规则进行排序(优先级由低到高)": "按以下规则进行排序(优先级由低到高)",
76
+ 按: "",
77
+ 说明: "说明",
78
+ // export
79
+ 复制原始数据: "复制原始数据",
80
+ 复制格式化数据: "复制格式化数据",
81
+ 下载原始数据: "下载原始数据",
82
+ 下载格式化数据: "下载格式化数据",
83
+ 操作成功: "操作成功",
84
+ 操作失败: "操作失败",
85
+ // strategy
86
+ 时间: "时间",
87
+ 指标: "指标",
88
+ 目标值: "目标值"
81
89
  };
82
90
  const Locale = {
83
91
  zh_CN: ZH_CN,
@@ -89,7 +97,6 @@ const SHEET_COMPONENT_DEFAULT_OPTIONS = {
89
97
  autoAdjustBoundary: "body",
90
98
  operation: {
91
99
  hiddenColumns: true,
92
- trend: false,
93
100
  sort: true
94
101
  }
95
102
  },
@@ -97,13 +104,11 @@ const SHEET_COMPONENT_DEFAULT_OPTIONS = {
97
104
  };
98
105
  const RESIZE_RENDER_DELAY = 200;
99
106
  const DRILL_DOWN_PRE_CLASS = `${s2.S2_PREFIX_CLS}-drill-down`;
100
- const getBaseSheetComponentOptions = (...options) => {
101
- return s2.customMerge(
102
- s2.DEFAULT_OPTIONS,
103
- SHEET_COMPONENT_DEFAULT_OPTIONS,
104
- ...options
105
- );
106
- };
107
+ const getBaseSheetComponentOptions = (...options) => s2.customMerge(
108
+ s2.DEFAULT_OPTIONS,
109
+ SHEET_COMPONENT_DEFAULT_OPTIONS,
110
+ ...options
111
+ );
107
112
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
108
113
  const freeGlobal$1 = freeGlobal;
109
114
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
@@ -443,7 +448,9 @@ var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
443
448
  function arrayLikeKeys(value, inherited) {
444
449
  var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
445
450
  for (var key in value) {
446
- 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)))) {
451
+ if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
452
+ (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
453
+ isIndex(key, length)))) {
447
454
  result.push(key);
448
455
  }
449
456
  }
@@ -1611,7 +1618,7 @@ function size(collection) {
1611
1618
  return baseKeys(collection).length;
1612
1619
  }
1613
1620
  const analyzeAdaptive = (defaultContainer, adaptive) => {
1614
- var _a, _b, _c;
1621
+ var _a;
1615
1622
  if (isBoolean(adaptive)) {
1616
1623
  return {
1617
1624
  container: defaultContainer,
@@ -1621,8 +1628,8 @@ const analyzeAdaptive = (defaultContainer, adaptive) => {
1621
1628
  }
1622
1629
  return {
1623
1630
  container: ((_a = adaptive == null ? void 0 : adaptive.getContainer) == null ? void 0 : _a.call(adaptive)) || defaultContainer,
1624
- adaptiveWidth: (_b = adaptive == null ? void 0 : adaptive.width) != null ? _b : true,
1625
- adaptiveHeight: (_c = adaptive == null ? void 0 : adaptive.height) != null ? _c : true
1631
+ adaptiveWidth: (adaptive == null ? void 0 : adaptive.width) ?? true,
1632
+ adaptiveHeight: (adaptive == null ? void 0 : adaptive.height) ?? true
1626
1633
  };
1627
1634
  };
1628
1635
  const createResizeObserver = (params) => {
@@ -1643,8 +1650,8 @@ const createResizeObserver = (params) => {
1643
1650
  const debounceRender = debounce(render2, RESIZE_RENDER_DELAY);
1644
1651
  const onResize = () => {
1645
1652
  const { clientWidth: containerWidth, clientHeight: containerHeight } = container;
1646
- const width = adaptiveWidth ? Math.floor(containerWidth != null ? containerWidth : s22.options.width) : s22.options.width;
1647
- const height = adaptiveHeight ? Math.floor(containerHeight != null ? containerHeight : s22.options.height) : s22.options.height;
1653
+ const width = adaptiveWidth ? Math.floor(containerWidth ?? s22.options.width) : s22.options.width;
1654
+ const height = adaptiveHeight ? Math.floor(containerHeight ?? s22.options.height) : s22.options.height;
1648
1655
  if (!adaptiveWidth && !adaptiveHeight) {
1649
1656
  return;
1650
1657
  }
@@ -1849,7 +1856,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
1849
1856
  key: col.value
1850
1857
  }, vue.toDisplayString(col.value) + "/", 1);
1851
1858
  }), 128)),
1852
- ((_c = _ctx.cols) == null ? void 0 : _c.length) > 0 && ((_d = _ctx.rows) == null ? void 0 : _d.length) > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$4, "\uFF0C")) : vue.createCommentVNode("", true),
1859
+ ((_c = _ctx.cols) == null ? void 0 : _c.length) > 0 && ((_d = _ctx.rows) == null ? void 0 : _d.length) > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$4, "")) : vue.createCommentVNode("", true),
1853
1860
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.rows, (row) => {
1854
1861
  return vue.openBlock(), vue.createElementBlock("span", {
1855
1862
  key: row.value
@@ -1931,8 +1938,8 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1931
1938
  }, [
1932
1939
  vue.createElementVNode("span", {
1933
1940
  class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-selected`)
1934
- }, vue.toDisplayString(_ctx.summaryInfo.count) + " " + vue.toDisplayString(_ctx.i18n("\u9879")), 3),
1935
- vue.createTextVNode(" " + vue.toDisplayString(_ctx.i18n("\u5DF2\u9009\u62E9")), 1)
1941
+ }, vue.toDisplayString(_ctx.summaryInfo.count) + " " + vue.toDisplayString(_ctx.i18n("")), 3),
1942
+ vue.createTextVNode(" " + vue.toDisplayString(_ctx.i18n("已选择")), 1)
1936
1943
  ], 2),
1937
1944
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.summaryInfo.summaries, (summary) => {
1938
1945
  return vue.openBlock(), vue.createElementBlock("div", {
@@ -1941,7 +1948,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1941
1948
  }, [
1942
1949
  vue.createElementVNode("span", {
1943
1950
  class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-key`)
1944
- }, vue.toDisplayString(summary.name) + " (" + vue.toDisplayString(_ctx.i18n("\u603B\u548C")) + ") ", 3),
1951
+ }, vue.toDisplayString(summary.name) + " (" + vue.toDisplayString(_ctx.i18n("总和")) + ") ", 3),
1945
1952
  vue.createElementVNode("span", {
1946
1953
  class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-val ${_ctx.TOOLTIP_PREFIX_CLS}-bold`)
1947
1954
  }, vue.toDisplayString(summary.value), 3)
@@ -2220,13 +2227,13 @@ class CustomTooltip extends s2.BaseTooltip {
2220
2227
  super(spreadsheet);
2221
2228
  }
2222
2229
  renderContent() {
2223
- var _a, _b;
2230
+ var _a;
2224
2231
  const { tooltip } = this.spreadsheet.options;
2225
2232
  const showOptions = this.options;
2226
2233
  const cell = this.spreadsheet.getCell(
2227
2234
  (_a = showOptions.event) == null ? void 0 : _a.target
2228
2235
  );
2229
- const content = (_b = showOptions.content) != null ? _b : tooltip == null ? void 0 : tooltip.content;
2236
+ const content = showOptions.content ?? (tooltip == null ? void 0 : tooltip.content);
2230
2237
  const tooltipProps = {
2231
2238
  ...showOptions,
2232
2239
  cell,
@@ -2252,12 +2259,12 @@ class CustomTooltip extends s2.BaseTooltip {
2252
2259
  const DEFAULT_PAGE_NUMBER = 1;
2253
2260
  const DEFAULT_PAGE_SIZE = 10;
2254
2261
  const usePagination = (s2Ref, props) => {
2255
- var _a, _b, _c, _d, _e, _f;
2262
+ var _a, _b, _c, _d;
2256
2263
  const current = vue.ref(
2257
- (_c = (_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) != null ? _c : DEFAULT_PAGE_NUMBER
2264
+ ((_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) ?? DEFAULT_PAGE_NUMBER
2258
2265
  );
2259
2266
  const pageSize = vue.ref(
2260
- (_f = (_e = (_d = props.options) == null ? void 0 : _d.pagination) == null ? void 0 : _e.pageSize) != null ? _f : DEFAULT_PAGE_SIZE
2267
+ ((_d = (_c = props.options) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageSize) ?? DEFAULT_PAGE_SIZE
2261
2268
  );
2262
2269
  const total = vue.ref(0);
2263
2270
  const change = (nextCurrent) => {
@@ -2266,10 +2273,12 @@ const usePagination = (s2Ref, props) => {
2266
2273
  const showSizeChange = (nextPageSize) => {
2267
2274
  pageSize.value = nextPageSize;
2268
2275
  };
2269
- const visible = vue.computed(() => {
2270
- var _a2;
2271
- return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
2272
- });
2276
+ const visible = vue.computed(
2277
+ () => {
2278
+ var _a2;
2279
+ return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
2280
+ }
2281
+ );
2273
2282
  vue.watch([current, pageSize], () => {
2274
2283
  var _a2;
2275
2284
  if (!s2Ref.value) {
@@ -2288,10 +2297,10 @@ const usePagination = (s2Ref, props) => {
2288
2297
  return (_a2 = props.options) == null ? void 0 : _a2.pagination;
2289
2298
  }, s2Ref],
2290
2299
  () => {
2291
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i;
2292
- current.value = (_c2 = (_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) != null ? _c2 : DEFAULT_PAGE_NUMBER;
2293
- pageSize.value = (_f2 = (_e2 = (_d2 = props.options) == null ? void 0 : _d2.pagination) == null ? void 0 : _e2.pageSize) != null ? _f2 : DEFAULT_PAGE_SIZE;
2294
- total.value = (_i = (_h = (_g = s2Ref.value) == null ? void 0 : _g.facet) == null ? void 0 : _h.viewCellHeights.getTotalLength()) != null ? _i : 0;
2300
+ var _a2, _b2, _c2, _d2, _e, _f;
2301
+ current.value = ((_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) ?? DEFAULT_PAGE_NUMBER;
2302
+ pageSize.value = ((_d2 = (_c2 = props.options) == null ? void 0 : _c2.pagination) == null ? void 0 : _d2.pageSize) ?? DEFAULT_PAGE_SIZE;
2303
+ total.value = ((_f = (_e = s2Ref.value) == null ? void 0 : _e.facet) == null ? void 0 : _f.viewCellHeights.getTotalLength()) ?? 0;
2295
2304
  },
2296
2305
  {
2297
2306
  immediate: true
@@ -2342,9 +2351,7 @@ const _sfc_main$5 = vue.defineComponent({
2342
2351
  },
2343
2352
  emits: ["change", "showSizeChange"],
2344
2353
  setup: (props) => {
2345
- const showQuickJumper = vue.computed(() => {
2346
- return props.total / props.pageSize > 5;
2347
- });
2354
+ const showQuickJumper = vue.computed(() => props.total / props.pageSize > 5);
2348
2355
  return {
2349
2356
  showQuickJumper,
2350
2357
  PRE_CLASS,
@@ -2373,7 +2380,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
2373
2380
  }, null, 8, ["current", "total", "pageSize", "showQuickJumper"]),
2374
2381
  vue.createElementVNode("span", {
2375
2382
  class: vue.normalizeClass(`${_ctx.PRE_CLASS}-count`)
2376
- }, vue.toDisplayString(_ctx.i18n("\u5171\u8BA1")) + " " + vue.toDisplayString(_ctx.total || " - ") + " " + vue.toDisplayString(_ctx.i18n("\u6761")), 3)
2383
+ }, vue.toDisplayString(_ctx.i18n("共计")) + " " + vue.toDisplayString(_ctx.total || " - ") + " " + vue.toDisplayString(_ctx.i18n("")), 3)
2377
2384
  ], 2);
2378
2385
  }
2379
2386
  const S2Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
@@ -2420,11 +2427,12 @@ const useEvents = (s2Ref, emit) => {
2420
2427
  useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_MOUSE_DOWN, "rowCellMouseDown");
2421
2428
  useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_MOUSE_UP, "rowCellMouseUp");
2422
2429
  useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_MOUSE_MOVE, "rowCellMouseMove");
2430
+ useS2Event(s2Ref, emit, s2.S2Event.ROW_CELL_COLLAPSED, "rowCellCollapsed");
2423
2431
  useS2Event(
2424
2432
  s2Ref,
2425
2433
  emit,
2426
- s2.S2Event.ROW_CELL_COLLAPSE_TREE_ROWS,
2427
- "rowCellCollapseTreeRows"
2434
+ s2.S2Event.ROW_CELL_ALL_COLLAPSED,
2435
+ "rowCellAllCollapsed"
2428
2436
  );
2429
2437
  useS2Event(s2Ref, emit, s2.S2Event.ROW_CELL_SCROLL, "rowCellScroll");
2430
2438
  useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_HOVER, "colCellHover");
@@ -2444,6 +2452,8 @@ const useEvents = (s2Ref, emit) => {
2444
2452
  useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_MOUSE_DOWN, "colCellMouseDown");
2445
2453
  useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_MOUSE_UP, "colCellMouseUp");
2446
2454
  useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_MOUSE_MOVE, "colCellMouseMove");
2455
+ useS2Event(s2Ref, emit, s2.S2Event.COL_CELL_EXPANDED, "colCellExpanded");
2456
+ useS2Event(s2Ref, emit, s2.S2Event.COL_CELL_HIDDEN, "colCellHidden");
2447
2457
  useCellEvent(s2Ref, emit, s2.S2Event.DATA_CELL_HOVER, "dataCellHover");
2448
2458
  useCellEvent(s2Ref, emit, s2.S2Event.DATA_CELL_CLICK, "dataCellClick");
2449
2459
  useCellEvent(
@@ -2471,12 +2481,6 @@ const useEvents = (s2Ref, emit) => {
2471
2481
  s2.S2Event.DATA_CELL_MOUSE_MOVE,
2472
2482
  "dataCellMouseMove"
2473
2483
  );
2474
- useS2Event(
2475
- s2Ref,
2476
- emit,
2477
- s2.S2Event.DATA_CELL_TREND_ICON_CLICK,
2478
- "dataCellTrendIconClick"
2479
- );
2480
2484
  useS2Event(
2481
2485
  s2Ref,
2482
2486
  emit,
@@ -2564,21 +2568,6 @@ const useEvents = (s2Ref, emit) => {
2564
2568
  "layoutAfterHeaderLayout"
2565
2569
  );
2566
2570
  useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_PAGINATION, "layoutPagination");
2567
- useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_CELL_SCROLL, "layoutCellScroll");
2568
- useS2Event(
2569
- s2Ref,
2570
- emit,
2571
- s2.S2Event.LAYOUT_AFTER_COLLAPSE_ROWS,
2572
- "layoutAfterCollapseRows"
2573
- );
2574
- useS2Event(
2575
- s2Ref,
2576
- emit,
2577
- s2.S2Event.LAYOUT_TREE_ROWS_COLLAPSE_ALL,
2578
- "collapseRowsAll"
2579
- );
2580
- useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_COLS_EXPANDED, "layoutColsExpanded");
2581
- useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_COLS_HIDDEN, "layoutColsHidden");
2582
2571
  useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_BEFORE_RENDER, "beforeRender");
2583
2572
  useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_AFTER_RENDER, "afterRender");
2584
2573
  useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_DESTROY, "destroy");
@@ -2661,6 +2650,12 @@ const useEvents = (s2Ref, emit) => {
2661
2650
  useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_RESET, "reset");
2662
2651
  useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_LINK_FIELD_JUMP, "linkFieldJump");
2663
2652
  useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_SCROLL, "scroll");
2653
+ useS2Event(
2654
+ s2Ref,
2655
+ emit,
2656
+ s2.S2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDER,
2657
+ "layoutAfterRealDataCellRender"
2658
+ );
2664
2659
  useS2Event(
2665
2660
  s2Ref,
2666
2661
  emit,
@@ -2749,24 +2744,21 @@ const useSheetUpdate = (s2Ref, props) => {
2749
2744
  };
2750
2745
  const useResize = (s2Ref, props, dom) => {
2751
2746
  const unobserve = vue.ref();
2752
- vue.watch(
2753
- [s2Ref, () => props.adaptive],
2754
- ([s22, adaptive], _, onCleanup) => {
2755
- if (!s22) {
2756
- return;
2757
- }
2758
- unobserve.value = createResizeObserver({
2759
- s2: s22,
2760
- adaptive,
2761
- wrapper: dom.wrapperRef.value,
2762
- container: dom.containerRef.value
2763
- });
2764
- onCleanup(() => {
2765
- var _a;
2766
- (_a = unobserve.value) == null ? void 0 : _a.call(unobserve);
2767
- });
2747
+ vue.watch([s2Ref, () => props.adaptive], ([s22, adaptive], _, onCleanup) => {
2748
+ if (!s22) {
2749
+ return;
2768
2750
  }
2769
- );
2751
+ unobserve.value = createResizeObserver({
2752
+ s2: s22,
2753
+ adaptive,
2754
+ wrapper: dom.wrapperRef.value,
2755
+ container: dom.containerRef.value
2756
+ });
2757
+ onCleanup(() => {
2758
+ var _a;
2759
+ (_a = unobserve.value) == null ? void 0 : _a.call(unobserve);
2760
+ });
2761
+ });
2770
2762
  };
2771
2763
  function useSpreadSheet(props, emit) {
2772
2764
  const {
@@ -2776,8 +2768,7 @@ function useSpreadSheet(props, emit) {
2776
2768
  loading: loadingProps,
2777
2769
  sheetType,
2778
2770
  onSpreadsheet,
2779
- onMounted: onS2Mounted,
2780
- onGetSpreadSheet
2771
+ onMounted: onS2Mounted
2781
2772
  } = props;
2782
2773
  const wrapperRef = vue.ref();
2783
2774
  const containerRef = vue.ref();
@@ -2802,7 +2793,6 @@ function useSpreadSheet(props, emit) {
2802
2793
  s2Ref.value.setThemeCfg(vue.toRaw(themeCfg));
2803
2794
  s2Ref.value.render();
2804
2795
  setLoading(false);
2805
- onGetSpreadSheet == null ? void 0 : onGetSpreadSheet(s2Ref.value);
2806
2796
  onS2Mounted == null ? void 0 : onS2Mounted(s2Ref.value);
2807
2797
  };
2808
2798
  vue.onMounted(buildSpreadSheet);
@@ -2822,53 +2812,57 @@ function useSpreadSheet(props, emit) {
2822
2812
  pagination
2823
2813
  };
2824
2814
  }
2825
- const initBaseSheetProps = () => ({
2826
- sheetType: String,
2827
- dataCfg: Object,
2828
- themeCfg: Object,
2829
- showPagination: {
2830
- type: [Object, Boolean],
2831
- default: false
2832
- },
2833
- loading: Boolean,
2834
- partDrillDown: Object,
2835
- header: Object,
2836
- options: {
2837
- type: Object,
2838
- default: {}
2839
- },
2840
- adaptive: {
2841
- type: [Object, Boolean],
2842
- default: false
2843
- },
2844
- onSpreadsheet: Function,
2845
- onGetSpreadSheet: Function,
2846
- onMounted: Function
2847
- });
2848
- const initDrillDownProps = () => ({
2849
- className: String,
2850
- titleText: {
2851
- type: String,
2852
- default: s2.i18n("\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6")
2853
- },
2854
- searchText: {
2855
- type: String,
2856
- default: s2.i18n("\u641C\u7D22\u5B57\u6BB5")
2857
- },
2858
- clearButtonText: {
2859
- type: String,
2860
- default: s2.i18n("\u6062\u590D\u9ED8\u8BA4")
2861
- },
2862
- extra: Node,
2863
- dataSet: {
2864
- type: Array,
2865
- default: []
2866
- },
2867
- drillFields: Array,
2868
- disabledFields: Array,
2869
- getDrillFields: Function,
2870
- setDrillFields: Function
2871
- });
2815
+ const initBaseSheetProps = () => {
2816
+ return {
2817
+ sheetType: String,
2818
+ dataCfg: Object,
2819
+ themeCfg: Object,
2820
+ showPagination: {
2821
+ type: [Object, Boolean],
2822
+ default: false
2823
+ },
2824
+ loading: Boolean,
2825
+ // TODO: 待后续完善
2826
+ partDrillDown: Object,
2827
+ header: Object,
2828
+ options: {
2829
+ type: Object,
2830
+ default: {}
2831
+ },
2832
+ adaptive: {
2833
+ type: [Object, Boolean],
2834
+ default: false
2835
+ },
2836
+ onSpreadsheet: Function,
2837
+ onMounted: Function
2838
+ };
2839
+ };
2840
+ const initDrillDownProps = () => {
2841
+ return {
2842
+ className: String,
2843
+ titleText: {
2844
+ type: String,
2845
+ default: s2.i18n("选择下钻维度")
2846
+ },
2847
+ searchText: {
2848
+ type: String,
2849
+ default: s2.i18n("搜索字段")
2850
+ },
2851
+ clearButtonText: {
2852
+ type: String,
2853
+ default: s2.i18n("恢复默认")
2854
+ },
2855
+ extra: Node,
2856
+ dataSet: {
2857
+ type: Array,
2858
+ default: []
2859
+ },
2860
+ drillFields: Array,
2861
+ disabledFields: Array,
2862
+ getDrillFields: Function,
2863
+ setDrillFields: Function
2864
+ };
2865
+ };
2872
2866
  const initDrillDownEmits = () => {
2873
2867
  const keys2 = ["getDrillFields", "setDrillFields"];
2874
2868
  return keys2;
@@ -2876,7 +2870,7 @@ const initDrillDownEmits = () => {
2876
2870
  const initBaseSheetEmits = () => {
2877
2871
  const keys2 = [
2878
2872
  "spreadsheet",
2879
- "getSpreadSheet",
2873
+ // ============== Row Cell ====================
2880
2874
  "rowCellHover",
2881
2875
  "rowCellClick",
2882
2876
  "rowCellDoubleClick",
@@ -2884,8 +2878,10 @@ const initBaseSheetEmits = () => {
2884
2878
  "rowCellMouseDown",
2885
2879
  "rowCellMouseUp",
2886
2880
  "rowCellMouseMove",
2887
- "rowCellCollapseTreeRows",
2881
+ "rowCellCollapsed",
2882
+ "rowCellAllCollapsed",
2888
2883
  "rowCellScroll",
2884
+ // ============== Col Cell ====================
2889
2885
  "colCellHover",
2890
2886
  "colCellClick",
2891
2887
  "colCellDoubleClick",
@@ -2893,6 +2889,9 @@ const initBaseSheetEmits = () => {
2893
2889
  "colCellMouseDown",
2894
2890
  "colCellMouseUp",
2895
2891
  "colCellMouseMove",
2892
+ "colCellExpanded",
2893
+ "colCellHidden",
2894
+ // ============== Data Cell ====================
2896
2895
  "dataCellHover",
2897
2896
  "dataCellClick",
2898
2897
  "dataCellDoubleClick",
@@ -2900,9 +2899,9 @@ const initBaseSheetEmits = () => {
2900
2899
  "dataCellMouseDown",
2901
2900
  "dataCellMouseUp",
2902
2901
  "dataCellMouseMove",
2903
- "dataCellTrendIconClick",
2904
2902
  "dataCellBrushSelection",
2905
2903
  "dataCellSelectMove",
2904
+ // ============== Corner Cell ====================
2906
2905
  "cornerCellHover",
2907
2906
  "cornerCellClick",
2908
2907
  "cornerCellDoubleClick",
@@ -2910,6 +2909,7 @@ const initBaseSheetEmits = () => {
2910
2909
  "cornerCellMouseDown",
2911
2910
  "cornerCellMouseUp",
2912
2911
  "cornerCellMouseMove",
2912
+ // ============== Merged Cells ====================
2913
2913
  "mergedCellsHover",
2914
2914
  "mergedCellsClick",
2915
2915
  "mergedCellsDoubleClick",
@@ -2917,22 +2917,20 @@ const initBaseSheetEmits = () => {
2917
2917
  "mergedCellsMouseDown",
2918
2918
  "mergedCellsMouseUp",
2919
2919
  "mergedCellsMouseMove",
2920
+ // ============== Sort ====================
2920
2921
  "rangeSort",
2921
2922
  "rangeSorted",
2923
+ // ============== Filter ====================
2922
2924
  "rangeFilter",
2923
2925
  "rangeFiltered",
2926
+ // ============== Layout ====================
2924
2927
  "layoutAfterHeaderLayout",
2925
2928
  "layoutPagination",
2926
- "layoutCellScroll",
2927
- "layoutCollapseRows",
2928
- "layoutAfterCollapseRows",
2929
- "collapseRowsAll",
2930
- "layoutColsExpanded",
2931
- "layoutColsHidden",
2932
2929
  "beforeRender",
2933
2930
  "afterRender",
2934
2931
  "mounted",
2935
2932
  "destroy",
2933
+ // ============== Resize ====================
2936
2934
  "layoutResize",
2937
2935
  "layoutResizeSeriesWidth",
2938
2936
  "layoutResizeRowWidth",
@@ -2943,6 +2941,7 @@ const initBaseSheetEmits = () => {
2943
2941
  "layoutResizeMouseDown",
2944
2942
  "layoutResizeMouseUp",
2945
2943
  "layoutResizeMouseMove",
2944
+ // ============== Global ====================
2946
2945
  "keyBoardDown",
2947
2946
  "keyBoardUp",
2948
2947
  "copied",
@@ -2960,6 +2959,8 @@ const initBaseSheetEmits = () => {
2960
2959
  "doubleClick",
2961
2960
  "scroll",
2962
2961
  "hover",
2962
+ // ============== Auto 自动生成的 ================
2963
+ "layoutAfterRealDataCellRender",
2963
2964
  "rowCellBrushSelection",
2964
2965
  "colCellBrushSelection"
2965
2966
  ];
@@ -3114,12 +3115,10 @@ const _sfc_main$3 = vue.defineComponent({
3114
3115
  setDrillFields,
3115
3116
  className
3116
3117
  } = props;
3117
- const getOptions = () => {
3118
- return dataSet.map((val) => {
3119
- val.disabled = !!(disabledFields && disabledFields.includes(val.value));
3120
- return val;
3121
- });
3122
- };
3118
+ const getOptions = () => dataSet.map((val) => {
3119
+ val.disabled = !!(disabledFields && disabledFields.includes(val.value));
3120
+ return val;
3121
+ });
3123
3122
  const options = vue.ref(getOptions());
3124
3123
  const selected = vue.ref([]);
3125
3124
  const handleSearch = (e) => {
@@ -3164,7 +3163,7 @@ const _sfc_main$3 = vue.defineComponent({
3164
3163
  };
3165
3164
  }
3166
3165
  });
3167
- const index_vue_vue_type_style_index_0_scoped_1a60f775_lang = "";
3166
+ const index_vue_vue_type_style_index_0_scoped_8dd920ec_lang = "";
3168
3167
  function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
3169
3168
  const _component_Button = vue.resolveComponent("Button");
3170
3169
  const _component_Input = vue.resolveComponent("Input");
@@ -3232,7 +3231,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
3232
3231
  }, 8, ["selectedKeys", "onSelect"])
3233
3232
  ], 2);
3234
3233
  }
3235
- const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-1a60f775"]]);
3234
+ const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-8dd920ec"]]);
3236
3235
  const _sfc_main$2 = vue.defineComponent({
3237
3236
  name: "PivotSheet",
3238
3237
  props: initBaseSheetProps(),
@@ -3243,7 +3242,7 @@ const _sfc_main$2 = vue.defineComponent({
3243
3242
  const { dataCfg, partDrillDown } = vue.toRefs(props);
3244
3243
  const drillFields = vue.ref([]);
3245
3244
  const setDrillFields = (fields) => {
3246
- var _a, _b, _c, _d, _e, _f;
3245
+ var _a, _b, _c, _d, _e;
3247
3246
  const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
3248
3247
  drillFields.value = fields;
3249
3248
  instance == null ? void 0 : instance.hideTooltip();
@@ -3251,10 +3250,10 @@ const _sfc_main$2 = vue.defineComponent({
3251
3250
  instance == null ? void 0 : instance.clearDrillDownData((_b = instance == null ? void 0 : instance.store.get("drillDownNode")) == null ? void 0 : _b.id);
3252
3251
  } else {
3253
3252
  handleDrillDown({
3254
- rows: (_d = (_c = dataCfg.value) == null ? void 0 : _c.fields.rows) != null ? _d : [],
3253
+ rows: ((_c = dataCfg.value) == null ? void 0 : _c.fields.rows) ?? [],
3255
3254
  drillFields: fields,
3256
- fetchData: (_e = partDrillDown.value) == null ? void 0 : _e.fetchData,
3257
- drillItemsNum: (_f = partDrillDown.value) == null ? void 0 : _f.drillItemsNum,
3255
+ fetchData: (_d = partDrillDown.value) == null ? void 0 : _d["fetchData"],
3256
+ drillItemsNum: (_e = partDrillDown.value) == null ? void 0 : _e["drillItemsNum"],
3258
3257
  spreadsheet: instance
3259
3258
  });
3260
3259
  }
@@ -3265,7 +3264,7 @@ const _sfc_main$2 = vue.defineComponent({
3265
3264
  if (event) {
3266
3265
  const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
3267
3266
  const drillDownNode = vue.createVNode(DrillDown, {
3268
- ...(_b = partDrillDown.value) == null ? void 0 : _b.drillConfig,
3267
+ ...(_b = partDrillDown.value) == null ? void 0 : _b["drillConfig"],
3269
3268
  setDrillFields,
3270
3269
  drillFields: drillFields.value,
3271
3270
  disabledFields
@@ -3328,7 +3327,7 @@ const _sfc_main = vue.defineComponent({
3328
3327
  setup(props, ctx) {
3329
3328
  const s2Ref = useExpose(ctx.expose);
3330
3329
  const sheetType = vue.computed(() => {
3331
- const type = ctx.attrs.sheetType;
3330
+ const type = ctx.attrs["sheetType"];
3332
3331
  switch (type) {
3333
3332
  case "table":
3334
3333
  return TableSheet;