@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/style.css CHANGED
@@ -2,30 +2,31 @@
2
2
  color: var(--antv-s2-font, rgba(0, 0, 0, 0.65));
3
3
  background: var(--antv-s2-tooltip-operator-background, #f9f9f9);
4
4
  font-size: 12px;
5
- line-height: 32px;
6
- padding: 0 12px;
5
+ line-height: 36px;
7
6
  border: 0;
8
7
  cursor: pointer;
9
8
  }
9
+ .antv-s2-tooltip-operator .ant-menu-horizontal:not(.ant-menu-dark) {
10
+ background: transparent;
11
+ line-height: 36px;
12
+ }
10
13
  .antv-s2-tooltip-operator .ant-dropdown-trigger,
11
14
  .antv-s2-tooltip-operator-dropdown {
12
15
  padding: 0 6px 0 0;
13
16
  }
14
17
  .antv-s2-tooltip-operator-menus.ant-menu-vertical.ant-menu {
15
18
  font-size: 12px;
16
- line-height: 32px;
17
19
  color: var(--antv-s2-font, rgba(0, 0, 0, 0.65));
18
20
  border: 0;
19
- margin: 0 -12px;
21
+ user-select: none;
22
+ padding: 4px;
20
23
  }
21
24
  .antv-s2-tooltip-operator-menus.ant-menu-vertical.ant-menu .ant-menu-item {
22
- height: 30px;
23
- }
24
- .antv-s2-tooltip-operator-menus.ant-menu-vertical.ant-menu .ant-menu-item:not(:last-child) {
25
- margin: 0;
25
+ height: 36px;
26
26
  }
27
27
  .antv-s2-tooltip-operator-menus.ant-menu-vertical.ant-menu .ant-menu-submenu > .ant-menu-submenu-title {
28
- height: 30px;
28
+ height: 36px;
29
+ width: 100%;
29
30
  }
30
31
  .antv-s2-tooltip-operator-menus.ant-menu-vertical.ant-menu .ant-menu-submenu > .ant-menu-submenu-title .ant-menu-submenu-arrow {
31
32
  color: var(--antv-s2-font, rgba(0, 0, 0, 0.65));
@@ -35,10 +36,9 @@
35
36
  .antv-s2-tooltip-operator-menus.ant-dropdown-menu-vertical .ant-menu-item,
36
37
  .antv-s2-tooltip-operator-menus.ant-menu-vertical .ant-menu-item {
37
38
  font-size: 12px;
38
- line-height: 32px;
39
+ line-height: 36px;
39
40
  padding: 0 12px;
40
41
  border: 0;
41
- margin: 0;
42
42
  }
43
43
  .antv-s2-tooltip-operator-menus.ant-dropdown-menu-vertical .ant-dropdown-menu-item:not(.ant-menu-item-active),
44
44
  .antv-s2-tooltip-operator-menus.ant-menu-vertical .ant-dropdown-menu-item:not(.ant-menu-item-active),
@@ -54,9 +54,9 @@
54
54
  .antv-s2-tooltip-operator-menus.ant-menu-vertical .ant-menu-submenu .ant-menu-submenu-title,
55
55
  .antv-s2-tooltip-operator-menus.ant-dropdown-menu-vertical .ant-menu-submenu-vertical .ant-menu-submenu-title,
56
56
  .antv-s2-tooltip-operator-menus.ant-menu-vertical .ant-menu-submenu-vertical .ant-menu-submenu-title {
57
- padding: 0 12px;
57
+ padding: 0 0 0 12px;
58
58
  font-size: 12px;
59
- line-height: 32px;
59
+ line-height: 36px;
60
60
  margin: 0;
61
61
  }
62
62
  .antv-s2-tooltip-operator-menus.ant-dropdown-menu-vertical .ant-dropdown-menu-submenu .ant-menu-submenu-title:not(.ant-menu-item-active),
@@ -90,7 +90,7 @@
90
90
  .antv-s2-tooltip-operator-submenu-popup .ant-dropdown-menu-item,
91
91
  .antv-s2-tooltip-operator-submenu-popup .ant-menu-item {
92
92
  font-size: 12px;
93
- line-height: 32px;
93
+ line-height: 36px;
94
94
  padding: 0 12px;
95
95
  }
96
96
  .antv-s2-tooltip-operator-submenu-popup .ant-dropdown-menu-item:not(.ant-menu-item-active),
@@ -99,15 +99,15 @@
99
99
  }
