@antv/s2-vue 2.0.0-next.7 → 2.0.0-next.9

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
@@ -447,7 +447,9 @@ function arrayLikeKeys(value, inherited) {
447
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;
448
448
  for (var key in value) {
449
449
  if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
450
- (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
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.
451
453
  isIndex(key, length)))) {
452
454
  result.push(key);
453
455
  }
@@ -1722,21 +1724,23 @@ const buildDrillDownOptions = (options, partDrillDown, callback) => {
1722
1724
  const nextHeaderIcons = ((_a = options == null ? void 0 : options.headerActionIcons) == null ? void 0 : _a.length) ? [...options.headerActionIcons] : [];
1723
1725
  if (!isEmpty(partDrillDown)) {
1724
1726
  const drillDownActionIcon = {
1725
- belongsCell: "rowCell",
1726
- icons: ["DrillDownIcon"],
1727
- defaultHide: true,
1728
- displayCondition: partDrillDown.displayCondition || defaultPartDrillDownDisplayCondition,
1729
- onClick: (actionIconProps) => {
1730
- const { iconName, meta, event } = actionIconProps;
1731
- if (iconName === "DrillDownIcon") {
1732
- meta.spreadsheet.store.set("drillDownNode", meta);
1733
- handleActionIconClick({
1734
- meta,
1735
- event,
1736
- callback
1737
- });
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
+ }
1738
1739
  }
1739
- }
1740
+ ],
1741
+ belongsCell: "rowCell",
1742
+ defaultHide: false,
1743
+ displayCondition: (partDrillDown == null ? void 0 : partDrillDown.displayCondition) || defaultPartDrillDownDisplayCondition
1740
1744
  };
1741
1745
  nextHeaderIcons.push(drillDownActionIcon);
1742
1746
  }
@@ -1976,7 +1980,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
1976
1980
  }, null, 10, _hoisted_1$3)) : createCommentVNode("", true),
