@antv/s2-vue 2.0.0-next.6 → 2.0.0-next.8
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/README.md +1 -0
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/style.min.css +1 -1
- package/esm/index.d.ts +1398 -503
- package/esm/index.js +64 -56
- package/esm/index.js.map +1 -1
- package/esm/style.css +55 -42
- package/lib/index.js +64 -56
- package/lib/index.js.map +1 -1
- package/lib/style.css +55 -42
- package/package.json +8 -8
package/esm/index.js
CHANGED
|
@@ -91,7 +91,7 @@ const Locale = {
|
|
|
91
91
|
};
|
|
92
92
|
const SHEET_COMPONENT_DEFAULT_OPTIONS = {
|
|
93
93
|
tooltip: {
|
|
94
|
-
|
|
94
|
+
enable: true,
|
|
95
95
|
autoAdjustBoundary: "body",
|
|
96
96
|
operation: {
|
|
97
97
|
hiddenColumns: true,
|
|
@@ -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" ||
|
|
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
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
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.
|
|
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,
|
|
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.
|
|
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.
|
|
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
|
-
"
|
|
2066
|
-
"
|
|
2067
|
-
"onClick",
|
|
2070
|
+
"menu",
|
|
2071
|
+
"onlyShowOperator",
|
|
2068
2072
|
"cell"
|
|
2069
2073
|
],
|
|
2070
|
-
setup(
|
|
2074
|
+
setup(props) {
|
|
2075
|
+
const { menu, cell } = props;
|
|
2071
2076
|
const onMenuClick = (menuInfo) => {
|
|
2072
|
-
|
|
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: {
|
|
@@ -2092,7 +2103,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2092
2103
|
return openBlock(), createElementBlock("div", {
|
|
2093
2104
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator`)
|
|
2094
2105
|
}, [
|
|
2095
|
-
_ctx.
|
|
2106
|
+
_ctx.onlyShowOperator ? (openBlock(), createBlock(_component_Menu, {
|
|
2096
2107
|
key: 0,
|
|
2097
2108
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-menus`),
|
|
2098
2109
|
onClick: _ctx.onMenuClick
|
|
@@ -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
|
|
@@ -2159,10 +2167,12 @@ const _sfc_main$6 = defineComponent({
|
|
|
2159
2167
|
"content"
|
|
2160
2168
|
],
|
|
2161
2169
|
setup(props) {
|
|
2162
|
-
const { operator,
|
|
2170
|
+
const { operator, onlyShowOperator } = getTooltipDefaultOptions(
|
|
2171
|
+
props.options
|
|
2172
|
+
);
|
|
2163
2173
|
return {
|
|
2164
2174
|
operator,
|
|
2165
|
-
|
|
2175
|
+
onlyShowOperator
|
|
2166
2176
|
};
|
|
2167
2177
|
},
|
|
2168
2178
|
components: {
|
|
@@ -2176,45 +2186,43 @@ const _sfc_main$6 = defineComponent({
|
|
|
2176
2186
|
});
|
|
2177
2187
|
const index_vue_vue_type_style_index_0_lang = "";
|
|
2178
2188
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2179
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n
|
|
2189
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
2180
2190
|
const _component_TooltipOperator = resolveComponent("TooltipOperator");
|
|
2181
2191
|
const _component_TooltipSimpleTips = resolveComponent("TooltipSimpleTips");
|
|
2182
2192
|
const _component_TooltipSummary = resolveComponent("TooltipSummary");
|
|
2183
2193
|
const _component_TooltipHeadInfo = resolveComponent("TooltipHeadInfo");
|
|
2184
2194
|
const _component_TooltipDetail = resolveComponent("TooltipDetail");
|
|
2185
2195
|
const _component_TooltipInfos = resolveComponent("TooltipInfos");
|
|
2186
|
-
return _ctx.
|
|
2196
|
+
return _ctx.onlyShowOperator ? (openBlock(), createBlock(_component_TooltipOperator, {
|
|
2187
2197
|
key: 0,
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
cell: _ctx.cell
|
|
2191
|
-
|
|
2192
|
-
}, 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 }, [
|
|
2193
2202
|
createVNode(_component_TooltipOperator, {
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
cell: _ctx.cell
|
|
2197
|
-
|
|
2198
|
-
}, 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"]),
|
|
2199
2207
|
_ctx.content ? renderSlot(_ctx.$slots, "content", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2200
2208
|
createVNode(_component_TooltipSimpleTips, {
|
|
2201
|
-
name: (
|
|
2202
|
-
tips: (
|
|
2209
|
+
name: (_c = _ctx.data) == null ? void 0 : _c.name,
|
|
2210
|
+
tips: (_d = _ctx.data) == null ? void 0 : _d.tips
|
|
2203
2211
|
}, null, 8, ["name", "tips"]),
|
|
2204
|
-
((
|
|
2212
|
+
((_f = (_e = _ctx.data) == null ? void 0 : _e.summaries) == null ? void 0 : _f.length) ? (openBlock(), createBlock(_component_TooltipSummary, {
|
|
2205
2213
|
key: 0,
|
|
2206
|
-
summaries: (
|
|
2214
|
+
summaries: (_g = _ctx.data) == null ? void 0 : _g.summaries
|
|
2207
2215
|
}, null, 8, ["summaries"])) : createCommentVNode("", true),
|
|
2208
2216
|
createVNode(_component_TooltipHeadInfo, {
|
|
2209
|
-
rows: ((
|
|
2210
|
-
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) || []
|
|
2211
2219
|
}, null, 8, ["rows", "cols"]),
|
|
2212
2220
|
createVNode(_component_TooltipDetail, {
|
|
2213
|
-
list: ((
|
|
2221
|
+
list: ((_l = _ctx.data) == null ? void 0 : _l.details) || []
|
|
2214
2222
|
}, null, 8, ["list"]),
|
|
2215
|
-
((
|
|
2223
|
+
((_m = _ctx.data) == null ? void 0 : _m.infos) ? (openBlock(), createBlock(_component_TooltipInfos, {
|
|
2216
2224
|
key: 1,
|
|
2217
|
-
infos: (
|
|
2225
|
+
infos: (_n = _ctx.data) == null ? void 0 : _n.infos
|
|
2218
2226
|
}, null, 8, ["infos"])) : createCommentVNode("", true)
|
|
2219
2227
|
], 64))
|
|
2220
2228
|
], 64));
|
|
@@ -2384,7 +2392,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2384
2392
|
const S2Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
|
|
2385
2393
|
const RENDER_TOOLTIP_OPTION = {
|
|
2386
2394
|
tooltip: {
|
|
2387
|
-
|
|
2395
|
+
render: (spreadsheet) => new CustomTooltip(spreadsheet)
|
|
2388
2396
|
}
|
|
2389
2397
|
};
|
|
2390
2398
|
const getSheetComponentOptions = (...options) => getBaseSheetComponentOptions(RENDER_TOOLTIP_OPTION, ...options);
|
|
@@ -2708,7 +2716,7 @@ const useSheetUpdate = (s2Ref, props) => {
|
|
|
2708
2716
|
(dataCfg, prevDataCfg) => {
|
|
2709
2717
|
var _a, _b, _c, _d, _e, _f;
|
|
2710
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)) {
|
|
2711
|
-
(_e = s2Ref.value) == null ? void 0 : _e.
|
|
2719
|
+
(_e = s2Ref.value) == null ? void 0 : _e.facet.clearInitColLeafNodes();
|
|
2712
2720
|
}
|
|
2713
2721
|
updateFlag.rerender = true;
|
|
2714
2722
|
updateFlag.reloadData = true;
|