100
100
  .antv-s2-tooltip-operator-submenu-popup .ant-menu-vertical .ant-menu-item {
101
101
  margin: 0;
102
- height: 30px;
103
- line-height: 32px;
102
+ height: 36px;
103
+ line-height: 36px;
104
+ width: 100%;
104
105
  }
105
106
  .antv-s2-tooltip-operator-submenu-popup .ant-menu-vertical .ant-menu-item:not(:last-child) {
106
107
  margin: 0;
107
108
  }
108
109
  .antv-s2-tooltip-operator-icon {
109
110
  vertical-align: middle;
110
- margin-right: 4px;
111
111
  }
112
112
  .antv-s2-tooltip-operator-icon svg {
113
113
  width: 12px;
@@ -170,7 +170,7 @@
170
170
  z-index: 1024;
171
171
  display: inline-block;
172
172
  background: var(--antv-s2-tooltip-background, rgba(255, 255, 255, 0.95));
173
- border-radius: 2px;
173
+ border-radius: 4px;
174
174
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2);
175
175
  font-size: 12px;
176
176
  font-family: Roboto, 'PingFang SC', 'Chinese Quote', BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
@@ -329,6 +329,7 @@
329
329
  width: 260px;
330
330
  min-height: 20px;
331
331
  position: relative;
332
+ color: var(--antv-s2-font-70, #fff);
332
333
  }
333
334
  .antv-s2-drill-down-header[data-v-8dd920ec] {
334
335
  display: flex;
@@ -352,16 +353,21 @@
352
353
  margin: 0 16px;
353
354
  border: 1px solid rgba(0, 0, 0, 0.15);
354
355
  border-radius: 2px;
355
- background-color: #fff;
356
356
  }
357
357
  .antv-s2-drill-down-search input[data-v-8dd920ec],
358
358
  .antv-s2-drill-down-search span[data-v-8dd920ec] {
359
359
  font-size: 12px;
360
360
  }
361
+ .antv-s2-drill-down-search[data-v-8dd920ec],
362
+ .antv-s2-drill-down-search .ant-input[data-v-8dd920ec]::placeholder {
363
+ background-color: var(--antv-s2-block-background, #fff);
364
+ }
365
+ .antv-s2-drill-down-extra[data-v-8dd920ec] {
366
+ margin: 4px 16px;
367
+ }
361
368
  .antv-s2-drill-down-menu[data-v-8dd920ec] {
362
369
  max-height: 314px;
363
- overflow-y: auto;
364
- overflow-x: hidden;
370
+ overflow: hidden auto;
365
371
  }
366
372
  .antv-s2-drill-down-menu.ant-menu[data-v-8dd920ec] {
367
373
  background: var(--antv-s2-tooltip-background, #fff);
@@ -382,6 +388,6 @@
382
388
  margin-right: 8px;
383
389
  }
384
390
  .antv-s2-drill-down-empty[data-v-8dd920ec] {
385
- padding: 18px 18px 0;
391
+ padding: 12px;
386
392
  font-size: 12px;
387
393
  }
package/lib/index.js CHANGED
@@ -449,7 +449,9 @@ function arrayLikeKeys(value, inherited) {
449
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;
450
450
  for (var key in value) {
451
451
  if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
452
- (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
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.
453
455
  isIndex(key, length)))) {
454
456
  result.push(key);
455
457
  }
@@ -1724,21 +1726,23 @@ const buildDrillDownOptions = (options, partDrillDown, callback) => {
1724
1726
  const nextHeaderIcons = ((_a = options == null ? void 0 : options.headerActionIcons) == null ? void 0 : _a.length) ? [...options.headerActionIcons] : [];
1725
1727
  if (!isEmpty(partDrillDown)) {
1726
1728
  const drillDownActionIcon = {
1727
- belongsCell: "rowCell",
1728
- icons: ["DrillDownIcon"],
1729
- defaultHide: true,
1730
- displayCondition: partDrillDown.displayCondition || defaultPartDrillDownDisplayCondition,
1731
- onClick: (actionIconProps) => {
1732
- const { iconName, meta, event } = actionIconProps;
1733
- if (iconName === "DrillDownIcon") {
1734
- meta.spreadsheet.store.set("drillDownNode", meta);
1735
- handleActionIconClick({
1736
- meta,
1737
- event,
1738
- callback
1739
- });
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
+ }
1740
1741
  }
1741
- }
1742
+ ],
1743
+ belongsCell: "rowCell",
1744
+ defaultHide: false,
1745
+ displayCondition: (partDrillDown == null ? void 0 : partDrillDown.displayCondition) || defaultPartDrillDownDisplayCondition
1742
1746
  };
1743
1747
  nextHeaderIcons.push(drillDownActionIcon);
1744
1748
  }
@@ -1978,7 +1982,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
1978
1982
  }, null, 10, _hoisted_1$3)) : vue.createCommentVNode("", true),