1977
1981
  createElementVNode("span", {
1978
1982
  class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-text`)
1979
- }, toDisplayString(_ctx.menu.text), 3)
1983
+ }, toDisplayString(_ctx.menu.label), 3)
1980
1984
  ]);
1981
1985
  }
1982
1986
  const TooltipOperatorTitle = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9]]);
@@ -1984,9 +1988,10 @@ const _sfc_main$8 = defineComponent({
1984
1988
  name: "TooltipOperatorMenu",
1985
1989
  props: ["menu", "cell"],
1986
1990
  setup(props) {
1991
+ const { menu, cell } = props;
1987
1992
  const onMenuTitleClick = () => {
1988
1993
  var _a, _b;
1989
- (_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);
1990
1995
  };
1991
1996
  return {
1992
1997
  onMenuTitleClick,
@@ -2028,7 +2033,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
2028
2033
  menu: subMenu,
2029
2034
  cell: _ctx.cell
2030
2035
  }, null, 8, ["menu", "cell"])) : (openBlock(), createBlock(_component_MenuItem, {
2031
- title: subMenu.text,
2036
+ title: subMenu.label,
2032
2037
  key: subMenu.key
2033
2038
  }, {
2034
2039
  default: withCtx(() => [
@@ -2045,7 +2050,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
2045
2050
  _: 1
2046
2051
  }, 8, ["popupClassName", "onTitleClick"])) : createCommentVNode("", true),
2047
2052
  _ctx.isEmpty(_ctx.menu.children) ? (openBlock(), createBlock(_component_MenuItem, {
2048
- title: _ctx.menu.text,
2053
+ title: _ctx.menu.label,
2049
2054
  key: _ctx.menu.key
2050
2055
  }, {
2051
2056
  default: withCtx(() => [
@@ -2062,18 +2067,24 @@ const TooltipOperatorMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render",
2062
2067
  const _sfc_main$7 = defineComponent({
2063
2068
  name: "TooltipOperator",
2064
2069
  props: [
2065
- "menus",
2070
+ "menu",
2066
2071
  "onlyShowOperator",
2067
- "onClick",
2068
2072
  "cell"
2069
2073
  ],
2070
- setup(_, { emit }) {
2074
+ setup(props) {
2075
+ const { menu, cell } = props;
2071
2076
  const onMenuClick = (menuInfo) => {
2072
- 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);
2073
2082
  };
2074
2083
  return {
2075
2084
  TOOLTIP_PREFIX_CLS,
2076
- onMenuClick
2085
+ onMenuClick,
2086
+ onMenuTitleClick,
2087
+ menus: menu == null ? void 0 : menu.items
2077
2088
  };
2078
2089
  },
2079
2090
  components: {
@@ -2136,10 +2147,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
2136
2147
  default: withCtx(() => [
2137
2148
  createVNode(_component_TooltipOperatorTitle, {
2138
2149
  menu,
2139
- onClick: ($event) => {
2140
- var _a;
2141
- return (_a = menu.onClick) == null ? void 0 : _a.call(menu, _ctx.cell);
2142
- }
2150
+ onClick: ($event) => _ctx.onMenuTitleClick(menu)
2143
2151
  }, null, 8, ["menu", "onClick"])
2144
2152
  ]),
2145
2153
  _: 2
@@ -2178,7 +2186,7 @@ const _sfc_main$6 = defineComponent({
2178
2186
  });
2179
2187
  const index_vue_vue_type_style_index_0_lang = "";
2180
2188
  function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
2181
- 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;
2182
2190
  const _component_TooltipOperator = resolveComponent("TooltipOperator");
2183
2191
  const _component_TooltipSimpleTips = resolveComponent("TooltipSimpleTips");
2184
2192
  const _component_TooltipSummary = resolveComponent("TooltipSummary");
@@ -2187,36 +2195,34 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
2187
2195
  const _component_TooltipInfos = resolveComponent("TooltipInfos");
2188
2196
  return _ctx.onlyShowOperator ? (openBlock(), createBlock(_component_TooltipOperator, {
2189
2197
  key: 0,
2190
- menus: ((_a = _ctx.operator) == null ? void 0 : _a.menus) || [],
2198
+ menu: (_a = _ctx.operator) == null ? void 0 : _a.menu,
2191
2199
  onlyShowOperator: true,
2192
- cell: _ctx.cell,
2193
- onClick: (_b = _ctx.operator) == null ? void 0 : _b.onClick
2194
- }, null, 8, ["menus", "cell", "onClick"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2200
+ cell: _ctx.cell
2201
+ }, null, 8, ["menu", "cell"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2195
2202
  createVNode(_component_TooltipOperator, {
2196
- menus: ((_c = _ctx.operator) == null ? void 0 : _c.menus) || [],
2203
+ menu: (_b = _ctx.operator) == null ? void 0 : _b.menu,
2197
2204
  onlyShowOperator: false,
2198
- cell: _ctx.cell,
2199
- onClick: (_d = _ctx.operator) == null ? void 0 : _d.onClick
2200
- }, null, 8, ["menus", "cell", "onClick"]),
2205
+ cell: _ctx.cell
2206
+ }, null, 8, ["menu", "cell"]),
2201
2207
  _ctx.content ? renderSlot(_ctx.$slots, "content", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2202
2208
  createVNode(_component_TooltipSimpleTips, {
2203
- name: (_e = _ctx.data) == null ? void 0 : _e.name,
2204
- 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
2205
2211
  }, null, 8, ["name", "tips"]),
2206
- ((_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, {
2207
2213
  key: 0,
2208
- summaries: (_i = _ctx.data) == null ? void 0 : _i.summaries
2214
+ summaries: (_g = _ctx.data) == null ? void 0 : _g.summaries
2209
2215
  }, null, 8, ["summaries"])) : createCommentVNode("", true),
2210
2216
  createVNode(_component_TooltipHeadInfo, {
2211
- rows: ((_k = (_j = _ctx.data) == null ? void 0 : _j.headInfo) == null ? void 0 : _k.rows) || [],
2212
- 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) || []
2213
2219
  }, null, 8, ["rows", "cols"]),
2214
2220
  createVNode(_component_TooltipDetail, {
2215
- list: ((_n = _ctx.data) == null ? void 0 : _n.details) || []
2221
+ list: ((_l = _ctx.data) == null ? void 0 : _l.details) || []
2216
2222
  }, null, 8, ["list"]),
2217
- ((_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, {
2218
2224
  key: 1,
2219
- infos: (_p = _ctx.data) == null ? void 0 : _p.infos
2225
+ infos: (_n = _ctx.data) == null ? void 0 : _n.infos
2220
2226
  }, null, 8, ["infos"])) : createCommentVNode("", true)
2221
2227
  ], 64))
2222
2228
  ], 64));