@antv/s2-vue 2.0.0-alpha.1 → 2.0.0-next.10

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,
@@ -85,11 +93,10 @@ const Locale = {
85
93
  };
86
94
  const SHEET_COMPONENT_DEFAULT_OPTIONS = {
87
95
  tooltip: {
88
- showTooltip: true,
96
+ enable: true,
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,11 @@ 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" || // Node.js 0.10 has enumerable non-index properties on buffers.
453
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
454
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
455
+ isIndex(key, length)))) {
447
456
  result.push(key);
448
457
  }
449
458
  }
@@ -1611,7 +1620,7 @@ function size(collection) {
1611
1620
  return baseKeys(collection).length;
1612
1621
  }
1613
1622
  const analyzeAdaptive = (defaultContainer, adaptive) => {
1614
- var _a, _b, _c;
1623
+ var _a;
1615
1624
  if (isBoolean(adaptive)) {
1616
1625
  return {
1617
1626
  container: defaultContainer,
@@ -1621,30 +1630,30 @@ const analyzeAdaptive = (defaultContainer, adaptive) => {
1621
1630
  }
1622
1631
  return {
1623
1632
  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
1633
+ adaptiveWidth: (adaptive == null ? void 0 : adaptive.width) ?? true,
1634
+ adaptiveHeight: (adaptive == null ? void 0 : adaptive.height) ?? true
1626
1635
  };
1627
1636
  };
1628
1637
  const createResizeObserver = (params) => {
1629
1638
  let isFirstRender = true;
1630
- const { s2: s22, adaptive, container, wrapper } = params;
1639
+ const { s2: s2$1, adaptive, container, wrapper } = params;
1631
1640
  const {
1632
1641
  container: actualWrapper,
1633
1642
  adaptiveWidth,
1634
1643
  adaptiveHeight
1635
1644
  } = analyzeAdaptive(wrapper, adaptive);
1636
- if (!actualWrapper || !container || !adaptive || !s22) {
1645
+ if (!actualWrapper || !container || !adaptive || !s2$1) {
1637
1646
  return;
1638
1647
  }
1639
1648
  const render2 = (width, height) => {
1640
- s22 == null ? void 0 : s22.changeSheetSize(width, height);
1641
- s22 == null ? void 0 : s22.render(false);
1649
+ s2$1 == null ? void 0 : s2$1.changeSheetSize(width, height);
1650
+ s2$1 == null ? void 0 : s2$1.render(false);
1642
1651
  };
1643
1652
  const debounceRender = debounce(render2, RESIZE_RENDER_DELAY);
1644
1653
  const onResize = () => {
1645
1654
  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;
1655
+ const width = adaptiveWidth ? s2.floor(containerWidth ?? s2$1.options.width) : s2$1.options.width;
1656
+ const height = adaptiveHeight ? s2.floor(containerHeight ?? s2$1.options.height) : s2$1.options.height;
1648
1657
  if (!adaptiveWidth && !adaptiveHeight) {
1649
1658
  return;
1650
1659
  }
@@ -1717,21 +1726,23 @@ const buildDrillDownOptions = (options, partDrillDown, callback) => {
1717
1726
  const nextHeaderIcons = ((_a = options == null ? void 0 : options.headerActionIcons) == null ? void 0 : _a.length) ? [...options.headerActionIcons] : [];
1718
1727
  if (!isEmpty(partDrillDown)) {
1719
1728
  const drillDownActionIcon = {
1720
- belongsCell: "rowCell",
1721
- iconNames: ["DrillDownIcon"],
1722
- defaultHide: true,
1723
- displayCondition: partDrillDown.displayCondition || defaultPartDrillDownDisplayCondition,
1724
- action: (actionIconProps) => {
1725
- const { iconName, meta, event } = actionIconProps;
1726
- if (iconName === "DrillDownIcon") {
1727
- meta.spreadsheet.store.set("drillDownNode", meta);
1728
- handleActionIconClick({
1729
- meta,
1730
- event,
1731
- callback
1732
- });
1729
+ icons: [
1730
+ {
1731
+ name: "DrillDownIcon",
1732
+ position: "right",
1733
+ onClick: ({ meta, event }) => {
1734
+ meta.spreadsheet.store.set("drillDownNode", meta);
1735
+ handleActionIconClick({
1736
+ meta,
1737
+ event,
1738
+ callback
1739
+ });
1740
+ }
1733
1741
  }
1734
- }
1742
+ ],
1743
+ belongsCell: "rowCell",
1744
+ defaultHide: false,
1745
+ displayCondition: (partDrillDown == null ? void 0 : partDrillDown.displayCondition) || defaultPartDrillDownDisplayCondition
1735
1746
  };
1736
1747
  nextHeaderIcons.push(drillDownActionIcon);
1737
1748
  }
@@ -1849,7 +1860,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
1849
1860
  key: col.value
1850
1861
  }, vue.toDisplayString(col.value) + "/", 1);
1851
1862
  }), 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),
1863
+ ((_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
1864
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.rows, (row) => {
1854
1865
  return vue.openBlock(), vue.createElementBlock("span", {
1855
1866
  key: row.value
@@ -1931,8 +1942,8 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1931
1942
  }, [
1932
1943
  vue.createElementVNode("span", {
1933
1944
  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)
1945
+ }, vue.toDisplayString(_ctx.summaryInfo.count) + " " + vue.toDisplayString(_ctx.i18n("")), 3),
1946
+ vue.createTextVNode(" " + vue.toDisplayString(_ctx.i18n("已选择")), 1)
1936
1947
  ], 2),
1937
1948
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.summaryInfo.summaries, (summary) => {
1938
1949
  return vue.openBlock(), vue.createElementBlock("div", {
@@ -1941,7 +1952,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1941
1952
  }, [
1942
1953
  vue.createElementVNode("span", {
1943
1954
  class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-key`)
1944
- }, vue.toDisplayString(summary.name) + " (" + vue.toDisplayString(_ctx.i18n("\u603B\u548C")) + ") ", 3),
1955
+ }, vue.toDisplayString(summary.name) + " (" + vue.toDisplayString(_ctx.i18n("总和")) + ") ", 3),
1945
1956
  vue.createElementVNode("span", {
1946
1957
  class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-val ${_ctx.TOOLTIP_PREFIX_CLS}-bold`)
1947
1958
  }, vue.toDisplayString(summary.value), 3)
@@ -1971,7 +1982,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
1971
1982
  }, null, 10, _hoisted_1$3)) : vue.createCommentVNode("", true),
1972
1983
  vue.createElementVNode("span", {
1973
1984
  class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-text`)
1974
- }, vue.toDisplayString(_ctx.menu.text), 3)
1985
+ }, vue.toDisplayString(_ctx.menu.label), 3)
1975
1986
  ]);
1976
1987
  }
1977
1988
  const TooltipOperatorTitle = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9]]);
@@ -1979,9 +1990,10 @@ const _sfc_main$8 = vue.defineComponent({
1979
1990
  name: "TooltipOperatorMenu",
1980
1991
  props: ["menu", "cell"],
1981
1992
  setup(props) {
1993
+ const { menu, cell } = props;
1982
1994
  const onMenuTitleClick = () => {
1983
1995
  var _a, _b;
1984
- (_b = (_a = props.menu).onClick) == null ? void 0 : _b.call(_a, props.cell);
1996
+ (_b = (_a = props.menu).onClick) == null ? void 0 : _b.call(_a, menu, cell);
1985
1997
  };
1986
1998
  return {
1987
1999
  onMenuTitleClick,
@@ -2023,7 +2035,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
2023
2035
  menu: subMenu,
2024
2036
  cell: _ctx.cell
2025
2037
  }, null, 8, ["menu", "cell"])) : (vue.openBlock(), vue.createBlock(_component_MenuItem, {
2026
- title: subMenu.text,
2038
+ title: subMenu.label,
2027
2039
  key: subMenu.key
2028
2040
  }, {
2029
2041
  default: vue.withCtx(() => [
@@ -2040,7 +2052,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
2040
2052
  _: 1
2041
2053
  }, 8, ["popupClassName", "onTitleClick"])) : vue.createCommentVNode("", true),
2042
2054
  _ctx.isEmpty(_ctx.menu.children) ? (vue.openBlock(), vue.createBlock(_component_MenuItem, {
2043
- title: _ctx.menu.text,
2055
+ title: _ctx.menu.label,
2044
2056
  key: _ctx.menu.key
2045
2057
  }, {
2046
2058
  default: vue.withCtx(() => [
@@ -2057,18 +2069,24 @@ const TooltipOperatorMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render",
2057
2069
  const _sfc_main$7 = vue.defineComponent({
2058
2070
  name: "TooltipOperator",
2059
2071
  props: [
2060
- "menus",
2061
- "onlyMenu",
2062
- "onClick",
2072
+ "menu",
2073
+ "onlyShowOperator",
2063
2074
  "cell"
2064
2075
  ],
2065
- setup(_, { emit }) {
2076
+ setup(props) {
2077
+ const { menu, cell } = props;
2066
2078
  const onMenuClick = (menuInfo) => {
2067
- emit("click", menuInfo);
2079
+ var _a;
2080
+ (_a = menu == null ? void 0 : menu.onClick) == null ? void 0 : _a.call(menu, menuInfo, cell);
2081
+ };
2082
+ const onMenuTitleClick = (subMenu) => () => {
2083
+ subMenu == null ? void 0 : subMenu.onClick(subMenu, cell);
2068
2084
  };
2069
2085
  return {
2070
2086
  TOOLTIP_PREFIX_CLS: s2.TOOLTIP_PREFIX_CLS,
2071
- onMenuClick
2087
+ onMenuClick,
2088
+ onMenuTitleClick,
2089
+ menus: menu == null ? void 0 : menu.items
2072
2090
  };
2073
2091
  },
2074
2092
  components: {
@@ -2087,7 +2105,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
2087
2105
  return vue.openBlock(), vue.createElementBlock("div", {
2088
2106
  class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator`)
2089
2107
  }, [
2090
- _ctx.onlyMenu ? (vue.openBlock(), vue.createBlock(_component_Menu, {
2108
+ _ctx.onlyShowOperator ? (vue.openBlock(), vue.createBlock(_component_Menu, {
2091
2109
  key: 0,
2092
2110
  class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-menus`),
2093
2111
  onClick: _ctx.onMenuClick
@@ -2131,10 +2149,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
2131
2149
  default: vue.withCtx(() => [
2132
2150
  vue.createVNode(_component_TooltipOperatorTitle, {
2133
2151
  menu,
2134
- onClick: ($event) => {
2135
- var _a;
2136
- return (_a = menu.onClick) == null ? void 0 : _a.call(menu, _ctx.cell);
2137
- }
2152
+ onClick: ($event) => _ctx.onMenuTitleClick(menu)
2138
2153
  }, null, 8, ["menu", "onClick"])
2139
2154
  ]),
2140
2155
  _: 2
@@ -2154,10 +2169,12 @@ const _sfc_main$6 = vue.defineComponent({
2154
2169
  "content"
2155
2170
  ],
2156
2171
  setup(props) {
2157
- const { operator, onlyMenu } = s2.getTooltipDefaultOptions(props.options);
2172
+ const { operator, onlyShowOperator } = s2.getTooltipDefaultOptions(
2173
+ props.options
2174
+ );
2158
2175
  return {
2159
2176
  operator,
2160
- onlyMenu
2177
+ onlyShowOperator
2161
2178
  };
2162
2179
  },
2163
2180
  components: {
@@ -2171,45 +2188,43 @@ const _sfc_main$6 = vue.defineComponent({
2171
2188
  });
2172
2189
  const index_vue_vue_type_style_index_0_lang = "";
2173
2190
  function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
2174
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
2191
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
2175
2192
  const _component_TooltipOperator = vue.resolveComponent("TooltipOperator");
2176
2193
  const _component_TooltipSimpleTips = vue.resolveComponent("TooltipSimpleTips");
2177
2194
  const _component_TooltipSummary = vue.resolveComponent("TooltipSummary");
2178
2195
  const _component_TooltipHeadInfo = vue.resolveComponent("TooltipHeadInfo");
2179
2196
  const _component_TooltipDetail = vue.resolveComponent("TooltipDetail");
2180
2197
  const _component_TooltipInfos = vue.resolveComponent("TooltipInfos");
2181
- return _ctx.onlyMenu ? (vue.openBlock(), vue.createBlock(_component_TooltipOperator, {
2198
+ return _ctx.onlyShowOperator ? (vue.openBlock(), vue.createBlock(_component_TooltipOperator, {
2182
2199
  key: 0,
2183
- menus: ((_a = _ctx.operator) == null ? void 0 : _a.menus) || [],
2184
- onlyMenu: true,
2185
- cell: _ctx.cell,
2186
- onClick: (_b = _ctx.operator) == null ? void 0 : _b.onClick
2187
- }, null, 8, ["menus", "cell", "onClick"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2200
+ menu: (_a = _ctx.operator) == null ? void 0 : _a.menu,
2201
+ onlyShowOperator: true,
2202
+ cell: _ctx.cell
2203
+ }, null, 8, ["menu", "cell"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2188
2204
  vue.createVNode(_component_TooltipOperator, {
2189
- menus: ((_c = _ctx.operator) == null ? void 0 : _c.menus) || [],
2190
- onlyMenu: false,
2191
- cell: _ctx.cell,
2192
- onClick: (_d = _ctx.operator) == null ? void 0 : _d.onClick
2193
- }, null, 8, ["menus", "cell", "onClick"]),
2205
+ menu: (_b = _ctx.operator) == null ? void 0 : _b.menu,
2206
+ onlyShowOperator: false,
2207
+ cell: _ctx.cell
2208
+ }, null, 8, ["menu", "cell"]),
2194
2209
  _ctx.content ? vue.renderSlot(_ctx.$slots, "content", { key: 0 }) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2195
2210
  vue.createVNode(_component_TooltipSimpleTips, {
2196
- name: (_e = _ctx.data) == null ? void 0 : _e.name,
2197
- tips: (_f = _ctx.data) == null ? void 0 : _f.tips
2211
+ name: (_c = _ctx.data) == null ? void 0 : _c.name,
2212
+ tips: (_d = _ctx.data) == null ? void 0 : _d.tips
2198
2213
  }, null, 8, ["name", "tips"]),
2199
- ((_h = (_g = _ctx.data) == null ? void 0 : _g.summaries) == null ? void 0 : _h.length) ? (vue.openBlock(), vue.createBlock(_component_TooltipSummary, {
2214
+ ((_f = (_e = _ctx.data) == null ? void 0 : _e.summaries) == null ? void 0 : _f.length) ? (vue.openBlock(), vue.createBlock(_component_TooltipSummary, {
2200
2215
  key: 0,
2201
- summaries: (_i = _ctx.data) == null ? void 0 : _i.summaries
2216
+ summaries: (_g = _ctx.data) == null ? void 0 : _g.summaries
2202
2217
  }, null, 8, ["summaries"])) : vue.createCommentVNode("", true),
2203
2218
  vue.createVNode(_component_TooltipHeadInfo, {
2204
- rows: ((_k = (_j = _ctx.data) == null ? void 0 : _j.headInfo) == null ? void 0 : _k.rows) || [],
2205
- cols: ((_m = (_l = _ctx.data) == null ? void 0 : _l.headInfo) == null ? void 0 : _m.cols) || []
2219
+ rows: ((_i = (_h = _ctx.data) == null ? void 0 : _h.headInfo) == null ? void 0 : _i.rows) || [],
2220
+ cols: ((_k = (_j = _ctx.data) == null ? void 0 : _j.headInfo) == null ? void 0 : _k.cols) || []
2206
2221
  }, null, 8, ["rows", "cols"]),
2207
2222
  vue.createVNode(_component_TooltipDetail, {
2208
- list: ((_n = _ctx.data) == null ? void 0 : _n.details) || []
2223
+ list: ((_l = _ctx.data) == null ? void 0 : _l.details) || []
2209
2224
  }, null, 8, ["list"]),
2210
- ((_o = _ctx.data) == null ? void 0 : _o.infos) ? (vue.openBlock(), vue.createBlock(_component_TooltipInfos, {
2225
+ ((_m = _ctx.data) == null ? void 0 : _m.infos) ? (vue.openBlock(), vue.createBlock(_component_TooltipInfos, {
2211
2226
  key: 1,
2212
- infos: (_p = _ctx.data) == null ? void 0 : _p.infos
2227
+ infos: (_n = _ctx.data) == null ? void 0 : _n.infos
2213
2228
  }, null, 8, ["infos"])) : vue.createCommentVNode("", true)
2214
2229
  ], 64))
2215
2230
  ], 64));
@@ -2220,13 +2235,13 @@ class CustomTooltip extends s2.BaseTooltip {
2220
2235
  super(spreadsheet);
2221
2236
  }
2222
2237
  renderContent() {
2223
- var _a, _b;
2238
+ var _a;
2224
2239
  const { tooltip } = this.spreadsheet.options;
2225
2240
  const showOptions = this.options;
2226
2241
  const cell = this.spreadsheet.getCell(
2227
2242
  (_a = showOptions.event) == null ? void 0 : _a.target
2228
2243
  );
2229
- const content = (_b = showOptions.content) != null ? _b : tooltip == null ? void 0 : tooltip.content;
2244
+ const content = showOptions.content ?? (tooltip == null ? void 0 : tooltip.content);
2230
2245
  const tooltipProps = {
2231
2246
  ...showOptions,
2232
2247
  cell,
@@ -2252,12 +2267,12 @@ class CustomTooltip extends s2.BaseTooltip {
2252
2267
  const DEFAULT_PAGE_NUMBER = 1;
2253
2268
  const DEFAULT_PAGE_SIZE = 10;
2254
2269
  const usePagination = (s2Ref, props) => {
2255
- var _a, _b, _c, _d, _e, _f;
2270
+ var _a, _b, _c, _d;
2256
2271
  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
2272
+ ((_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) ?? DEFAULT_PAGE_NUMBER
2258
2273
  );
2259
2274
  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
2275
+ ((_d = (_c = props.options) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageSize) ?? DEFAULT_PAGE_SIZE
2261
2276
  );
2262
2277
  const total = vue.ref(0);
2263
2278
  const change = (nextCurrent) => {
@@ -2266,10 +2281,12 @@ const usePagination = (s2Ref, props) => {
2266
2281
  const showSizeChange = (nextPageSize) => {
2267
2282
  pageSize.value = nextPageSize;
2268
2283
  };
2269
- const visible = vue.computed(() => {
2270
- var _a2;
2271
- return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
2272
- });
2284
+ const visible = vue.computed(
2285
+ () => {
2286
+ var _a2;
2287
+ return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
2288
+ }
2289
+ );
2273
2290
  vue.watch([current, pageSize], () => {
2274
2291
  var _a2;
2275
2292
  if (!s2Ref.value) {
@@ -2288,10 +2305,10 @@ const usePagination = (s2Ref, props) => {
2288
2305
  return (_a2 = props.options) == null ? void 0 : _a2.pagination;
2289
2306
  }, s2Ref],
2290
2307
  () => {
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;
2308
+ var _a2, _b2, _c2, _d2, _e, _f;
2309
+ current.value = ((_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) ?? DEFAULT_PAGE_NUMBER;
2310
+ pageSize.value = ((_d2 = (_c2 = props.options) == null ? void 0 : _c2.pagination) == null ? void 0 : _d2.pageSize) ?? DEFAULT_PAGE_SIZE;
2311
+ total.value = ((_f = (_e = s2Ref.value) == null ? void 0 : _e.facet) == null ? void 0 : _f.viewCellHeights.getTotalLength()) ?? 0;
2295
2312
  },
2296
2313
  {
2297
2314
  immediate: true
@@ -2342,9 +2359,7 @@ const _sfc_main$5 = vue.defineComponent({
2342
2359
  },
2343
2360
  emits: ["change", "showSizeChange"],
2344
2361
  setup: (props) => {
2345
- const showQuickJumper = vue.computed(() => {
2346
- return props.total / props.pageSize > 5;
2347
- });
2362
+ const showQuickJumper = vue.computed(() => props.total / props.pageSize > 5);
2348
2363
  return {
2349
2364
  showQuickJumper,
2350
2365
  PRE_CLASS,
@@ -2373,13 +2388,13 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
2373
2388
  }, null, 8, ["current", "total", "pageSize", "showQuickJumper"]),
2374
2389
  vue.createElementVNode("span", {
2375
2390
  class: vue.normalizeClass(`${_ctx.PRE_CLASS}-count`)
2376
- }, vue.toDisplayString(_ctx.i18n("\u5171\u8BA1")) + " " + vue.toDisplayString(_ctx.total || " - ") + " " + vue.toDisplayString(_ctx.i18n("\u6761")), 3)
2391
+ }, vue.toDisplayString(_ctx.i18n("共计")) + " " + vue.toDisplayString(_ctx.total || " - ") + " " + vue.toDisplayString(_ctx.i18n("")), 3)
2377
2392
  ], 2);
2378
2393
  }
2379
2394
  const S2Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
2380
2395
  const RENDER_TOOLTIP_OPTION = {
2381
2396
  tooltip: {
2382
- renderTooltip: (spreadsheet) => new CustomTooltip(spreadsheet)
2397
+ render: (spreadsheet) => new CustomTooltip(spreadsheet)
2383
2398
  }
2384
2399
  };
2385
2400
  const getSheetComponentOptions = (...options) => getBaseSheetComponentOptions(RENDER_TOOLTIP_OPTION, ...options);
@@ -2420,11 +2435,12 @@ const useEvents = (s2Ref, emit) => {
2420
2435
  useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_MOUSE_DOWN, "rowCellMouseDown");
2421
2436
  useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_MOUSE_UP, "rowCellMouseUp");
2422
2437
  useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_MOUSE_MOVE, "rowCellMouseMove");
2438
+ useS2Event(s2Ref, emit, s2.S2Event.ROW_CELL_COLLAPSED, "rowCellCollapsed");
2423
2439
  useS2Event(
2424
2440
  s2Ref,
2425
2441
  emit,
2426
- s2.S2Event.ROW_CELL_COLLAPSE_TREE_ROWS,
2427
- "rowCellCollapseTreeRows"
2442
+ s2.S2Event.ROW_CELL_ALL_COLLAPSED,
2443
+ "rowCellAllCollapsed"
2428
2444
  );
2429
2445
  useS2Event(s2Ref, emit, s2.S2Event.ROW_CELL_SCROLL, "rowCellScroll");
2430
2446
  useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_HOVER, "colCellHover");
@@ -2444,6 +2460,8 @@ const useEvents = (s2Ref, emit) => {
2444
2460
  useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_MOUSE_DOWN, "colCellMouseDown");
2445
2461
  useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_MOUSE_UP, "colCellMouseUp");
2446
2462
  useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_MOUSE_MOVE, "colCellMouseMove");
2463
+ useS2Event(s2Ref, emit, s2.S2Event.COL_CELL_EXPANDED, "colCellExpanded");
2464
+ useS2Event(s2Ref, emit, s2.S2Event.COL_CELL_HIDDEN, "colCellHidden");
2447
2465
  useCellEvent(s2Ref, emit, s2.S2Event.DATA_CELL_HOVER, "dataCellHover");
2448
2466
  useCellEvent(s2Ref, emit, s2.S2Event.DATA_CELL_CLICK, "dataCellClick");
2449
2467
  useCellEvent(
@@ -2471,12 +2489,6 @@ const useEvents = (s2Ref, emit) => {
2471
2489
  s2.S2Event.DATA_CELL_MOUSE_MOVE,
2472
2490
  "dataCellMouseMove"
2473
2491
  );
2474
- useS2Event(
2475
- s2Ref,
2476
- emit,
2477
- s2.S2Event.DATA_CELL_TREND_ICON_CLICK,
2478
- "dataCellTrendIconClick"
2479
- );
2480
2492
  useS2Event(
2481
2493
  s2Ref,
2482
2494
  emit,
@@ -2564,21 +2576,6 @@ const useEvents = (s2Ref, emit) => {
2564
2576
  "layoutAfterHeaderLayout"
2565
2577
  );
2566
2578
  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
2579
  useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_BEFORE_RENDER, "beforeRender");
2583
2580
  useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_AFTER_RENDER, "afterRender");
2584
2581
  useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_DESTROY, "destroy");
@@ -2661,6 +2658,12 @@ const useEvents = (s2Ref, emit) => {
2661
2658
  useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_RESET, "reset");
2662
2659
  useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_LINK_FIELD_JUMP, "linkFieldJump");
2663
2660
  useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_SCROLL, "scroll");
2661
+ useS2Event(
2662
+ s2Ref,
2663
+ emit,
2664
+ s2.S2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDER,
2665
+ "layoutAfterRealDataCellRender"
2666
+ );
2664
2667
  useS2Event(
2665
2668
  s2Ref,
2666
2669
  emit,
@@ -2715,7 +2718,7 @@ const useSheetUpdate = (s2Ref, props) => {
2715
2718
  (dataCfg, prevDataCfg) => {
2716
2719
  var _a, _b, _c, _d, _e, _f;
2717
2720
  if (((_b = (_a = prevDataCfg == null ? void 0 : prevDataCfg.fields) == null ? void 0 : _a.columns) == null ? void 0 : _b.length) !== ((_d = (_c = dataCfg == null ? void 0 : dataCfg.fields) == null ? void 0 : _c.columns) == null ? void 0 : _d.length)) {
2718
- (_e = s2Ref.value) == null ? void 0 : _e.clearColumnLeafNodes();
2721
+ (_e = s2Ref.value) == null ? void 0 : _e.facet.clearInitColLeafNodes();
2719
2722
  }
2720
2723
  updateFlag.rerender = true;
2721
2724
  updateFlag.reloadData = true;
@@ -2739,7 +2742,8 @@ const useSheetUpdate = (s2Ref, props) => {
2739
2742
  if (!flag.rerender) {
2740
2743
  return;
2741
2744
  }
2742
- (_a = s2Ref.value) == null ? void 0 : _a.render(flag.reloadData, {
2745
+ (_a = s2Ref.value) == null ? void 0 : _a.render({
2746
+ reloadData: flag.reloadData,
2743
2747
  reBuildDataSet: flag.rebuildDataset
2744
2748
  });
2745
2749
  flag.rerender = false;
@@ -2749,25 +2753,21 @@ const useSheetUpdate = (s2Ref, props) => {
2749
2753
  };
2750
2754
  const useResize = (s2Ref, props, dom) => {
2751
2755
  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
- });
2768
- },
2769
- { deep: true }
2770
- );
2756
+ vue.watch([s2Ref, () => props.adaptive], ([s22, adaptive], _, onCleanup) => {
2757
+ if (!s22) {
2758
+ return;
2759
+ }
2760
+ unobserve.value = createResizeObserver({
2761
+ s2: s22,
2762
+ adaptive,
2763
+ wrapper: dom.wrapperRef.value,
2764
+ container: dom.containerRef.value
2765
+ });
2766
+ onCleanup(() => {
2767
+ var _a;
2768
+ (_a = unobserve.value) == null ? void 0 : _a.call(unobserve);
2769
+ });
2770
+ });
2771
2771
  };
2772
2772
  function useSpreadSheet(props, emit) {
2773
2773
  const {
@@ -2777,8 +2777,7 @@ function useSpreadSheet(props, emit) {
2777
2777
  loading: loadingProps,
2778
2778
  sheetType,
2779
2779
  onSpreadsheet,
2780
- onMounted: onS2Mounted,
2781
- onGetSpreadSheet
2780
+ onMounted: onS2Mounted
2782
2781
  } = props;
2783
2782
  const wrapperRef = vue.ref();
2784
2783
  const containerRef = vue.ref();
@@ -2803,7 +2802,6 @@ function useSpreadSheet(props, emit) {
2803
2802
  s2Ref.value.setThemeCfg(vue.toRaw(themeCfg));
2804
2803
  s2Ref.value.render();
2805
2804
  setLoading(false);
2806
- onGetSpreadSheet == null ? void 0 : onGetSpreadSheet(s2Ref.value);
2807
2805
  onS2Mounted == null ? void 0 : onS2Mounted(s2Ref.value);
2808
2806
  };
2809
2807
  vue.onMounted(buildSpreadSheet);
@@ -2823,53 +2821,57 @@ function useSpreadSheet(props, emit) {
2823
2821
  pagination
2824
2822
  };
2825
2823
  }
2826
- const initBaseSheetProps = () => ({
2827
- sheetType: String,
2828
- dataCfg: Object,
2829
- themeCfg: Object,
2830
- showPagination: {
2831
- type: [Object, Boolean],
2832
- default: false
2833
- },
2834
- loading: Boolean,
2835
- partDrillDown: Object,
2836
- header: Object,
2837
- options: {
2838
- type: Object,
2839
- default: {}
2840
- },
2841
- adaptive: {
2842
- type: [Object, Boolean],
2843
- default: false
2844
- },
2845
- onSpreadsheet: Function,
2846
- onGetSpreadSheet: Function,
2847
- onMounted: Function
2848
- });
2849
- const initDrillDownProps = () => ({
2850
- className: String,
2851
- titleText: {
2852
- type: String,
2853
- default: s2.i18n("\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6")
2854
- },
2855
- searchText: {
2856
- type: String,
2857
- default: s2.i18n("\u641C\u7D22\u5B57\u6BB5")
2858
- },
2859
- clearButtonText: {
2860
- type: String,
2861
- default: s2.i18n("\u6062\u590D\u9ED8\u8BA4")
2862
- },
2863
- extra: Node,
2864
- dataSet: {
2865
- type: Array,
2866
- default: []
2867
- },
2868
- drillFields: Array,
2869
- disabledFields: Array,
2870
- getDrillFields: Function,
2871
- setDrillFields: Function
2872
- });
2824
+ const initBaseSheetProps = () => {
2825
+ return {
2826
+ sheetType: String,
2827
+ dataCfg: Object,
2828
+ themeCfg: Object,
2829
+ showPagination: {
2830
+ type: [Object, Boolean],
2831
+ default: false
2832
+ },
2833
+ loading: Boolean,
2834
+ // TODO: 待后续完善
2835
+ partDrillDown: Object,
2836
+ header: Object,
2837
+ options: {
2838
+ type: Object,
2839
+ default: {}
2840
+ },
2841
+ adaptive: {
2842
+ type: [Object, Boolean],
2843
+ default: false
2844
+ },
2845
+ onSpreadsheet: Function,
2846
+ onMounted: Function
2847
+ };
2848
+ };
2849
+ const initDrillDownProps = () => {
2850
+ return {
2851
+ className: String,
2852
+ titleText: {
2853
+ type: String,
2854
+ default: s2.i18n("选择下钻维度")
2855
+ },
2856
+ searchText: {
2857
+ type: String,
2858
+ default: s2.i18n("搜索字段")
2859
+ },
2860
+ clearButtonText: {
2861
+ type: String,
2862
+ default: s2.i18n("恢复默认")
2863
+ },
2864
+ extra: Node,
2865
+ dataSet: {
2866
+ type: Array,
2867
+ default: []
2868
+ },
2869
+ drillFields: Array,
2870
+ disabledFields: Array,
2871
+ getDrillFields: Function,
2872
+ setDrillFields: Function
2873
+ };
2874
+ };
2873
2875
  const initDrillDownEmits = () => {
2874
2876
  const keys2 = ["getDrillFields", "setDrillFields"];
2875
2877
  return keys2;
@@ -2877,7 +2879,7 @@ const initDrillDownEmits = () => {
2877
2879
  const initBaseSheetEmits = () => {
2878
2880
  const keys2 = [
2879
2881
  "spreadsheet",
2880
- "getSpreadSheet",
2882
+ // ============== Row Cell ====================
2881
2883
  "rowCellHover",
2882
2884
  "rowCellClick",
2883
2885
  "rowCellDoubleClick",
@@ -2885,8 +2887,10 @@ const initBaseSheetEmits = () => {
2885
2887
  "rowCellMouseDown",
2886
2888
  "rowCellMouseUp",
2887
2889
  "rowCellMouseMove",
2888
- "rowCellCollapseTreeRows",
2890
+ "rowCellCollapsed",
2891
+ "rowCellAllCollapsed",
2889
2892
  "rowCellScroll",
2893
+ // ============== Col Cell ====================
2890
2894
  "colCellHover",
2891
2895
  "colCellClick",
2892
2896
  "colCellDoubleClick",
@@ -2894,6 +2898,9 @@ const initBaseSheetEmits = () => {
2894
2898
  "colCellMouseDown",
2895
2899
  "colCellMouseUp",
2896
2900
  "colCellMouseMove",
2901
+ "colCellExpanded",
2902
+ "colCellHidden",
2903
+ // ============== Data Cell ====================
2897
2904
  "dataCellHover",
2898
2905
  "dataCellClick",
2899
2906
  "dataCellDoubleClick",
@@ -2901,9 +2908,9 @@ const initBaseSheetEmits = () => {
2901
2908
  "dataCellMouseDown",
2902
2909
  "dataCellMouseUp",
2903
2910
  "dataCellMouseMove",
2904
- "dataCellTrendIconClick",
2905
2911
  "dataCellBrushSelection",
2906
2912
  "dataCellSelectMove",
2913
+ // ============== Corner Cell ====================
2907
2914
  "cornerCellHover",
2908
2915
  "cornerCellClick",
2909
2916
  "cornerCellDoubleClick",
@@ -2911,6 +2918,7 @@ const initBaseSheetEmits = () => {
2911
2918
  "cornerCellMouseDown",
2912
2919
  "cornerCellMouseUp",
2913
2920
  "cornerCellMouseMove",
2921
+ // ============== Merged Cells ====================
2914
2922
  "mergedCellsHover",
2915
2923
  "mergedCellsClick",
2916
2924
  "mergedCellsDoubleClick",
@@ -2918,22 +2926,20 @@ const initBaseSheetEmits = () => {
2918
2926
  "mergedCellsMouseDown",
2919
2927
  "mergedCellsMouseUp",
2920
2928
  "mergedCellsMouseMove",
2929
+ // ============== Sort ====================
2921
2930
  "rangeSort",
2922
2931
  "rangeSorted",
2932
+ // ============== Filter ====================
2923
2933
  "rangeFilter",
2924
2934
  "rangeFiltered",
2935
+ // ============== Layout ====================
2925
2936
  "layoutAfterHeaderLayout",
2926
2937
  "layoutPagination",
2927
- "layoutCellScroll",
2928
- "layoutCollapseRows",
2929
- "layoutAfterCollapseRows",
2930
- "collapseRowsAll",
2931
- "layoutColsExpanded",
2932
- "layoutColsHidden",
2933
2938
  "beforeRender",
2934
2939
  "afterRender",
2935
2940
  "mounted",
2936
2941
  "destroy",
2942
+ // ============== Resize ====================
2937
2943
  "layoutResize",
2938
2944
  "layoutResizeSeriesWidth",
2939
2945
  "layoutResizeRowWidth",
@@ -2944,6 +2950,7 @@ const initBaseSheetEmits = () => {
2944
2950
  "layoutResizeMouseDown",
2945
2951
  "layoutResizeMouseUp",
2946
2952
  "layoutResizeMouseMove",
2953
+ // ============== Global ====================
2947
2954
  "keyBoardDown",
2948
2955
  "keyBoardUp",
2949
2956
  "copied",
@@ -2961,6 +2968,8 @@ const initBaseSheetEmits = () => {
2961
2968
  "doubleClick",
2962
2969
  "scroll",
2963
2970
  "hover",
2971
+ // ============== Auto 自动生成的 ================
2972
+ "layoutAfterRealDataCellRender",
2964
2973
  "rowCellBrushSelection",
2965
2974
  "colCellBrushSelection"
2966
2975
  ];
@@ -3115,12 +3124,10 @@ const _sfc_main$3 = vue.defineComponent({
3115
3124
  setDrillFields,
3116
3125
  className
3117
3126
  } = props;
3118
- const getOptions = () => {
3119
- return dataSet.map((val) => {
3120
- val.disabled = !!(disabledFields && disabledFields.includes(val.value));
3121
- return val;
3122
- });
3123
- };
3127
+ const getOptions = () => dataSet.map((val) => {
3128
+ val.disabled = !!(disabledFields && disabledFields.includes(val.value));
3129
+ return val;
3130
+ });
3124
3131
  const options = vue.ref(getOptions());
3125
3132
  const selected = vue.ref([]);
3126
3133
  const handleSearch = (e) => {
@@ -3165,7 +3172,7 @@ const _sfc_main$3 = vue.defineComponent({
3165
3172
  };
3166
3173
  }
3167
3174
  });
3168
- const index_vue_vue_type_style_index_0_scoped_1a60f775_lang = "";
3175
+ const index_vue_vue_type_style_index_0_scoped_8dd920ec_lang = "";
3169
3176
  function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
3170
3177
  const _component_Button = vue.resolveComponent("Button");
3171
3178
  const _component_Input = vue.resolveComponent("Input");
@@ -3233,7 +3240,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
3233
3240
  }, 8, ["selectedKeys", "onSelect"])
3234
3241
  ], 2);
3235
3242
  }
3236
- const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-1a60f775"]]);
3243
+ const DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-8dd920ec"]]);
3237
3244
  const _sfc_main$2 = vue.defineComponent({
3238
3245
  name: "PivotSheet",
3239
3246
  props: initBaseSheetProps(),
@@ -3244,7 +3251,7 @@ const _sfc_main$2 = vue.defineComponent({
3244
3251
  const { dataCfg, partDrillDown } = vue.toRefs(props);
3245
3252
  const drillFields = vue.ref([]);
3246
3253
  const setDrillFields = (fields) => {
3247
- var _a, _b, _c, _d, _e, _f;
3254
+ var _a, _b, _c, _d, _e;
3248
3255
  const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
3249
3256
  drillFields.value = fields;
3250
3257
  instance == null ? void 0 : instance.hideTooltip();
@@ -3252,10 +3259,10 @@ const _sfc_main$2 = vue.defineComponent({
3252
3259
  instance == null ? void 0 : instance.clearDrillDownData((_b = instance == null ? void 0 : instance.store.get("drillDownNode")) == null ? void 0 : _b.id);
3253
3260
  } else {
3254
3261
  handleDrillDown({
3255
- rows: (_d = (_c = dataCfg.value) == null ? void 0 : _c.fields.rows) != null ? _d : [],
3262
+ rows: ((_c = dataCfg.value) == null ? void 0 : _c.fields.rows) ?? [],
3256
3263
  drillFields: fields,
3257
- fetchData: (_e = partDrillDown.value) == null ? void 0 : _e.fetchData,
3258
- drillItemsNum: (_f = partDrillDown.value) == null ? void 0 : _f.drillItemsNum,
3264
+ fetchData: (_d = partDrillDown.value) == null ? void 0 : _d["fetchData"],
3265
+ drillItemsNum: (_e = partDrillDown.value) == null ? void 0 : _e["drillItemsNum"],
3259
3266
  spreadsheet: instance
3260
3267
  });
3261
3268
  }
@@ -3266,7 +3273,7 @@ const _sfc_main$2 = vue.defineComponent({
3266
3273
  if (event) {
3267
3274
  const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
3268
3275
  const drillDownNode = vue.createVNode(DrillDown, {
3269
- ...(_b = partDrillDown.value) == null ? void 0 : _b.drillConfig,
3276
+ ...(_b = partDrillDown.value) == null ? void 0 : _b["drillConfig"],
3270
3277
  setDrillFields,
3271
3278
  drillFields: drillFields.value,
3272
3279
  disabledFields
@@ -3329,7 +3336,7 @@ const _sfc_main = vue.defineComponent({
3329
3336
  setup(props, ctx) {
3330
3337
  const s2Ref = useExpose(ctx.expose);
3331
3338
  const sheetType = vue.computed(() => {
3332
- const type = ctx.attrs.sheetType;
3339
+ const type = ctx.attrs["sheetType"];
3333
3340
  switch (type) {
3334
3341
  case "table":
3335
3342
  return TableSheet;
@@ -3348,10 +3355,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
3348
3355
  return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.sheetType), { ref: "s2Ref" }, null, 512);
3349
3356
  }
3350
3357
  const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
3358
+ const version = "@antv/s2-vue-v2.0.0-next.10";
3351
3359
  exports.BaseSheet = BaseSheet;
3352
3360
  exports.CustomTooltip = CustomTooltip;
3353
3361
  exports.PivotSheet = PivotSheet;
3354
3362
  exports.SheetComponent = index;
3355
3363
  exports.TableSheet = TableSheet;
3356
3364
  exports.useExpose = useExpose;
3365
+ exports.version = version;
3357
3366
  //# sourceMappingURL=index.js.map