1979
1983
  vue.createElementVNode("span", {
1980
1984
  class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-text`)
1981
- }, vue.toDisplayString(_ctx.menu.text), 3)
1985
+ }, vue.toDisplayString(_ctx.menu.label), 3)
1982
1986
  ]);
1983
1987
  }
1984
1988
  const TooltipOperatorTitle = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9]]);
@@ -1986,9 +1990,10 @@ const _sfc_main$8 = vue.defineComponent({
1986
1990
  name: "TooltipOperatorMenu",
1987
1991
  props: ["menu", "cell"],
1988
1992
  setup(props) {
1993
+ const { menu, cell } = props;
1989
1994
  const onMenuTitleClick = () => {
1990
1995
  var _a, _b;
1991
- (_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);
1992
1997
  };
1993
1998
  return {
1994
1999
  onMenuTitleClick,
@@ -2030,7 +2035,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
2030
2035
  menu: subMenu,
2031
2036
  cell: _ctx.cell
2032
2037
  }, null, 8, ["menu", "cell"])) : (vue.openBlock(), vue.createBlock(_component_MenuItem, {
2033
- title: subMenu.text,
2038
+ title: subMenu.label,
2034
2039
  key: subMenu.key
2035
2040
  }, {
2036
2041
  default: vue.withCtx(() => [
@@ -2047,7 +2052,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
2047
2052
  _: 1
2048
2053
  }, 8, ["popupClassName", "onTitleClick"])) : vue.createCommentVNode("", true),
2049
2054
  _ctx.isEmpty(_ctx.menu.children) ? (vue.openBlock(), vue.createBlock(_component_MenuItem, {
2050
- title: _ctx.menu.text,
2055
+ title: _ctx.menu.label,
2051
2056
  key: _ctx.menu.key
2052
2057
  }, {
2053
2058
  default: vue.withCtx(() => [
@@ -2064,18 +2069,24 @@ const TooltipOperatorMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render",
2064
2069
  const _sfc_main$7 = vue.defineComponent({
2065
2070
  name: "TooltipOperator",
2066
2071
  props: [
2067
- "menus",
2072
+ "menu",
2068
2073
  "onlyShowOperator",
2069
- "onClick",
2070
2074
  "cell"
2071
2075
  ],
2072
- setup(_, { emit }) {
2076
+ setup(props) {
2077
+ const { menu, cell } = props;
2073
2078
  const onMenuClick = (menuInfo) => {
2074
- 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);
2075
2084
  };
2076
2085
  return {
2077
2086
  TOOLTIP_PREFIX_CLS: s2.TOOLTIP_PREFIX_CLS,
2078
- onMenuClick
2087
+ onMenuClick,
2088
+ onMenuTitleClick,
2089
+ menus: menu == null ? void 0 : menu.items
2079
2090
  };
2080
2091
  },
2081
2092
  components: {
@@ -2138,10 +2149,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
2138
2149
  default: vue.withCtx(() => [
2139
2150
  vue.createVNode(_component_TooltipOperatorTitle, {
2140
2151
  menu,
2141
- onClick: ($event) => {
2142
- var _a;
2143
- return (_a = menu.onClick) == null ? void 0 : _a.call(menu, _ctx.cell);
2144
- }
2152
+ onClick: ($event) => _ctx.onMenuTitleClick(menu)
2145
2153
  }, null, 8, ["menu", "onClick"])
2146
2154
  ]),
2147
2155
  _: 2
@@ -2180,7 +2188,7 @@ const _sfc_main$6 = vue.defineComponent({
2180
2188
  });
2181
2189
  const index_vue_vue_type_style_index_0_lang = "";
2182
2190
  function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
2183
- 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;
2184
2192
  const _component_TooltipOperator = vue.resolveComponent("TooltipOperator");
2185
2193
  const _component_TooltipSimpleTips = vue.resolveComponent("TooltipSimpleTips");
2186
2194
  const _component_TooltipSummary = vue.resolveComponent("TooltipSummary");
@@ -2189,36 +2197,34 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
2189
2197
  const _component_TooltipInfos = vue.resolveComponent("TooltipInfos");
2190
2198
  return _ctx.onlyShowOperator ? (vue.openBlock(), vue.createBlock(_component_TooltipOperator, {
2191
2199
  key: 0,
2192
- menus: ((_a = _ctx.operator) == null ? void 0 : _a.menus) || [],
2200
+ menu: (_a = _ctx.operator) == null ? void 0 : _a.menu,
2193
2201
  onlyShowOperator: true,
2194
- cell: _ctx.cell,
2195
- onClick: (_b = _ctx.operator) == null ? void 0 : _b.onClick
2196
- }, null, 8, ["menus", "cell", "onClick"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2202
+ cell: _ctx.cell
2203
+ }, null, 8, ["menu", "cell"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2197
2204
  vue.createVNode(_component_TooltipOperator, {
2198
- menus: ((_c = _ctx.operator) == null ? void 0 : _c.menus) || [],
2205
+ menu: (_b = _ctx.operator) == null ? void 0 : _b.menu,
2199
2206
  onlyShowOperator: false,
2200
- cell: _ctx.cell,
2201
- onClick: (_d = _ctx.operator) == null ? void 0 : _d.onClick
2202
- }, null, 8, ["menus", "cell", "onClick"]),
2207
+ cell: _ctx.cell
2208
+ }, null, 8, ["menu", "cell"]),
2203
2209
  _ctx.content ? vue.renderSlot(_ctx.$slots, "content", { key: 0 }) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2204
2210
  vue.createVNode(_component_TooltipSimpleTips, {
2205
- name: (_e = _ctx.data) == null ? void 0 : _e.name,
2206
- 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
2207
2213
  }, null, 8, ["name", "tips"]),
2208
- ((_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, {
2209
2215
  key: 0,
2210
- summaries: (_i = _ctx.data) == null ? void 0 : _i.summaries
2216
+ summaries: (_g = _ctx.data) == null ? void 0 : _g.summaries
2211
2217
  }, null, 8, ["summaries"])) : vue.createCommentVNode("", true),
2212
2218
  vue.createVNode(_component_TooltipHeadInfo, {
2213
- rows: ((_k = (_j = _ctx.data) == null ? void 0 : _j.headInfo) == null ? void 0 : _k.rows) || [],
2214
- 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) || []
2215
2221
  }, null, 8, ["rows", "cols"]),
2216
2222
  vue.createVNode(_component_TooltipDetail, {
2217
- list: ((_n = _ctx.data) == null ? void 0 : _n.details) || []
2223
+ list: ((_l = _ctx.data) == null ? void 0 : _l.details) || []
2218
2224
  }, null, 8, ["list"]),
2219
- ((_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, {
2220
2226
  key: 1,
2221
- infos: (_p = _ctx.data) == null ? void 0 : _p.infos
2227
+ infos: (_n = _ctx.data) == null ? void 0 : _n.infos
2222
2228
  }, null, 8, ["infos"])) : vue.createCommentVNode("", true)
2223
2229
  ], 64))
2224
2230
  ], 64));