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